qcmet.devices.NoisySimulator#
- class qcmet.devices.NoisySimulator(num_qubits=5, overrotation_amount=0.031415926535897934, detuning_amount=0.02617993877991494, error_1q=0.005, error_2q=0.05, t1=50000.0, t2=70000.0, **kwargs)[source]#
Noisy AerSimulator using custom noise model.
- __init__(num_qubits=5, overrotation_amount=0.031415926535897934, detuning_amount=0.02617993877991494, error_1q=0.005, error_2q=0.05, t1=50000.0, t2=70000.0, **kwargs)[source]#
Initialize a noisy Aer-based simulator with a configurable noise model.
This constructor sets up a Qiskit Aer simulator that emulates realistic device imperfections. The noise model includes coherent over-rotation and detuning on single-qubit gates, depolarizing channels for single- and two-qubit gates, and optional thermal relaxation (T1/T2). The constructed NoiseModel and its basis gates are passed to the base AerSimulator.
- Parameters:
num_qubits (int) – Number of qubits used for assigning per-qubit thermal relaxation channels and for metadata. Default: 5.
overrotation_amount (float) – X-axis over-rotation applied after each single-qubit
sx(π/2) gate, in radians. Default: π/100.detuning_amount (float) – Z rotation applied after each single-qubit
sxgate to model detuning-induced phase error, in radians. Default: π/120.error_1q (float) – Single-qubit depolarizing probability applied to
sxgates. Must be in [0, 1]. Default: 0.005.error_2q (float) – Two-qubit depolarizing probability applied to
cxgates. Must be in [0, 1]. Default: 0.05.t1 (float | None) – Energy relaxation time T1 in nanoseconds. If
Noneor 0, thermal relaxation is disabled. Default: 50e3 (50 μs).t2 (float | None) – Dephasing time T2 in nanoseconds. If provided larger than
2*T1, it is clipped to satisfy the physical constraintT2 ≤ 2*T1. IfNoneor 0, thermal relaxation is disabled. Default: 70e3 (70 μs).**kwargs – Additional keyword arguments passed through to the AerSimulator constructor.
- Behavior:
- Builds a NoiseModel with:
coherent errors after
sxgates (X over-rotation and Z detuning),depolarizing noise on
sx(1-qubit) andcx(2-qubit) gates,optional T1/T2 thermal relaxation channels on
id,sx, andcx.
Clips
t2to2*t1if larger, to maintain physical consistency.Passes the noise model and its basis gates to the base
AerSimulator.Stores
num_qubitsinself.properties['num_qubits'].
Example
Create a 7-qubit noisy simulator with custom depolarizing strengths:
>>> sim = NoisySimulator(num_qubits=7, error_1q=5e-3, error_2q=5e-2)
Methods
__init__([num_qubits, overrotation_amount, ...])Initialize a noisy Aer-based simulator with a configurable noise model.
get_properties()Return device metadata including noise model.
Define custom noise model.
reverse_bitstrings(counts_dict)Reverse bitstrings in a measurement count dictionary.
run(circuits[, num_shots, max_circs_per_job])Execute one or more quantum circuits on the device.
- noise_model()[source]#
Define custom noise model.
T1 and T2 times are selected from a random normal distribution with a mean of 50μs and 70μs respectively, and a standard deviation of 1μs for both. To ensure repeatability, a random seed is set such that the T1 times selected for each qubit remain the same.
In order to apply amplitude and phase damping noise when executing a circuit, the gate times must also be known. The following gate times are used: time for idle gate (I) is 50ns, time for Rx(π/2) gate is 50ns, for CX gate is 300ns, and time for measurement is 1000ns. There is no noise applied on the Rz(theta) as it is modelled to be a virtual gate that is applied by adding a phase to the following gates.
For all of the Rx(π/2) gates applied, after the ideal Rx(π/2) gate the following noise contributions are added: - an over-rotation around the x-axis of π/100 to simulate coherent
calibration errors,
- a rotation about the z-axis of π/120 to simulate the coherent phase error
occurring due to the applied pulse being detuned from the qubit frequency
- a depolarizing noise channel to approximate effectively averaged noise in
a large quantum circuit. The depolarizing parameter used for this gate is gamma_D = 0.0005.
For all of the 2-qubit CX gates applied, after the ideal CX gate the following noise contributions are added: - an exp^(-i*ZX*theta_zx/2) operation and an exp^(-i*ZZ*theta_zz/2) operation
on the 2-qubit subspace the CX gate acts on.
- The parameters theta_zx and theta_zz are both set to pi/100. The zx- and zz-
rotation axes are chosen to reproduce some of the dominant sources of coherent error when applying a cross-resonance gate in superconducting qubits
- a depolarizing noise channel, with depolarizing parameter gamma_D = 0.005.
It is larger the value used for single qubit gates, as two-qubit gates typically have larger average errors.
- Returns:
custom noise_model
- Return type:
NoiseModel