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

A noisy instance of AerBackend doesn't distinguish between different two qubit gates #384

Open
CalMacCQ opened this issue Aug 30, 2024 · 0 comments

Comments

@CalMacCQ
Copy link
Contributor

CalMacCQ commented Aug 30, 2024

Found a potential problem with how AerBackend backend deals with different two qubit gates.

It seems if you pass a NoiseModel to AerBackend you can use any two qubit gate including {ZZPhase, CY, TK2, etc} that acts between the edges defined in the NoiseModel and get a BackendResult from the simulation.
I suppose all two qubit gates will have the same "edge error" regardless of the OpType? Would it make more sense to alter the GateSetPredicate to gates which actually work on IBM? Alternatively we could consider getting the user to define a native gateset if they pass a NoiseModel.

I find "compilation" to a backend which supports such a wide range of "native" gates to be a bit strange. It seems we have the realism of the noise model and architecture but can choose any one and two qubit gates we like for the circuit that runs.

Here's an example where I run a circuit on AerBackend with the Kyiv noise model and connectivity using a CY gate and a ZZPhase

from qiskit_aer.noise import NoiseModel
from pytket.extensions.qiskit import AerBackend, IBMQBackend
from pytket import Circuit, Qubit


# set up a noisy AerBackend
kyiv_backend = IBMQBackend("ibm_kyiv")
kyiv_noise_model = NoiseModel.from_backend(kyiv_backend._backend)
noisy_aer_backend = AerBackend(kyiv_noise_model)

# Build circuit
circ = Circuit(3).H(0).H(1).CY(0, 1).ZZPhase(0.25, 0, 1).measure_all()

# Relabel qubits to device nodes
qubit_rename_map = {Qubit("q", 0) : Qubit("node", 0),
                    Qubit("q", 1) : Qubit("node", 1),
                    Qubit("q", 2) : Qubit("node", 2)}

circ.rename_units(qubit_rename_map)

result = noisy_aer_backend.run_circuit(circ, n_shots=500)
print(result.get_counts()) 
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

No branches or pull requests

1 participant