-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Currently, expand(x::QNumber) (and also simplify) is implemented like this
function Symbolics.expand(x::QNumber; kwargs...)
expansion = average(x)
expansion_ = SymbolicUtils.expand(expansion; kwargs...)
return undo_average(expansion_)
end
This leads to problems if you apply it to expressions that contain QNumbers and Averages, e.g., for homodyne detection where one has terms like O*a + O*⟨a⟩. If such terms appear, you need to take the average before simplification.
In the future, we should try to get rid of the average - undo_average procedure.
using QuantumCumulants
using SymbolicUtils
h = FockSpace(:cavity)
a = Destroy(h, :a)
test = a + average(a) # a+⟨a⟩
expand(test) # 2*a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working