Closed gtlandi closed 2 years ago
Hi @gtlandi ,
Thank you for the issue.
The function CompositeBasis()
should not get a vector as argument.
If you write B = CompositeBasis(b,b)
instead it works.
@david-pl should I change
CompositeBasis(bases) = CompositeBasis([length(b) for b ∈ bases], bases)
in
https://github.com/qojulia/QuantumOpticsBase.jl/blob/f3c23a275f9ec5c92616834ab578507459239919/src/bases.jl#L64
to
CompositeBasis(bases::Tuple) = CompositeBasis([length(b) for b ∈ bases], bases)
,
to get a MethodError
for vectors?
Oh. I see. Thank you for the feedback!
@ChristophHotter CompositeBasis(bases::Vector) = CompositeBasis((bases...,))
should do the trick.
Hi. There seem to be an issue with the way that embed defines the composite basis. Consider the following example:
b = SpinBasis(1//2);
op1 = tensor(one(b), sigmaz(b))
B = CompositeBasis([b,b])
op2 = embed(B, 2, sigmaz(b))
When I try to multiply
op1*op2
, it raises a "IncompatibleBases()" error. From what I could gather, somehow thetypeof(op.basis_l)
are different in the two cases.