channel#
Quantum channels
Classes
|
Amplitude damping channel. |
|
Bit flip channel. |
|
Depolarizing channel. |
|
Generalized amplitude damping channel. |
|
Pauli channel. |
|
Phase damping channel. |
|
Phase flip channel. |
- class AmplitudeDamping(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelAmplitude damping channel.
The amplitude damping channel is defined as:
\[\begin{split}\rho \Rightarrow K_0 \rho K_0^{\dagger} + K_1 \rho K_1^{\dagger}, K_0 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1 - p} \end{pmatrix}, K_1 = \begin{pmatrix} 0 & \sqrt{p} \\ 0 & 0 \end{pmatrix}\end{split}\]- Parameters:
inputs (Any) – The parameter of the channel. Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)
- class BitFlip(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelBit flip channel.
The bit flip channel is defined as:
\[\rho \Rightarrow (1-p) \rho + p X \rho X^{\dagger}\]- Parameters:
inputs (Any) – The parameter of the channel. Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)
- class Depolarizing(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelDepolarizing channel.
The depolarizing channel is defined as:
\[\rho \Rightarrow (1-p) \rho + p/3 X \rho X^{\dagger} + p/3 Y \rho Y^{\dagger} + p/3 Z \rho Z^{\dagger}\]- Parameters:
inputs (Any) – The parameter of the channel. Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)
- class GeneralizedAmplitudeDamping(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelGeneralized amplitude damping channel.
The generalized amplitude damping channel is defined as:
\[\begin{split}\rho \Rightarrow K_0 \rho K_0^{\dagger} + K_1 \rho K_1^{\dagger} + K_2 \rho K_2^{\dagger} + K_3 \rho K_3^{\dagger}, K_0 = \sqrt{p} \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1 - \gamma} \end{pmatrix}, K_1 = \sqrt{p} \begin{pmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{pmatrix}, K_2 = \sqrt{1 - p} \begin{pmatrix} \sqrt{1 - \gamma} & 0 \\ 0 & 1 \end{pmatrix}, K_3 = \sqrt{1 - p} \begin{pmatrix} 0 & 0 \\ \sqrt{\gamma} & 0 \end{pmatrix}\end{split}\]- Parameters:
inputs (Any) – The parameters of the channel. The first parameter is the probability of amplitude damping error, and the second parameter is the damping rate. Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)
- class Pauli(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelPauli channel.
The Pauli channel is defined as:
\[\rho \Rightarrow (1-px-py-pz) \rho + px X \rho X^{\dagger} + py Y \rho Y^{\dagger} + pz Z \rho Z^{\dagger}\]- Parameters:
inputs (Any) – The parameters of the channel. Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)
- property prob#
The error probabilities.
- class PhaseDamping(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelPhase damping channel.
The phase damping channel is defined as:
\[\begin{split}\rho \Rightarrow K_0 \rho K_0^{\dagger} + K_1 \rho K_1^{\dagger}, K_0 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1 - p} \end{pmatrix}, K_1 = \begin{pmatrix} 0 & 0 \\ 0 & \sqrt{p} \end{pmatrix}\end{split}\]- Parameters:
inputs (Any) – The parameter of the channel. The Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)
- class PhaseFlip(inputs: Any = None, nqubit: int = 1, wires: int | list[int] | None = None, tsr_mode: bool = False, requires_grad: bool = False)[source]#
Bases:
ChannelPhase flip channel.
The phase flip channel is defined as:
\[\rho \Rightarrow (1-p) \rho + p Z \rho Z^{\dagger}\]- Parameters:
inputs (Any) – The parameter of the channel. Default:
Nonenqubit (int) – The number of qubits that the quantum operation acts on. Default: 1
wires (int | list[int] | None) – The indices of the qubits that the quantum operation acts on. Default:
Nonetsr_mode (bool) – Whether the quantum operation is in tensor mode, which means the input and output are represented by a tensor of shape \((\text{batch}, 2, ..., 2)\). Default:
Falserequires_grad (bool) – Whether the parameter is
nn.Parameterorbuffer. Default:False(which meansbuffer)