quairkit.operator.channel.common

The source file of the classes for common quantum channels.

class quairkit.operator.channel.common.BitFlip(prob, qubits_idx=None)

A collection of bit flip channels.

Such a channel’s Kraus operators are

\[E_0 = \sqrt{1-p} I, E_1 = \sqrt{p} X.\]
Parameters:
prob : Tensor | float

Probability of a bit flip. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

class quairkit.operator.channel.common.PhaseFlip(prob, qubits_idx=None)

A collection of phase flip channels.

Such a channel’s Kraus operators are

\[E_0 = \sqrt{1 - p} I, E_1 = \sqrt{p} Z.\]
Parameters:
prob : Tensor | float

Probability of a phase flip. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

class quairkit.operator.channel.common.BitPhaseFlip(prob, qubits_idx=None)

A collection of bit phase flip channels.

Such a channel’s Kraus operators are

\[E_0 = \sqrt{1 - p} I, E_1 = \sqrt{p} Y.\]
Parameters:
prob : Tensor | float

Probability of a bit phase flip. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

class quairkit.operator.channel.common.AmplitudeDamping(gamma, qubits_idx=None)

A collection of amplitude damping channels.

Such a channel’s Kraus operators are

\[\begin{split}E_0 = \begin{bmatrix} 1 & 0 \\ 0 & \sqrt{1-\gamma} \end{bmatrix}, E_1 = \begin{bmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{bmatrix}.\end{split}\]
Parameters:
gamma : Tensor | float

Damping probability. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

class quairkit.operator.channel.common.GeneralizedAmplitudeDamping(gamma, prob, qubits_idx=None)

A collection of generalized amplitude damping channels.

Such a channel’s Kraus operators are

\[\begin{split}E_0 = \sqrt{p} \begin{bmatrix} 1 & 0 \\ 0 & \sqrt{1-\gamma} \end{bmatrix}, E_1 = \sqrt{p} \begin{bmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{bmatrix},\\ E_2 = \sqrt{1-p} \begin{bmatrix} \sqrt{1-\gamma} & 0 \\ 0 & 1 \end{bmatrix}, E_3 = \sqrt{1-p} \begin{bmatrix} 0 & 0 \\ \sqrt{\gamma} & 0 \end{bmatrix}.\end{split}\]
Parameters:
gamma : Tensor | float

Damping probability. Its value should be in the range \([0, 1]\).

prob : Tensor | float

Excitation probability. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

class quairkit.operator.channel.common.PhaseDamping(gamma, qubits_idx=None)

A collection of phase damping channels.

Such a channel’s Kraus operators are

\[\begin{split}E_0 = \begin{bmatrix} 1 & 0 \\ 0 & \sqrt{1-\gamma} \end{bmatrix}, E_1 = \begin{bmatrix} 0 & 0 \\ 0 & \sqrt{\gamma} \end{bmatrix}.\end{split}\]
Parameters:
gamma : Tensor | float

Parameter of the phase damping channels. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

class quairkit.operator.channel.common.Depolarizing(prob, qubits_idx=None)

A collection of depolarizing channels.

Such a channel’s Kraus operators are

\[E_0 = \sqrt{1-3p/4} I, E_1 = \sqrt{p/4} X, E_2 = \sqrt{p/4} Y, E_3 = \sqrt{p/4} Z.\]
Parameters:
prob : Tensor | float

Parameter of the depolarizing channels. Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

Note

The implementation logic for this feature has been updated. The current version refers to formula (8.102) in Quantum Computation and Quantum Information 10th edition by M.A.Nielsen and I.L.Chuang. Reference: Nielsen, M., & Chuang, I. (2010). Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge: Cambridge University Press. doi:10.1017/CBO9780511976667

class quairkit.operator.channel.common.GeneralizedDepolarizing(prob, qubits_idx, num_qubits=None)

A generalized depolarizing channel.

Such a channel’s Kraus operators are

\[\begin{split}E_0 = \sqrt{1-(D - 1)p/D} I, \text{ where } D = 4^n, \\ E_k = \sqrt{p/D} \sigma_k, \text{ for } 0 < k < D.\end{split}\]
Parameters:
prob : Tensor | float

probability \(p\). Its value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act, the length of which is \(n\). Defaults to be None.

num_qubits : int

Total number of qubits. Defaults to None.

class quairkit.operator.channel.common.PauliChannel(prob, qubits_idx=None)

A collection of Pauli channels.

Parameters:
prob : Tensor | Iterable[float]

Probabilities corresponding to the Pauli X, Y, and Z operators. Each value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

Note

The sum of three input probabilities should be less than or equal to 1.

class quairkit.operator.channel.common.ResetChannel(prob, qubits_idx=None)

A collection of reset channels.

Such a channel reset the state to \(|0\rangle\) with a probability of p and to \(|1\rangle\) with a probability of q. Its Kraus operators are

\[\begin{split}E_0 = \begin{bmatrix} \sqrt{p} & 0 \\ 0 & 0 \end{bmatrix}, E_1 = \begin{bmatrix} 0 & \sqrt{p} \\ 0 & 0 \end{bmatrix},\\ E_2 = \begin{bmatrix} 0 & 0 \\ \sqrt{q} & 0 \end{bmatrix}, E_3 = \begin{bmatrix} 0 & 0 \\ 0 & \sqrt{q} \end{bmatrix},\\ E_4 = \sqrt{1-p-q} I.\end{split}\]
Parameters:
prob : Tensor | Iterable[float]

Probabilities of resetting to \(|0\rangle\) and to \(|1\rangle\). Each value should be in the range \([0, 1]\).

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

Note

The sum of two input probabilities should be less than or equal to 1.

class quairkit.operator.channel.common.ThermalRelaxation(const_t, exec_time, qubits_idx=None)

A collection of thermal relaxation channels.

Such a channel simulates the mixture of the \(T_1\) and the \(T_2\) processes on superconducting devices.

Parameters:
const_t : Tensor | Iterable[float]

\(T_1\) and \(T_2\) relaxation time in microseconds.

exec_time : Tensor | float

Quantum gate execution time in the process of relaxation in nanoseconds.

qubits_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act. Defaults to list(range(# of acted qubits))

Note

Relaxation time must satisfy \(T_2 \le T_1\). For reference please see https://arxiv.org/abs/2101.02109.

class quairkit.operator.channel.common.ReplacementChannel(sigma, system_idx=None)

A collection of quantum replacement channels.

For a quantum state \(\sigma\), the corresponding replacement channel \(R\) is defined as

\[R(\rho) = \text{tr}(\rho)\sigma\]
Parameters:
sigma : State

The state to be replaced.

system_idx : Iterable[int] | int | str

Indices of the qubits on which the channels act, the length of which is \(n\). Defaults to list(range(# of acted qubits)).