Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndersHR
Copy link

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.

@AndersHR AndersHR changed the title Cnot zero noise extrapolation CNOT zero noise extrapolation Oct 23, 2020
Copy link
Member

@fgfuchs fgfuchs left a 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.

"""

if (amp_factor - 1) % 2 != 0:
print("Invalid amplification factor:", amp_factor)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use raise Exception("....") instead

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is self-contradictory

# 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
Copy link
Member

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.


def propagate(control_in: str, target_in: str):
"""
Propagates Pauli gates through a CNOT in accordance with the following circuit identities:
Copy link
Member

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.

self.backend = backend
self.is_simulator = backend.configuration().simulator

# Do an initial heavy optimization of the input circuit
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants