Quantum channels and noise models

Kraus channel

class graphix.channels.KrausChannel(kraus_data: Iterable[KrausData])[source]

Quantum channel class in the Kraus representation.

Defined by Kraus operators \(K_i\) with scalar prefactors coef) \(c_i\), where the channel act on density matrix as \(\rho' = \sum_i K_i^\dagger \rho K_i\). The data should satisfy \(\sum K_i^\dagger K_i = I\).

__init__(kraus_data: Iterable[KrausData]) None[source]

Initialize KrausChannel given a Kraus operator.

Parameters:

kraus_data (Iterable[KrausData]) – Iterable of Kraus operator data.

Raises:

ValueError – If kraus_data is empty.

property nqubit: int

Return the number of qubits.

graphix.channels.dephasing_channel(prob: float) KrausChannel[source]

Single-qubit dephasing channel, \((1-p) \rho + p Z \rho Z\).

Parameters:

prob (float) – The probability associated to the channel

Returns:

containing the corresponding Kraus operators

Return type:

graphix.channels.KrausChannel object

graphix.channels.depolarising_channel(prob: float) KrausChannel[source]

Single-qubit depolarizing channel.

\[(1-p) \rho + \frac{p}{3} (X \rho X + Y \rho Y + Z \rho Z) = (1 - 4 \frac{p}{3}) \rho + 4 \frac{p}{3} id\]
Parameters:

prob (float) – The probability associated to the channel

graphix.channels.pauli_channel(px: float, py: float, pz: float) KrausChannel[source]

Single-qubit Pauli channel.

\[(1-p_X-p_Y-p_Z) \rho + p_X X \rho X + p_Y Y \rho Y + p_Z Z \rho Z)\]
graphix.channels.two_qubit_depolarising_channel(prob: float) KrausChannel[source]

Two-qubit depolarising channel.

\[\mathcal{E} (\rho) = (1-p) \rho + \frac{p}{15} \sum_{P_i \in \{id, X, Y ,Z\}^{\otimes 2}/(id \otimes id)}P_i \rho P_i\]
Parameters:

prob (float) – The probability associated to the channel

Returns:

containing the corresponding Kraus operators

Return type:

graphix.channels.KrausChannel object

graphix.channels.two_qubit_depolarising_tensor_channel(prob: float) KrausChannel[source]

Two-qubit tensor channel of single-qubit depolarising channels with same probability.

Kraus operators:

\[\Big\{ \sqrt{(1-p)} id, \sqrt{(p/3)} X, \sqrt{(p/3)} Y , \sqrt{(p/3)} Z \Big\} \otimes \Big\{ \sqrt{(1-p)} id, \sqrt{(p/3)} X, \sqrt{(p/3)} Y , \sqrt{(p/3)} Z \Big\}\]
Parameters:

prob (float) – The probability associated to the channel

Returns:

containing the corresponding Kraus operators

Return type:

graphix.channels.KrausChannel object

Noise model classes

class graphix.noise_models.noise_model.NoiseModel[source]

Base class for all noise models.

assign_simulator(simulator: PatternSimulator) None[source]

Assign the running simulator.

Parameters:

simulator (PatternSimulator) – Simulator instance that will use this noise model.

abstractmethod byproduct_x() KrausChannel[source]

Return the channel for X by-product corrections.

Returns:

Channel applied after an X correction.

Return type:

KrausChannel

abstractmethod byproduct_z() KrausChannel[source]

Return the channel for Z by-product corrections.

Returns:

Channel applied after a Z correction.

Return type:

KrausChannel

abstractmethod clifford() KrausChannel[source]

Return the channel for Clifford gates.

Returns:

Channel modeling the noise of Clifford operations.

Return type:

KrausChannel

abstractmethod confuse_result(result: Outcome) Outcome[source]

Return a possibly flipped measurement outcome.

Parameters:

result (Outcome) – Ideal measurement result.

Returns:

Possibly corrupted result.

Return type:

Outcome

abstractmethod entangle() KrausChannel[source]

Return the channel applied after entanglement.

Returns:

Channel modeling noise during the CZ gate.

Return type:

KrausChannel

abstractmethod measure() KrausChannel[source]

Return the measurement channel.

Returns:

Channel applied immediately before measurement.

Return type:

KrausChannel

abstractmethod prepare_qubit() KrausChannel[source]

Return the preparation channel.

Returns:

Channel applied after single-qubit preparation.

Return type:

KrausChannel

abstractmethod tick_clock() None[source]

Advance the simulator clock.

This accounts for idle errors such as \(T_1\) and \(T_2\). All commands between consecutive T instructions are considered simultaneous.

class graphix.noise_models.noiseless_noise_model.NoiselessNoiseModel[source]

Noise model that performs no operation.

byproduct_x() KrausChannel[source]

Return the identity channel for X corrections.

Returns:

Identity channel \(I_2\).

Return type:

KrausChannel

byproduct_z() KrausChannel[source]

Return the identity channel for Z corrections.

Returns:

Identity channel \(I_2\).

Return type:

KrausChannel

clifford() KrausChannel[source]

Return the identity channel for Clifford gates.

Returns:

Identity channel \(I_2\).

Return type:

KrausChannel

confuse_result(result: Outcome) Outcome[source]

Return the unmodified measurement result.

Parameters:

result (bool) – Ideal measurement outcome.

Returns:

Same as result.

Return type:

bool

entangle() KrausChannel[source]

Return the identity channel for entangling operations.

Returns:

Identity channel \(I_4\).

Return type:

KrausChannel

measure() KrausChannel[source]

Return the identity channel for measurements.

Returns:

Identity channel \(I_2\).

Return type:

KrausChannel

prepare_qubit() KrausChannel[source]

Return the identity preparation channel.

Returns:

Identity channel \(I_2\).

Return type:

KrausChannel

tick_clock() None[source]

Advance the simulator clock without applying errors.

Notes

This method is present for API compatibility and does not modify the internal state. See tick_clock().