-1

Surveying the QML module in Qiskit for a quantum neural network project and wondering if there is support to add noise models and run noisy simulations?

Going through this tutorial and wondering how one would define a noise model in the argument of qnn.forward when doing a batched forward pass.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

1 Answers1

1

You can create a noisy simulator like in the snippet below and then use it when you create a QuantumInstance:

    from qiskit.providers.aer import AerSimulator
    from qiskit.providers.aer.noise import NoiseModel
    from qiskit.test.mock import FakeVigo
    from qiskit.utils import QuantumInstance

    # We create a simulator with a noise model from this backend
    fake_backend = FakeVigo()
    noise_model = NoiseModel.from_backend(fake_backend)
    backend = AerSimulator(noise_model=noise_model)
    quantum_instance = QuantumInstance(backend=backend)
    # Then pass quantum_instance to a VQC instance or another algorithm.

You can take a look at the documentation of the noise package here: https://qiskit.org/documentation/apidoc/aer_noise.html or at the tutorial here: https://qiskit.org/documentation/tutorials/simulators/3_building_noise_models.html.