mimiqcircuits.operations.noisechannel.standards.pauli¶
Classes
|
N-qubit Pauli noise channel specified by a list of probabilities and Pauli gates. |
|
One-qubit Pauli X noise channel (bit flip error). |
|
One-qubit Pauli Y noise channel (bit-phase flip error). |
|
One-qubit Pauli Z noise channel (phase flip error). |
- class mimiqcircuits.operations.noisechannel.standards.pauli.PauliNoise(p, paulistr)[source]¶
Bases:
krauschannelN-qubit Pauli noise channel specified by a list of probabilities and Pauli gates.
A Pauli channel is defined by:
\[\mathcal{E}(\rho) = \sum_k p_k P_k \rho P_k,\]where \(0 \leq p_k \leq 1\) and \(P_k\) are Pauli string operators, defined as tensor products of one-qubit Pauli operators. The probabilities must fulfill \(\sum_k p_k = 1\).
This channel is a mixed unitary channel (see
ismixedunitary()).- Parameters:
The lengths of p and paulistrings must be the same.
Examples
PauliNoise channels can be defined for any number of qubits, and for any number of Pauli strings:
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(PauliNoise([0.8, 0.1, 0.1], ["I", "X", "Y"]), 1) 2-qubit circuit with 1 instruction: └── PauliNoise((0.8, pauli"I"), (0.1, pauli"X"), (0.1, pauli"Y")) @ q[1]
>>> c.push(PauliNoise([0.9, 0.1], ["XY", "II"]), 1, 2) 3-qubit circuit with 2 instructions: ├── PauliNoise((0.8, pauli"I"), (0.1, pauli"X"), (0.1, pauli"Y")) @ q[1] └── PauliNoise((0.9, pauli"XY"), (0.1, pauli"II")) @ q[1]
>>> c.push(PauliNoise([0.5, 0.2, 0.2, 0.1], ["IXIX", "XYXY", "ZZZZ", "IXYZ"]), 1, 2, 3, 4) 5-qubit circuit with 3 instructions: ├── PauliNoise((0.8, pauli"I"), (0.1, pauli"X"), (0.1, pauli"Y")) @ q[1] ├── PauliNoise((0.9, pauli"XY"), (0.1, pauli"II")) @ q[1] └── PauliNoise((0.5, pauli"IXIX"), (0.2, pauli"XYXY"), (0.2, pauli"ZZZZ"), (0.1, pauli"IXYZ")) @ q[1]
- property num_qubits¶
- property parnames¶
- 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:
- 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:
- 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] ]
- 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.
- 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
- unwrappedkrausmatrices()[source]¶
Returns the unitary Kraus matrices associated to the mixed unitary Kraus channel without symbolic wrapper.
See also
Example
>>> from mimiqcircuits import * >>> op = PauliX(0.2) >>> op.unwrappedkrausmatrices() [[0.894427190999916, 0] [0, 0.894427190999916] , [0, 0.447213595499958] [0.447213595499958, 0] ]
- class mimiqcircuits.operations.noisechannel.standards.pauli.PauliX(p)[source]¶
Bases:
krauschannelOne-qubit Pauli X noise channel (bit flip error).
This channel is defined by the Kraus operators:
\[E_1 = \sqrt{1-p}\,I, \quad E_2 = \sqrt{p}\,X,\]where \(0 \leq p \leq 1\).
This channel is a mixed unitary channel (see
ismixedunitary()), and is a special case ofPauliNoise.PauliX(p) is equivalent to PauliNoise([1-p, p], [“I”, “X”]).
- Parameters:
p (float) – Probability of a bit flip error, must be in the range [0, 1].
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(PauliX(0.1), 1) 2-qubit circuit with 1 instruction: └── PauliX(0.1) @ q[1]
- 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:
- 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:
- 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] ]
- 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.
- static 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
- class mimiqcircuits.operations.noisechannel.standards.pauli.PauliY(p)[source]¶
Bases:
krauschannelOne-qubit Pauli Y noise channel (bit-phase flip error).
This channel is determined by the Kraus operators:
\[E_1 = \sqrt{1-p}\,I, \quad E_2 = \sqrt{p}\,Y,\]where \(0 \leq p \leq 1\).
This channel is a mixed unitary channel (see
ismixedunitary()), and is a special case ofPauliNoise.PauliY(p) is equivalent to PauliNoise([1-p, p], [“I”, “Y”]).
- Parameters:
p (float) – Probability of a bit-phase flip error, must be in the range [0, 1].
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(PauliY(0.1), 1) 2-qubit circuit with 1 instruction: └── PauliY(0.1) @ q[1]
- 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:
- 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:
- 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] ]
- 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.
- static 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
- class mimiqcircuits.operations.noisechannel.standards.pauli.PauliZ(p)[source]¶
Bases:
krauschannelOne-qubit Pauli Z noise channel (phase flip error).
This channel is determined by the Kraus operators:
\[E_1 = \sqrt{1-p}\,I, \quad E_2 = \sqrt{p}\,Z,\]where \(0 \leq p \leq 1\).
This channel is a mixed unitary channel (see
ismixedunitary()), and is a special case ofPauliNoise.PauliZ(p) is equivalent to PauliNoise([1-p, p], [“I”, “Z”]).
- Parameters:
p (float) – Probability of a phase flip error, must be in the range [0, 1].
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(PauliZ(0.1), 1) 2-qubit circuit with 1 instruction: └── PauliZ(0.1) @ q[1]
- 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:
- 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:
- 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] ]
- 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.
- static 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