Closed jiannanWang closed 7 months ago
cirq csynque suggestion - print out the qasm_str
is the original circuit decomposed to simpler gate, is that decomposition accurate?
The phase vectors seem similar on printout except of some round-off errors. are there tolerances in the cirq.equal_up_to_global_phase function?
either specifiying more digits in precision for the simulator new_simulater = cirq.Simulator(dtype=np.complex128)
or increasing the tolerance of cirq.equal_up_to_global_phase
(print(cirq.equal_up_to_global_phase(st, new_st, atol=1e-7))
) . The exact round of error between st
and new_st
is ~1.8e-8
which is slightlty above the default atol=1e-8
of equal_up_to_global_phase
works as intended, round-off issue. We should still check if qasm has a more accurate representation for CSwapGate.
Description of the issue
For a circuit consisting of only a
CSwapGate.controlled(1)
gate, the result changed after converting to QASM and converting back.How to reproduce the issue
Executing the above code results in
False
, meaning the result state vector changed after QASM round trip conversion.Cirq version
1.3.0