E.g.:
|
basis(a::StateVector) = a.basis |
|
basis(a::AbstractOperator) = (check_samebases(a); a.basis_l) |
Long term, a better design would be to move these to QuantumOpticsBase where they will act on concrete (not abstract) types (this is where they came from). Methods acting on abstract types should use only public APIs, not assumptions about internal layout, because the internal layout might be different in other libraries extending this functionality. E.g. QuantumClifford.PauliChannel superoperators do not have basis_l slots, unlike QuantumOptics superoperators.
E.g.:
QuantumInterface.jl/src/julia_base.jl
Line 15 in d8973a7
QuantumInterface.jl/src/julia_base.jl
Line 34 in d8973a7
Long term, a better design would be to move these to QuantumOpticsBase where they will act on concrete (not abstract) types (this is where they came from). Methods acting on abstract types should use only public APIs, not assumptions about internal layout, because the internal layout might be different in other libraries extending this functionality. E.g. QuantumClifford.PauliChannel superoperators do not have
basis_lslots, unlike QuantumOptics superoperators.