Simulating Noisy Circuits in Cirq
Overview
Simulating Noisy Circuits in Cirq
Real quantum hardware is noisy, so being able to model and simulate the effects of noise is essential for predicting how an algorithm will actually perform and for developing error-mitigation and error-correction techniques. This Cirq tutorial demonstrates how to add noise to a circuit and simulate the resulting mixed-state dynamics using the ConstantQubitNoiseModel, which applies the same single-qubit noise channel (such as depolarizing or bit-flip noise) uniformly after every operation in the circuit. The example shows the full workflow: building an ideal circuit, wrapping it with a noise model so that each gate is followed by the chosen error channel, and running it on a density-matrix simulator that tracks the full mixed state rather than a pure state vector. It then reads back the noisy measurement statistics, letting you compare the degraded results against the ideal, noiseless outcome and see how quickly errors accumulate with circuit depth. It is a practical, beginner-friendly introduction to noise modeling in Cirq, the foundation for studying realistic device behavior, benchmarking error rates, and prototyping the error-mitigation strategies that near-term quantum computing depends on.
Run it
pip install -r requirements.txt
python noisy_simulation_example.py
Source and license
Imported from examples/noisy_simulation_example.py in quantumlib/Cirq at v1.6.1, under the Apache License 2.0. Original authors: The Cirq Developers. The upstream LICENSE is included alongside this example.
This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.
Versions
Cite all versions? Use the base QCR ID to always reference the latest version of this entry.
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!