mimiqcircuits.operations.noisechannel.standards.depolarizing¶
Classes
|
N-qubit depolarizing noise channel. |
- class mimiqcircuits.operations.noisechannel.standards.depolarizing.Depolarizing(N, p)[source]¶
Bases:
krauschannelN-qubit depolarizing noise channel.
The Kraus operators for the depolarizing channel are given by:
\[E_1 = \sqrt{1-p} I_N, \quad E_i = \sqrt{p/(4^N-1)} P_i,\]where \(p \in [0,1]\) is a probability, and \(P_i\) is an \(N\)-qubit Pauli string operator, i.e., a tensor product of one-qubit Pauli operators.
There is exactly one Kraus operator \(E_{i>1}\) for each distinct combination of Pauli operators \(P_i\), except for the \(N\)-qubit identity \(I_N = I \otimes I \otimes I \otimes \dots\).
For example:
For one qubit, we have 3 operators \(P_i \in \{X, Y, Z\}\).
For two qubits, we have 15 operators \(P_i \in \{ I\otimes X, I\otimes Y, I\otimes Z, X\otimes I, Y\otimes I, Z\otimes I, X\otimes X, X\otimes Y, X\otimes Z, Y\otimes X, Y\otimes Y, Y\otimes Z, Z\otimes X, Z\otimes Y, Z\otimes Z \}\).
This channel is a mixed unitary channel (see
ismixedunitary()), and is a special case ofPauliNoise.See also
PauliStringPauliNoise- Parameters:
Examples
Depolarizing channels can be defined for any number of qubits:
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(Depolarizing(1, 0.1), 1) 2-qubit circuit with 1 instruction: └── Depolarizing(0.1) @ q[1]
>>> c.push(Depolarizing(5, 0.1), 1, 2, 3, 4, 5) 6-qubit circuit with 2 instructions: ├── Depolarizing(0.1) @ q[1] └── Depolarizing(0.1) @ q[1:5]
For one and two qubits, you can use the shorthand notation:
>>> c.push(Depolarizing(1, 0.1), 1) 6-qubit circuit with 3 instructions: ├── Depolarizing(0.1) @ q[1] ├── Depolarizing(0.1) @ q[1:5] └── Depolarizing(0.1) @ q[1]
>>> c.push(Depolarizing(2, 0.1), 1, 2) 6-qubit circuit with 4 instructions: ├── Depolarizing(0.1) @ q[1] ├── Depolarizing(0.1) @ q[1:5] ├── Depolarizing(0.1) @ q[1] └── Depolarizing(0.1) @ q[1:2]
- property parnames¶
- property num_qubits¶
- probabilities()[source]¶
Returns the probabilities for each Kraus operator in a mixed unitary channel.
A mixed unitary channel is written as:
\[\mathcal{E}(\rho) = \sum_k p_k U_k \rho U_k^\dagger,\]where \(p_k\) are the probabilities.
This method is valid only for mixed unitary channels.
- Returns:
A list of probabilities for each Kraus operator.
- Return type:
- unitarygates()[source]¶
Returns the unitary gates associated with the given mixed unitary Kraus channel.
A mixed unitary channel is written as:
\[\sum_k p_k U_k \rho U_k^\dagger,\]where \(U_k\) are the unitary operators.
This method is valid only for mixed unitary channels.
- unitarymatrices()[source]¶
Unitary matrices associated with the given mixed unitary Kraus channel.
A mixed unitary channel is written as:
\[\mathcal{E}(\rho) = \sum_k p_k U_k \rho U_k^\dagger,\]where \(U_k\) are the unitary matrices.
An error is raised if the channel is not mixed unitary (i.e., ismixedunitary(self)==False).
Note
If the Kraus channel is parametric, the matrix elements are wrapped in a symbolic object (e.g., from sympy or symengine). To manipulate expressions, use the appropriate symbolic manipulation libraries.
Examples
>>> from mimiqcircuits import * >>> PauliX(0.2).unitarymatrices() [[1.0, 0] [0, 1.0] , [0, 1.0] [1.0, 0] ]
- krausmatrices()[source]¶
Returns the Kraus matrices associated with the given Kraus channel.
A mixed unitary channel is written as:
\[\mathcal{E}(\rho) = \sum_k p_k U_k \rho U_k^\dagger,\]where \(U_k\) are the unitary matrices returned by this function.
If the Kraus channel is parametric, the matrix elements are wrapped in a symengine or sympy object.
- Returns:
A list of symengine matrices representing the Kraus operators.
- Return type:
- krausoperators()[source]¶
Returns the Kraus operators associated with the given Kraus channel.
This should be implemented for each specific channel.
- Returns:
A list of matrices representing the Kraus operators.
- Return type:
- classmethod ismixedunitary()[source]¶
Determine whether the quantum operation is a mixed unitary channel.
A channel is considered mixed unitary if all the Kraus operators \(E_k\) are proportional to a unitary matrix \(U_k\), i.e.,
\[\mathcal{E}(\rho) = \sum_k p_k U_k \rho U_k^\dagger,\]with some probabilities \(0 \leq p_k \leq 1\) that add up to 1, and \(U_k^\dagger U_k = I\).
- Parameters:
krauschannel – The Kraus channel to check.
- Returns:
True if the channel is a mixed unitary channel, False otherwise.
- Return type:
Examples
>>> from mimiqcircuits import * >>> PauliX(0.1).ismixedunitary() True
>>> AmplitudeDamping(0.1).ismixedunitary() False