deltakit.explorer.Client.add_noise#
- Client.add_noise(stim_circuit: str | Circuit, noise_model: PhysicalNoiseModel | SI1000NoiseModel | SI1000Noise) str#
Given a stim circuit, changes all noise in the circuit to noise defined by user-given parameters. If the circuit is noiseless, noise is added into the circuit.
- Parameters:
stim_circuit – (str | stim.Circuit): Noiseless circuit.
noise_model (PhysicalNoiseModel | SI1000NoiseModel | SI1000Noise) – Noise model to apply to a circuit.
- Returns:
STIM circuit with error mechanisms derived from the noise model. Note, that adding SI1000NoiseModel may add leakage terms, which are not compatible with vanilla STIM, and can only be simulated using Deltakit client.
- Return type:
str
Examples
Populate the circuit with the noise, and then simulate:
leakage_noise_model = types.SI1000NoiseModel(p=0.001, p_l=0.001) noisy_circuit = client.add_noise( stim_circuit=compiled_circuit, noise_model=leakage_noise_model, ) measurements, leakage = client.simulate_stim_circuit( stim_circuit=noisy_circuit, shots=num_shots, )