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
import sympy
import cirq
from qualtran.cirq_interop import CirqGateAsBloq
from qualtran.resource_counting import QECGatesCost, get_cost_value
theta = sympy.Symbol("theta", real=True)
cirq_swappow = cirq.SwapPowGate(exponent=theta)
# Would be cool if it worked:
swappow_bloq = CirqGateAsBloq(cirq_swappow)
get_cost_value(swappow_bloq, QECGatesCost())
I would expect that get_cost_value would automatically use cirq.decompose to break the SwapPowGate into gates that can be ingested by Qualtran and costed out, but instead I get an error message:
ValueError: Cirq gate must be directly countable, not SWAP**theta.
When I run (with the appropriate imports of course)
I was trying to limit the use of cirq functionality in the resource counting code but was overzealous here. I agree the call graph and resource counting code should be in agreement
When I execute the code:
I would expect that get_cost_value would automatically use cirq.decompose to break the SwapPowGate into gates that can be ingested by Qualtran and costed out, but instead I get an error message:
ValueError: Cirq gate must be directly countable, not SWAP**theta
.When I run (with the appropriate imports of course)
I get the expected behaviour:
The text was updated successfully, but these errors were encountered: