PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.18k stars 569 forks source link

Pre-built noise models #4170

Open kshyatt-aws opened 1 year ago

kshyatt-aws commented 1 year ago

Feature details

Would be great to provide some prepackaged noise models and tools for easily building custom models that could be applied to a circuit or quantum tape, similar to what Qiskit has in Qiskit Terra and Braket with NoiseModel. One could then apply the noise model to an entire tape so that (e.g.) every CNot gets the appropriate noise applied automatically.

Implementation

Some kind of transform on top of an existing tape might work, something like:

noisy_circ = qml.apply_noise(my_circ, noise_model)

or as an optional argument to qnode:

@qml.qnode(dev, diff_method=diff_method, noise_model=noise_model)

Then, during tape processing, the noise model can be automatically applied to the circuit gates (semi-similar to measurement transforms like shadows).

How important would you say this feature is?

1: Not important. Would be nice to have.

Additional information

Would be great to implement this in a way that makes it easy to translate back and forth to other providers like Qiskit or Braket -- having some member of Circuit or QuantumTape that can be probed for the noise model separately from the circuit gates would be very helpful.

trbromley commented 1 year ago

Thanks @kshyatt-aws, this is a great suggestion! For now, users looking to include basic noise in their circuit can use the qml.insert transform with the default.mixed device.