-
Notifications
You must be signed in to change notification settings - Fork 5
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
CNOT zero noise extrapolation #4
base: master
Are you sure you want to change the base?
CNOT zero noise extrapolation #4
Conversation
…CNOT-gates by repeating CNOTs
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.
Thank you, this i very good code. However, I think it would be great, if the functionality already developed in zero_noise_extrapolation.py could be used and not duplicated. Examples are the functionality for Richardson extrapolation, Pauli twirling, etc.
Consider moving the contents of this file into zero_noise_extrapolation.py.
Optional: It would be nice to have a notebook comparing CNOT error mitigation using this technique with the "random Pauli error" technique.
zero_noise_extrapolation_cnot.py
Outdated
""" | ||
|
||
if (amp_factor - 1) % 2 != 0: | ||
print("Invalid amplification factor:", amp_factor) |
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.
use raise Exception("....") instead
zero_noise_extrapolation_cnot.py
Outdated
factors 1, 3, 5, ..., 2n + 1, where 1 means the bare circuit without noise amplification, and 3 means every | ||
CNOT gate is extended as CNOT*CNOT*CNOT. | ||
|
||
As CNOT*CNOT = Id, the identity, in the noise-free case the amplified CNOT have the same action as a single CNOT, |
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.
this is self-contradictory
zero_noise_extrapolation_cnot.py
Outdated
# The 'Unroller' transpiler pass 'unrolls' (decomposes) the circuit gates to be expressed in terms of the | ||
# physical gate set [u1,u2,u3,cx] | ||
|
||
# This is still general for backends with possibly different native gate sets, as we can still express the |
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.
To me this is not obvious. One would probably always want to mitigate a gate type that is native on the device. It is OK to limit to IBM's devices (superconducting qubits). Maybe just remove the comment.
zero_noise_extrapolation_cnot.py
Outdated
|
||
def propagate(control_in: str, target_in: str): | ||
""" | ||
Propagates Pauli gates through a CNOT in accordance with the following circuit identities: |
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.
Are you trying to remove Pauli gates? If yes, I think this will not result in a twirl.
zero_noise_extrapolation_cnot.py
Outdated
self.backend = backend | ||
self.is_simulator = backend.configuration().simulator | ||
|
||
# Do an initial heavy optimization of the input circuit |
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.
This is optional, right? If we provide an empty pass_manager, nothing will be done.
…e 3-qubit SWAP-test circuit as an example.
60ea0c7
to
8d13c76
Compare
ZeroNoiseExtrapolation-class for mitigating CNOT-noise by multiplying CNOT-gates by factors 1,3,5,...,2n+1. Added an example notebook with the 3qubit SWAP-test circuit.