Closed oameye closed 2 months ago
Thanks for the report! The fact that the metadata
is missing here is definitely an oversight on our end. However, that's not the whole story. I wouldn't expect expand
to work properly on QNumber
types right now. What we also need is an overload to expand
similar to what we are doing with simplify
so Symbolics
can work on numbers. Something like this:
function Symbolics.expand(q::QTerm)
q |> average |> expand |> undo_average
end
The package defines a function to extract the metadata of the
QAdd
type butQAdd
does not have ametadata
field.https://github.com/qojulia/QuantumCumulants.jl/blob/1d144b1811596057a4bd57eee601669db61cc8ac/src/qnumber.jl#L232
The function is used when you try to use
Symbolics.expand
on aQAdd
expression: