paddle_quantum.channel.common
The source file of the classes for common quantum channels.
- class paddle_quantum.channel.common.BitFlip(prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of bit flip channels.
Such a channel’s Kraus operators are
- Parameters:
prob (Tensor | float) – Probability of a bit flip. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.PhaseFlip(prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of phase flip channels.
Such a channel’s Kraus operators are
- Parameters:
prob (Tensor | float) – Probability of a phase flip. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.BitPhaseFlip(prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of bit phase flip channels.
Such a channel’s Kraus operators are
- Parameters:
prob (Tensor | float) – Probability of a bit phase flip. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.AmplitudeDamping(gamma, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of amplitude damping channels.
Such a channel’s Kraus operators are
- Parameters:
gamma (Tensor | float) – Damping probability. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.GeneralizedAmplitudeDamping(gamma, prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of generalized amplitude damping channels.
Such a channel’s Kraus operators are
- Parameters:
gamma (Tensor | float) – Damping probability. Its value should be in the range
.prob (Tensor | float) – Excitation probability. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.PhaseDamping(gamma, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of phase damping channels.
Such a channel’s Kraus operators are
- Parameters:
gamma (Tensor | float) – Parameter of the phase damping channels. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.Depolarizing(prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of depolarizing channels.
Such a channel’s Kraus operators are
- Parameters:
prob (Tensor | float) – Parameter of the depolarizing channels. Its value should be in the range
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
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 paddle_quantum.channel.common.GeneralizedDepolarizing(prob, qubits_idx=None, num_qubits=None)
Bases:
Channel
A generalized depolarizing channel.
Such a channel’s Kraus operators are
- Parameters:
prob (Tensor | float) – probability
. Its value should be in the range .qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act, the length of which is
. Defaults to beNone
.num_qubits (int) – Total number of qubits. Defaults to
None
.
- class paddle_quantum.channel.common.PauliChannel(prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
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
.qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
Note
The sum of three input probabilities should be less than or equal to 1.
- class paddle_quantum.channel.common.ResetChannel(prob, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of reset channels.
Such a channel reset the state to
with a probability of p and to with a probability of q. Its Kraus operators are- Parameters:
prob (Tensor | Iterable[float]) – Probabilities of resetting to
and to . Each value should be in the range .qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
Note
The sum of two input probabilities should be less than or equal to 1.
- class paddle_quantum.channel.common.ThermalRelaxation(const_t, exec_time, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of thermal relaxation channels.
Such a channel simulates the mixture of the
and the processes on superconducting devices.- Parameters:
const_t (Tensor | Iterable[float]) –
and 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
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
Note
Relaxation time must satisfy
. For reference please see https://arxiv.org/abs/2101.02109.
- class paddle_quantum.channel.common.MixedUnitaryChannel(num_unitary, qubits_idx='full', num_qubits=None)
Bases:
Channel
A collection of single-qubit mixed unitary channels.
Such a channel’s Kraus operators are randomly generated unitaries times related probabilities
- Parameters:
num_unitary (int) – The amount of random unitaries to be generated.
qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act. Defaults to
'full'
.num_qubits (int) – Total number of qubits. Defaults to
None
.
Note
The probability distribution of unitaries is set to be uniform distribution.
- class paddle_quantum.channel.common.ReplacementChannel(sigma, qubits_idx=None, num_qubits=None)
Bases:
Channel
A collection of quantum replacement channels.
For a quantum state
, the corresponding replacement channel is defined as- Parameters:
sigma (State) – The state to be replaced.
qubits_idx (Iterable[int] | int | str) – Indices of the qubits on which the channels act, the length of which is
. Defaults to beNone
.num_qubits (int) – Total number of qubits. Defaults to
None
.