I want to simulate a quantum circuit using Cirq, with a noise model that defines a certain error rate $e_1$ for single-qubit gates and a certain error rate $e_2$ for 2-qubit gates.
So I know it's possible to create noisy operations using the noisy_operation
method of a NoiseModel
object:
qubits = cirq.LineQubit.range(2)
nm_1 = cirq.NoiseModel.from_noise_model_like(cirq.depolarize(e1))))
noisy_X = nm_1.noisy_operation(cirq.X(qubits[0]))
But assume I have already a circuit object with many gates - I want to simulate it with the noise model I have described above. I was thinking of using the with_noise
method of a Circuit
object, but that adds a strict layer of noise after each Moment
, and I couldn't find a way to differentiate between gates:
CIRCUIT.with_noise(nm_1)
To conclude, I am looking for a method in Cirq to easily simulate quantum circuits with basic yet flexible noise models.
Thanks.