You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an error I don't understand when trying to print a TComplexity with symbolic parameters. Here is a minimal example:
from sympy import Symbol
import cirq
from qualtran.bloqs.mcmt import MultiControlPauli
from qualtran.symbolics import HasLength
from qualtran.cirq_interop.t_complexity_protocol import t_complexity
ccpauli_symb = MultiControlPauli(cvs=HasLength(Symbol("k", integer=True, positive=True)), target_gate=cirq.X)
print(t_complexity(ccpauli_symb))
Running this code produces the following error message:
Yeah, that's because of the ":g" in the __str__ implementation, which assumes the fields to be floats / ints. Printing individual fields as sympy expressions should work fine -- print(t_complexity(ccpauli_symb).t)
This issue should be fixed though. I've also run into this in the past. Thanks for opening an issue!
I get an error I don't understand when trying to print a TComplexity with symbolic parameters. Here is a minimal example:
Running this code produces the following error message:
The text was updated successfully, but these errors were encountered: