# Noise Models¶

## Functions¶

 append_kraus_to_gate(kraus_ops, gate_matrix) Follow a gate gate_matrix by a Kraus map described by kraus_ops. pauli_kraus_map(probabilities) Generate the Kraus operators corresponding to a pauli channel. damping_kraus_map([p]) Generate the Kraus operators corresponding to an amplitude damping noise channel. dephasing_kraus_map([p]) Generate the Kraus operators corresponding to a dephasing channel. tensor_kraus_maps(k1, k2) Generate the Kraus map corresponding to the composition of two maps on different qubits. combine_kraus_maps(k1, k2) Generate the Kraus map corresponding to the composition of two maps on the same qubits with k1 being applied to the state after k2. damping_after_dephasing(T1, T2, gate_time) Generate the Kraus map corresponding to the composition of a dephasing channel followed by an amplitude damping channel. get_noisy_gate(gate_name, params) Look up the numerical gate representation and a proposed ‘noisy’ name. _decoherence_noise_model(gates[, T1, T2, …]) The default noise parameters decoherence_noise_with_asymmetric_ro(gates) Similar to _decoherence_noise_model(), but with asymmetric readout. apply_noise_model(prog, noise_model) Apply a noise model to a program and generated a ‘noisy-fied’ version of the program. add_decoherence_noise(prog[, T1, T2, …]) Add generic damping and dephasing noise to a program. estimate_bitstring_probs(results) Given an array of single shot results estimate the probability distribution over all bitstrings. corrupt_bitstring_probs(p, …) Given a 2d array of true bitstring probabilities (outer axis iterates over shots, inner axis over bits) and a list of assignment probability matrices (one for each bit in the readout, ordered like the inner axis of results) compute the corrupted probabilities. bitstring_probs_to_z_moments(p) Convert between bitstring probabilities and joint Z moment expectations. estimate_assignment_probs(q, trials, cxn[, p0]) Estimate the readout assignment probabilities for a given qubit q.

## Classes¶

class pyquil.noise.NoiseModel[source]

Encapsulate the QPU noise model containing information about the noisy gates.

Variables: gates (Sequence[KrausModel]) – The tomographic estimates of all gates. assignment_probs (Dict[int,np.array]) – The single qubit readout assignment probability matrices keyed by qubit id.

Create new instance of _NoiseModel(gates, assignment_probs)

Methods

 gates_by_name(name) Return all defined noisy gates of a particular gate name. to_dict() Create a JSON serializable representation of the noise model. from_dict(d) Re-create the noise model from a dictionary representation.
class pyquil.noise.KrausModel[source]

Encapsulate a single gate’s noise model.

Variables: gate (str) – The name of the gate. params (Sequence[float]) – Optional parameters for the gate. targets (Sequence[int]) – The target qubit ids. kraus_ops (Sequence[np.array]) – The Kraus operators (must be square complex numpy arrays). fidelity (float) – The average gate fidelity associated with the Kraus map relative to the ideal operation.

Create new instance of _KrausModel(gate, params, targets, kraus_ops, fidelity)

Methods

 unpack_kraus_matrix(m) Helper to optionally unpack a JSON compatible representation of a complex Kraus matrix. unpack_kraus_matrix(m) Helper to optionally unpack a JSON compatible representation of a complex Kraus matrix. to_dict() Create a dictionary representation of a KrausModel. from_dict(d) Recreate a KrausModel from the dictionary representation.