Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OperatorBraQuantumObject and OperatorKetQuantumObject #44

Merged
merged 9 commits into from
Apr 7, 2024

Conversation

ytdHuang
Copy link
Member

@ytdHuang ytdHuang commented Apr 1, 2024

Solve #37

TODO list (I definitely miss something, let me know and I will add to the list):

  • define abstract type OperatorBraQuantumObject <: QuantumObjectType end (8994e7d)
  • define abstract type OperatorKetQuantumObject <: QuantumObjectType end (8994e7d)
  • method show for above new types (8994e7d)
  • define isoperbra() (8994e7d)
  • define isoperket() (8994e7d)
  • QuantumObject constructors for OperatorKet and OperatorBra (0060fff)
  • check if the basic operations still works: :(+), :(-), :(*) (0060fff)
  • make mat2vec(Operator) -> OperatorKet (0096192)
  • make vec2mat(OperatorKet) -> Operator (0096192)
  • make adjoint(OperatorKet) -> OperatorBra (0060fff)
  • make adjoint(OperatorBra) -> OperatorKet (0060fff)
  • support Base.conj() for all QuantumObjectType (0060fff)
  • support SuperOperator * Operator -> Operator (0060fff)
  • support SuperOperator * OperatorKet -> OperatorKet (0060fff)
  • support OperatorBra * SuperOperator -> OperatorBra (0060fff)
  • support OperatorBra * OperatorKet -> Number (0060fff)
  • support dot(OperatorKet, OperatorKet) -> Number (0060fff)

@ytdHuang ytdHuang linked an issue Apr 1, 2024 that may be closed by this pull request
@ytdHuang ytdHuang self-assigned this Apr 1, 2024
@ytdHuang ytdHuang requested review from albertomercurio and removed request for albertomercurio April 2, 2024 00:19
@ytdHuang ytdHuang marked this pull request as ready for review April 5, 2024 05:58
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.23%. Comparing base (7cd969c) to head (0060fff).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   89.03%   89.23%   +0.19%     
==========================================
  Files          18       18              
  Lines        1660     1690      +30     
==========================================
+ Hits         1478     1508      +30     
  Misses        182      182              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albertomercurio
Copy link
Member

albertomercurio commented Apr 7, 2024

Why don't we include also the met2vec and vec2mat functionalities? I think this should be easy to implement, am I right? Aside from that, everything seems great.

@ytdHuang
Copy link
Member Author

ytdHuang commented Apr 7, 2024

Ahh, I was thinking cause the origin mat2vec and vec2mat only support standard matrices but not QuantumObject.

Maybe we can keep the origin methods, but also add new methods for just QuantumObject:

mat2vec(A::QuantumObject{<:AbstractArray{T},OperatorQuantumObject}) where {T} = QuantumObject(mat2vec(A.data), OperatorKetQuantumObject, A.dims)

vec2mat(A::QuantumObject{<:AbstractArray{T},OperatorKetQuantumObject}) where {T} = QuantumObject(vec2mat(A.data), OperatorQuantumObject, A.dims)

I will add this and also the corresponding runtests

@albertomercurio
Copy link
Member

Yes, that's what I had in mind.

@albertomercurio albertomercurio merged commit 999823f into main Apr 7, 2024
10 checks passed
@ytdHuang ytdHuang deleted the dev/superoperator branch April 9, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broader support for SuperOperator type
2 participants