We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Good example is teleportation circuit:
QASM:
OPENQASM 2.0; include "qelib1.inc"; qreg q[3]; creg c0[1]; creg c1[1]; rx (pi/4) q[0]; h q[1]; cx q[1], q[2]; cx q[0], q[1]; h q[0]; measure q[1] -> c1[0]; if(c1==1) x q[2]; measure q[0] -> c0[0]; if(c0==1) z q[2];
When exported to Cirq, code currently looks like this:
import cirq import numpy as np q = [cirq.NamedQubit('q' + str(i)) for i in range(3)] circuit = cirq.Circuit.from_ops( cirq.Rx(np.pi / 4)(q[0]), cirq.H(q[1]), cirq.CNOT(q[1], q[2]), cirq.CNOT(q[0], q[1]), cirq.H(q[0]), cirq.measure(q[1], key='c10'), # Export to cirq WARNING: classical control not implemented yet. cirq.X(q[2]), cirq.measure(q[0], key='c00'), # Export to cirq WARNING: classical control not implemented yet. cirq.Z(q[2]) ) simulator = cirq.Simulator() result = simulator.run(circuit) print(result)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Good example is teleportation circuit:
QASM:
When exported to Cirq, code currently looks like this:
The text was updated successfully, but these errors were encountered: