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

RelaxationNoisePass creates noisy circuits that cannot be run directly on simulator for circuits with multi-qubit gates #1447

Closed
itoko opened this issue Feb 4, 2022 · 1 comment · Fixed by #1455
Labels
bug Something isn't working

Comments

@itoko
Copy link
Contributor

itoko commented Feb 4, 2022

Informations

  • Qiskit Aer version:
  • Python version:
  • Operating system:

What is the current behavior?

RelaxationNoisePass produces noisy circuits that cannot be run directly on Aer simulator when circuits with multi-qubit gates are supplied. Because the output circuit contains composite instructions labeled like "circuit-123". So before running the circuit on simulator, users must transpile the circuit to decompose the composite instructions.

Steps to reproduce the problem

from qiskit.providers.aer import AerSimulator
from qiskit.providers.aer.noise.passes import RelaxationNoisePass

from qiskit import transpile
from qiskit.circuit import Delay, QuantumCircuit
from qiskit.circuit.library.standard_gates import SXGate, CXGate

circ = QuantumCircuit(2)
circ.h(0)
circ.cx(0, 1)
circ.measure_all()
circ = transpile(circ,
                 basis_gates=["rz", "sx", "cx"],
                 scheduling_method="alap",
                 instruction_durations=[
                     ("rz", None, 0),
                     ("sx", None, 160),
                     ("cx", None, 800),
                     ("measure", None, 20000)
                 ])
t1s = t2s = [1e-4, 2e-4]
noise_pass = RelaxationNoisePass(t1s=t1s, t2s=t2s, dt=1e-9, op_types=[Delay, SXGate, CXGate])
noisy_circ = noise_pass(circ)
job = AerSimulator().run(noisy_circ)  # error

We can avoid the above error by transpiling the circuit (decomposing "circuit instructions") before running on the simulator.

noisy_circ = transpile(noisy_circ, basis_gates=["rz", "sx", "cx", "quantum_channel", "delay"])

However, it feels a little awkward.

What is the expected behavior?

Circuits created byRelaxationNoisePass should be able to be run directly on Aer simulator.

Suggested solutions

  • RelaxationNoisePass produces circuits that do not contains composite instructions.
    (or AerSimulator becomes to be able to run circuits with composite instructions.)
@itoko itoko added the bug Something isn't working label Feb 4, 2022
@chriseclectic
Copy link
Member

chriseclectic commented Feb 7, 2022

We should fix the relaxation noise pass so that it doesn't append composite gates for multi-qubit relaxation errors, but the actual single qubit quantum errors. Though im not sure if there is any easy way to do this via the DAG as the pass is currently implemented...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants