qojulia / QuantumInterface.jl

Lightweight interface for Quantum Physics related packages
MIT License
6 stars 5 forks source link

Handle single basis in embed #24

Open a-eghrari opened 3 months ago

a-eghrari commented 3 months ago

This commit addresses the issue where the embed function fails when it receives a single basis instead of a composite basis as input. This issue has been discussed in QuantumOpticsBase.jl's issues #159.

a-eghrari commented 3 months ago

This seems to create an ambiguity when we call, for example

embed(FockBasis(2) ⊕ FockBasis(2), 1, create(FockBasis(2)))

One way is to add type assserstion to the ops argument of the definition of embed(b::SumBasis, indices, ops) in file bases.jl