-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
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
New commutation passes #1500
New commutation passes #1500
Conversation
6726c13
to
00d936f
Compare
is nice that we show the dag before and after but can we also show the circuit. It would also be nice to have the circuit in the example |
For that, I think a DAG_to_circuit() method is needed. Right now, we have functions to convert DAG to openQASM and convert openQASM to QuantumCircuit, but the two functions don't work together. |
you can use
but i don't think drawing the circuit shows much. this pass modifies DAG edges, to make them more amenable to scheduling, optimization, etc. The circuit drawer may just move some boxes around. |
36545a2
to
ef58e5f
Compare
d56242e
to
e5fdc54
Compare
* Passes implemented and test cases added * example added * add support to u1,u2,u3, and rz,rx,ry * fix support for 1 qubit gates * fix test cases * update example * update code to master, some linting * changelog * test is just testing analysis, rename and clean * add license to files * more linting fixes * fix commutation detecction issue with 2 cnots s on same 2 wires * fixed a bug that misidentify the commutation relations between two alternating CNOTs * Linting and fixing test * final lint style
Summary
Details and comments
The commutation analysis pass figures out the commutation relations for gates in DAGCircuit, all the 1&2 qubit gates are supported now.
Here are some examples:
1. Test all the gates
Circuit:
DAG before:
DAG after:
2. An example of Quantum Instantaneous Polynomial Time(all gates commute)
Circuit:
DAG_before:
DAG_after:
3. Circuits produced by Jordan-Wigner transformation
Circuit:
DAG before:
DAG after: