Questions about noise simulation

I tried using the noise model from qiskit in pennylane. But I have some questions about the simulation. My code is as follows.

import pennylane as qml
from pennylane import numpy as np
from qiskit_aer.noise import NoiseModel
from qiskit.providers.fake_provider import *

backend = FakeCambridgeV2()
noise_model = NoiseModel.from_backend(backend)
dev = qml.device("qiskit.aer", wires=5, noise_model=noise_model)
def noise_circuit():
    qml.CNOT(wires=[0, 1])
    qml.CNOT(wires=[2, 1])
    qml.CNOT(wires=[3, 1])
    qml.CNOT(wires=[4, 1])
    qml.CNOT(wires=[4, 2])
    return qml.expval(qml.Z(0)), qml.expval(qml.Z(1))   

My questions are as follows:

  1. Since quantum computers have different topology (at least superconducting quantum computers). It means that qubits are not fully connected. So I think I should transpile this circuit and insert some swap gates. But I didn’t do anything. Is the noise simulation just inserting error channels after quantum gates, such as phaseflip?
  2. I checked the phaseflip. It seems that the answer of question 1 is yes. Since the noise is different for different qubit pairs. How to quantize qubit pairs that are not physically connected?

I haven’t delved into Pennylane’s source code. So please correct me if I’m wrong.

Hi @cheng ,

It looks like the noise model is being handled on Qiskit’s side so I’m not sure how they do it.

Regarding transpilation you can set it with the set_transpile_args method. There you can set the keyword arguments in the Qiskit transpiler documentation.

I’ll check to see if we have more info on processing external noise models but in case I can’t find it I hope this helps!

Hi @CatalinaAlbornoz ,

Thanks for your reply. I will check the transpilation part. :+1:

Let me know if you encounter any issues @cheng !

Hi @cheng ,

I want to mention that we’ll be adding PennyLane noise models in the upcoming 0.37 release at the start of July.

These noise models will allow you to control the recipe for when to insert noisy channels after target operations. You can check out the (Work In Progress) example here .

Hi @CatalinaAlbornoz

Thanks for the mention. That is great news. I will check it. Hope PennyLane gets better. :+1:

That’s the goal! :smile: Let us know if you have any feedback or suggestions!