-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add IGate rules to standard equivalence library #7146
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
Changes from all commits
8ead825
bd4f71a
d79caab
c1bc5f8
8c7b0c9
c7fa3ec
102ab00
029e284
e9628de
955eb02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -928,22 +928,19 @@ def test_cx_bell_to_ecr(self): | |
| in_dag = circuit_to_dag(bell) | ||
| out_dag = BasisTranslator(std_eqlib, ["ecr", "u"]).run(in_dag) | ||
|
|
||
| # ┌────────────┐ ┌─────────────┐┌──────┐┌──────────┐ | ||
| # q_0: ───┤ U(π/2,0,π) ├───┤ U(0,0,-π/2) ├┤0 ├┤ U(π,0,π) ├ | ||
| # ┌──┴────────────┴──┐└─────────────┘│ Ecr │└──────────┘ | ||
| # q_1: ┤ U(-π/2,-π/2,π/2) ├───────────────┤1 ├──────────── | ||
| # └──────────────────┘ └──────┘ | ||
|
|
||
| qr = QuantumRegister(2, "q") | ||
| expected = QuantumCircuit(2) | ||
| expected.u(pi / 2, 0, pi, qr[0]) | ||
| expected.u(0, 0, -pi / 2, qr[0]) | ||
| expected.u(-pi / 2, -pi / 2, pi / 2, qr[1]) | ||
| expected.u(pi, 0, 0, qr[0]) | ||
| expected.u(pi / 2, -pi / 2, pi / 2, qr[1]) | ||
| expected.ecr(0, 1) | ||
| expected.u(pi, 0, pi, qr[0]) | ||
| expected_dag = circuit_to_dag(expected) | ||
|
Comment on lines
932
to
938
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My question from the prior review! It got lost before - I must have forgotten to save the comment. Do we know why this changes? We haven't added any rules that go to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, I'm not sure. I didn't really think to check. I just saw the output circuit was equivalent and updated the test. I'll do some debugging locally because the qpy tests are failing in a weird way now too so this is blocked on that anyway. |
||
|
|
||
| self.assertEqual(out_dag, expected_dag) | ||
| self.assertEqual( | ||
| Operator.from_circuit(bell), Operator.from_circuit(dag_to_circuit(out_dag)) | ||
| ) | ||
|
|
||
| def test_cx_bell_to_cp(self): | ||
| """Verify we can translate a CX bell to CP,U.""" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.