graphix.channels module

Quantum channels and noise models.

class KrausData(coef: complex, operator: NDArray[_T])[source]

Bases: object

Kraus operator data.

coef

Scalar prefactor of the operator.

Type:

complex

operator

Operator.

Type:

npt.NDArray[np.complex128]

__init__(coef: complex, operator: NDArray[_T]) → None[source]
property coef: complex

Return the scalar prefactor.

property operator: NDArray[complex128]

Return the operator.

property nqubit: int

Validate the data.

class KrausChannel(kraus_data: Iterable[KrausData])[source]

Bases: object

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.

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

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

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)\]
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

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

amplitude_damping_channel(prob: float) → KrausChannel[source]

Single-qubit amplitude damping channel.

\[\begin{split}K_1 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1-\gamma} \end{pmatrix}, \quad K_2 = \begin{pmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{pmatrix}\end{split}\]
Parameters:

prob (float) – The damping parameter \(\gamma\) associated to the channel.

Returns:

containing the corresponding Kraus operators

Return type:

graphix.channels.KrausChannel object

two_qubit_amplitude_damping_channel(prob: float) → KrausChannel[source]

Two-qubit amplitude damping channel.

Tensor product of two independent single-qubit amplitude damping channels with the same damping parameter \(\gamma\), giving the four Kraus operators \(\{K_i \otimes K_j\}\) for \(i, j \in \{1, 2\}\).

Parameters:

prob (float) – The damping parameter \(\gamma\) associated to the channel.

Returns:

containing the corresponding Kraus operators

Return type:

graphix.channels.KrausChannel object