Noise models simulate the imperfections of real quantum hardware within a classical simulator. Real qubits have decoherence (information loss over time), gate errors, measurement errors, and crosstalk. Noise models let you study algorithm robustness before running on expensive hardware.
Qiskit's Aer simulator supports noise models: you define errors per gate and operation, then the simulator applies them probabilistically during circuit execution.
from qiskit_aer.noise import NoiseModel, depolarizing_error, amplitude_damping_error from qiskit_aer import AerSimulator # Create a noise model noise_model = NoiseModel() # Add errors noise_model.add_all_qubit_quantum_error( depolarizing_error(0.05, 1), # 5% error on single-qubit gates ['h', 'x', 'y', 'z', 'rx', 'ry', 'rz'] ) noise_model.add_all_qubit_quantum_error( depolarizing_error(0.1, 2), # 10% error on two-qubit gates ['cx', 'cz'] ) # Add measurement error noise_model.add_all_qubit_readout_error(0.02) # 2% mismeasurement # Simulate with noise sim = AerSimulator(noise_model=noise_model) result = sim.run(qc, shots=1000).result() print(result.get_counts())
Realistic models use measured calibration data from real hardware:
from qiskit_ibm_runtime.fake_provider import FakeBogota # Fake backend with realistic noise backend = FakeBogota() noise_model = NoiseModel.from_backend(backend) sim = AerSimulator(noise_model=noise_model) result = sim.run(qc, shots=1000).result()
Simulating with noise helps you design algorithms that are robust to hardware imperfections, a key challenge on current (NISQ) devices.