Created
May 17, 2019 15:13
-
-
Save nathanshammah/6ad41ed5c88aec5f37e10eff16866d37 to your computer and use it in GitHub Desktop.
qcircuit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qutip import * | |
q = QubitCircuit(3, reverse_states=False) | |
q.add_gate("TOFFOLI", controls=[0, 2], targets=[1]) | |
q.add_gate("CNOT", targets=[1], controls=[0]) | |
display("q",q.png) | |
q.add_gate("TOFFOLI", controls=[0, 2], targets=[1]) | |
display("q updated",q.png) | |
q2 = QubitCircuit(3, reverse_states=False) | |
q2.add_gate("TOFFOLI", controls=[0, 2], targets=[1]) | |
q2.add_gate("TOFFOLI", controls=[0, 2], targets=[1]) | |
display("q2",q2.png) | |
q2.add_gate("CNOT", targets=[1], controls=[0], index=[1]) | |
display("q2 updated",q2.png) | |
U = gate_sequence_product(q.propagators()) | |
U2 = gate_sequence_product(q2.propagators()) | |
U==U2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment