-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add 2q fractional gates to the ConsolidateBlocks
transpiler pass
#13884
base: main
Are you sure you want to change the base?
Conversation
One or more of the following people are relevant to this code:
|
The only test currently failing is:
This test was added in #13450 to handle issue #13438, and I wonder if we should remove it. @mtreinish @ElePT - what's your opinion? the original circuit is:
the circuit after basis translation is:
The circuit after optimization_level 2 or 3 transpilation is:
The reason that this circuit is being consolidated is that it originally contains CZ gates. If it had contained only RZZ gates, then it would not had been consolidated. I think that it would be better handled in #13419 (which should take into account the 1-qubit gates). |
consolidate_pass = ConsolidateBlocks(basis_gates=["rzz", "rx", "rz"]) | ||
res = consolidate_pass(qc) | ||
self.assertEqual({"unitary": 1}, res.count_ops()) | ||
self.assertEqual(Operator.from_circuit(qc), Operator(res.data[0].operation.params[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that due to the TwoQubitControlledUDecomposer
synthesis algorithm, the synthesized circuit is:
q_0: ──────────■──────────────────
┌───────┐ │ZZ(-0.3) ┌───────┐
q_1: ┤ Rx(π) ├─■─────────┤ Rx(π) ├
└───────┘ └───────┘
and not just RZZGate(0.3)
ConsolidateBlocks
transpiler passConsolidateBlocks
transpiler pass
Summary
With the introduction of new 2q-fractional gates, such as
RZZGate
as part of the QPU, we add them to theConsolidateBlocks
transpiler pass.https://www.ibm.com/quantum/blog/fractional-gates
This PR should close #13428
Details and comments
Note that this PR may be eventually superseded by #13419