Decoherence channels which act on density matrices to induce mixing. More...
Functions | |
void | mixDamping (Qureg qureg, int targetQubit, qreal prob) |
Mixes a density matrix qureg to induce single-qubit amplitude damping (decay to 0 state). More... | |
void | mixDensityMatrix (Qureg combineQureg, qreal prob, Qureg otherQureg) |
Modifies combineQureg to become (1-prob )combineProb + prob otherQureg . More... | |
void | mixDephasing (Qureg qureg, int targetQubit, qreal prob) |
Mixes a density matrix qureg to induce single-qubit dephasing noise. More... | |
void | mixDepolarising (Qureg qureg, int targetQubit, qreal prob) |
Mixes a density matrix qureg to induce single-qubit homogeneous depolarising noise. More... | |
void | mixKrausMap (Qureg qureg, int target, ComplexMatrix2 *ops, int numOps) |
Apply a general single-qubit Kraus map to a density matrix, as specified by at most four Kraus operators, \(K_i\) (ops ). More... | |
void | mixMultiQubitKrausMap (Qureg qureg, int *targets, int numTargets, ComplexMatrixN *ops, int numOps) |
Apply a general N-qubit Kraus map to a density matrix, as specified by at most (2N)^2 Kraus operators. More... | |
void | mixNonTPKrausMap (Qureg qureg, int target, ComplexMatrix2 *ops, int numOps) |
Apply a general non-trace-preserving single-qubit Kraus map to a density matrix, as specified by at most four operators, \(K_i\) (ops ). More... | |
void | mixNonTPMultiQubitKrausMap (Qureg qureg, int *targets, int numTargets, ComplexMatrixN *ops, int numOps) |
Apply a general N-qubit non-trace-preserving Kraus map to a density matrix, as specified by at most (2N)^2 operators. More... | |
void | mixNonTPTwoQubitKrausMap (Qureg qureg, int target1, int target2, ComplexMatrix4 *ops, int numOps) |
Apply a general non-trace-preserving two-qubit Kraus map to a density matrix, as specified by at most sixteen operators, \(K_i\) (ops ). More... | |
void | mixPauli (Qureg qureg, int targetQubit, qreal probX, qreal probY, qreal probZ) |
Mixes a density matrix qureg to induce general single-qubit Pauli noise. More... | |
void | mixTwoQubitDephasing (Qureg qureg, int qubit1, int qubit2, qreal prob) |
Mixes a density matrix qureg to induce two-qubit dephasing noise. More... | |
void | mixTwoQubitDepolarising (Qureg qureg, int qubit1, int qubit2, qreal prob) |
Mixes a density matrix qureg to induce two-qubit homogeneous depolarising noise. More... | |
void | mixTwoQubitKrausMap (Qureg qureg, int target1, int target2, ComplexMatrix4 *ops, int numOps) |
Apply a general two-qubit Kraus map to a density matrix, as specified by at most sixteen Kraus operators. More... | |
Detailed Description
Decoherence channels which act on density matrices to induce mixing.
Function Documentation
◆ mixDamping()
Mixes a density matrix qureg
to induce single-qubit amplitude damping (decay to 0 state).
With probability prob
, applies damping (transition from 1 to 0 state).
This transforms qureg
= \(\rho\) into the mixed state
\[ K_0 \rho K_0^\dagger + K_1 \rho K_1^\dagger \]
where q = targetQubit
and \(K_0\) and \(K_1\) are Kraus operators
\[ K_0 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1-\text{prob}} \end{pmatrix}, \;\; K_1 = \begin{pmatrix} 0 & \sqrt{\text{prob}} \\ 0 & 0 \end{pmatrix}. \]
prob
cannot exceed 1, at which total damping/decay occurs. Note that unlike mixDephasing() and mixDepolarising(), this function can increase the purity of a mixed state (by, as prob
becomes 1, gaining certainty that the qubit is in the 0 state).
- Parameters
-
[in,out] qureg a density matrix [in] targetQubit qubit upon which to induce amplitude damping [in] prob the probability of the damping
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if
targetQubit
is outside [0,qureg.numQubitsRepresented
) - if
prob
is not in [0, 1]
- if
Referenced by TEST_CASE().
◆ mixDensityMatrix()
Modifies combineQureg to become (1-prob
)combineProb
+ prob
otherQureg
.
Both registers must be equal-dimension density matrices, and prob must be in [0, 1].
- Parameters
-
[in,out] combineQureg a density matrix to be modified [in] prob the probability of otherQureg
in the modifiedcombineQureg
[in] otherQureg a density matrix to be mixed into combineQureg
- Exceptions
-
invalidQuESTInputError() - if either
combineQureg
orotherQureg
are not density matrices - if the dimensions of
combineQureg
andotherQureg
do not match - if
prob
is not in [0, 1]
- if either
Referenced by TEST_CASE().
◆ mixDephasing()
Mixes a density matrix qureg
to induce single-qubit dephasing noise.
With probability prob
, applies Pauli Z to targetQubit
.
This transforms qureg
= \(\rho\) into the mixed state
\[ (1 - \text{prob}) \, \rho + \text{prob} \; Z_q \, \rho \, Z_q \]
where q = targetQubit
. prob
cannot exceed 1/2, which maximally mixes targetQubit
.
- See also
- Parameters
-
[in,out] qureg a density matrix [in] targetQubit qubit upon which to induce dephasing noise [in] prob the probability of the phase error occuring
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if
targetQubit
is outside [0,qureg.numQubitsRepresented
) - if
prob
is not in [0, 1/2]
- if
Referenced by TEST_CASE().
◆ mixDepolarising()
Mixes a density matrix qureg
to induce single-qubit homogeneous depolarising noise.
This is equivalent to, with probability prob
, uniformly randomly applying either Pauli X, Y, or Z to targetQubit
.
This transforms qureg
= \(\rho\) into the mixed state
\[ (1 - \text{prob}) \, \rho + \frac{\text{prob}}{3} \; \left( X_q \, \rho \, X_q + Y_q \, \rho \, Y_q + Z_q \, \rho \, Z_q \right) \]
where q = targetQubit
. prob
cannot exceed 3/4, at which maximal mixing occurs. The produced state is equivalently expressed as
\[ \left( 1 - \frac{4}{3} \text{prob} \right) \rho + \left( \frac{4}{3} \text{prob} \right) \frac{\vec{\bf{1}}}{2} \]
where \( \frac{\vec{\bf{1}}}{2} \) is the maximally mixed state of the target qubit.
- See also
- Parameters
-
[in,out] qureg a density matrix [in] targetQubit qubit upon which to induce depolarising noise [in] prob the probability of the depolarising error occuring
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if
targetQubit
is outside [0,qureg.numQubitsRepresented
) - if
prob
is not in [0, 3/4]
- if
Referenced by TEST_CASE().
◆ mixKrausMap()
void mixKrausMap | ( | Qureg | qureg, |
int | target, | ||
ComplexMatrix2 * | ops, | ||
int | numOps | ||
) |
Apply a general single-qubit Kraus map to a density matrix, as specified by at most four Kraus operators, \(K_i\) (ops
).
A Kraus map is also referred to as a "operator-sum representation" of a quantum channel, and enables the simulation of general single-qubit noise process, by effecting
\[ \rho \to \sum\limits_i^{\text{numOps}} K_i \rho K_i^\dagger \]
The Kraus map must be completely positive and trace preserving, which constrains each \( K_i \) in ops
by
\[ \sum \limits_i^{\text{numOps}} K_i^\dagger K_i = I \]
where \( I \) is the identity matrix. Use mixNonTPKrausMap() to relax this condition.
Note that in distributed mode, this routine requires that each node contains at least 4 amplitudes. This means an q-qubit register can be distributed by at most 2^(q-2) numTargs nodes.
- See also
- Parameters
-
[in,out] qureg the density matrix to which to apply the map [in] target the target qubit of the map [in] ops an array of at most 4 Kraus operators [in] numOps the number of operators in ops
which must be >0 and <= 4.
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if
target
is outside of [0,qureg.numQubitsRepresented
) - if
numOps
is outside [1, 4] - if
ops
do not create a completely positive, trace preserving map - if a node cannot fit 4 amplitudes in distributed mode
- if
Referenced by TEST_CASE().
◆ mixMultiQubitKrausMap()
void mixMultiQubitKrausMap | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
ComplexMatrixN * | ops, | ||
int | numOps | ||
) |
Apply a general N-qubit Kraus map to a density matrix, as specified by at most (2N)^2 Kraus operators.
This allows one to simulate a general noise process.
The Kraus map must be completely positive and trace preserving, which constrains each \( K_i \) in ops
by
\[ \sum \limits_i^{\text{numOps}} K_i^\dagger K_i = I \]
where \( I \) is the identity matrix. Use mixNonTPMultiQubitKrausMap() to relax this condition.
The first qubit in targets
is treated as the least
significant qubit in each op in ops
.
Note that in distributed mode, this routine requires that each node contains at least (2N)^2 amplitudes. This means an q-qubit register can be distributed by at most 2^(q-2)/N^2 nodes.
Note too that this routine internally creates a 'superoperator'; a complex matrix of dimensions 2^(2*numTargets) by 2^(2*numTargets). Therefore, invoking this function incurs, for numTargs={1,2,3,4,5, ...}, an additional memory overhead of (at double-precision) {0.25 KiB, 4 KiB, 64 KiB, 1 MiB, 16 MiB, ...} (respectively). At quad precision (usually 10 B per number, but possibly 16 B due to alignment), this costs at most double the amount of memory. For numTargets < 4, this superoperator will be created in the runtime stack. For numTargs >= 4, the superoperator will be allocated in the heap and therefore this routine may suffer an anomalous slowdown.
- See also
- Parameters
-
[in,out] qureg the density matrix to which to apply the map [in] targets a list of target qubit indices, the first of which is treated as least significant in each op in ops
[in] numTargets the length of targets
[in] ops an array of at most (2N)^2 Kraus operators [in] numOps the number of operators in ops
which must be >0 and <= (2N)^2.
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if any target in
targets
is outside of [0,qureg.numQubitsRepresented
) - if any qubit in
targets
is repeated - if
numOps
is outside [1, (2numTargets
)^2] - if any ComplexMatrixN in
ops
does not have op.numQubits ==numTargets
- if
ops
do not create a completely positive, trace preserving map - if a node cannot fit (2N)^2 amplitudes in distributed mode
- if
Referenced by TEST_CASE().
◆ mixNonTPKrausMap()
void mixNonTPKrausMap | ( | Qureg | qureg, |
int | target, | ||
ComplexMatrix2 * | ops, | ||
int | numOps | ||
) |
Apply a general non-trace-preserving single-qubit Kraus map to a density matrix, as specified by at most four operators, \(K_i\) (ops
).
This effects
\[ \rho \to \sum\limits_i^{\text{numOps}} K_i \rho K_i^\dagger \]
where \(K_i\) are permitted to be any matrix. This means the density matrix can enter a non-physical state.
Use mixKrausMap() to enforce that the channel is trace preserving and completely positive.
Note that in distributed mode, this routine requires that each node contains at least 4 amplitudes. This means an q-qubit register can be distributed by at most 2^(q-2) numTargs nodes.
- Parameters
-
[in,out] qureg the density matrix to which to apply the map [in] target the target qubit of the map [in] ops an array of at most 4 Kraus operators [in] numOps the number of operators in ops
which must be >0 and <= 4.
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if
target
is outside of [0,qureg.numQubitsRepresented
) - if
numOps
is outside [1, 4] - if a node cannot fit 4 amplitudes in distributed mode
- if
Referenced by TEST_CASE().
◆ mixNonTPMultiQubitKrausMap()
void mixNonTPMultiQubitKrausMap | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
ComplexMatrixN * | ops, | ||
int | numOps | ||
) |
Apply a general N-qubit non-trace-preserving Kraus map to a density matrix, as specified by at most (2N)^2 operators.
This effects
\[ \rho \to \sum\limits_i^{\text{numOps}} K_i \rho K_i^\dagger \]
where the matrices \( K_i \) are unconstrained, and hence the effective map is permitted to be non-completely-positive and non-trace-preserving. Use mixMultiQubitKrausMap() to enforce that the map be completely positive.
The first qubit in targets
is treated as the least
significant qubit in each op in ops
.
Note that in distributed mode, this routine requires that each node contains at least (2N)^2 amplitudes. This means an q-qubit register can be distributed by at most 2^(q-2)/N^2 nodes.
Note too that this routine internally creates a 'superoperator'; a complex matrix of dimensions 2^(2*numTargets) by 2^(2*numTargets). Therefore, invoking this function incurs, for numTargs={1,2,3,4,5, ...}, an additional memory overhead of (at double-precision) {0.25 KiB, 4 KiB, 64 KiB, 1 MiB, 16 MiB, ...} (respectively). At quad precision (usually 10 B per number, but possibly 16 B due to alignment), this costs at most double the amount of memory. For numTargets < 4, this superoperator will be created in the runtime stack. For numTargs >= 4, the superoperator will be allocated in the heap and therefore this routine may suffer an anomalous slowdown.
- See also
- Parameters
-
[in,out] qureg the density matrix to which to apply the map [in] targets a list of target qubit indices, the first of which is treated as least significant in each op in ops
[in] numTargets the length of targets
[in] ops an array of at most (2N)^2 Kraus operators [in] numOps the number of operators in ops
which must be >0 and <= (2N)^2.
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if any target in
targets
is outside of [0,qureg.numQubitsRepresented
) - if any qubit in
targets
is repeated - if
numOps
is outside [1, (2numTargets
)^2] - if any ComplexMatrixN in
ops
does not have op.numQubits ==numTargets
- if a node cannot fit (2N)^2 amplitudes in distributed mode
- if
Referenced by TEST_CASE().
◆ mixNonTPTwoQubitKrausMap()
void mixNonTPTwoQubitKrausMap | ( | Qureg | qureg, |
int | target1, | ||
int | target2, | ||
ComplexMatrix4 * | ops, | ||
int | numOps | ||
) |
Apply a general non-trace-preserving two-qubit Kraus map to a density matrix, as specified by at most sixteen operators, \(K_i\) (ops
).
This effects
\[ \rho \to \sum\limits_i^{\text{numOps}} K_i \rho K_i^\dagger \]
where the matrices \(K_i\) are unconstrained, and hence the effective map is permitted to be non-completely-positive and non-trace-preserving. Use mixTwoQubitKrausMap() to enforce that the map be completely positive.
targetQubit1
is treated as the least
significant qubit in each op in ops
.
Note that in distributed mode, this routine requires that each node contains at least 16 amplitudes. This means an q-qubit register can be distributed by at most 2^(q-4) numTargs nodes.
- Parameters
-
[in,out] qureg the density matrix to which to apply the map [in] target1 the least significant target qubit in ops
[in] target2 the most significant target qubit in ops
[in] ops an array of at most 16 Kraus operators [in] numOps the number of operators in ops
which must be >0 and <= 16.
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if either
target1
ortarget2
is outside of [0,qureg.numQubitsRepresented
) - if
target1
=target2
- if
numOps
is outside [1, 16] - if a node cannot fit 16 amplitudes in distributed mode
- if
Referenced by TEST_CASE().
◆ mixPauli()
Mixes a density matrix qureg
to induce general single-qubit Pauli noise.
With probabilities probX
, probY
and probZ
, applies Pauli X, Y, and Z respectively to targetQubit
.
This transforms qureg
= \(\rho\) into the mixed state
\[ (1 - \text{probX} - \text{probY} - \text{probZ}) \, \rho + \;\;\; (\text{probX})\; X_q \, \rho \, X_q + \;\;\; (\text{probY})\; Y_q \, \rho \, Y_q + \;\;\; (\text{probZ})\; Z_q \, \rho \, Z_q \]
where q = targetQubit
. Each of probX
, probY
and probZ
cannot exceed the chance of no error: 1 - probX
- probY
- probZ
This function operates by first converting the given Pauli probabilities into a single-qubit Kraus map (four 2x2 operators).
- Parameters
-
[in,out] qureg a density matrix [in] targetQubit qubit to decohere [in] probX the probability of inducing an X error [in] probY the probability of inducing an Y error [in] probZ the probability of inducing an Z error
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if
targetQubit
is outside [0,qureg.numQubitsRepresented
) - if any of
probX
,probY
orprobZ
are not in [0, 1] - if any of p in {
probX
,probY
orprobZ}
don't satisfy p <= (1 -probX
-probY
-probZ
)
- if
Referenced by TEST_CASE().
◆ mixTwoQubitDephasing()
Mixes a density matrix qureg
to induce two-qubit dephasing noise.
With probability prob
, applies Pauli Z to either or both qubits.
This transforms qureg
= \(\rho\) into the mixed state
\[ (1 - \text{prob}) \, \rho + \frac{\text{prob}}{3} \; \left( Z_a \, \rho \, Z_a + Z_b \, \rho \, Z_b + Z_a Z_b \, \rho \, Z_a Z_b \right) \]
where a = qubit1
, b = qubit2
. prob
cannot exceed 3/4, at which maximal mixing occurs.
- See also
- Parameters
-
[in,out] qureg a density matrix [in] qubit1 qubit upon which to induce dephasing noise [in] qubit2 qubit upon which to induce dephasing noise [in] prob the probability of the phase error occuring
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if either
qubit1
orqubit2
is outside [0,qureg.numQubitsRepresented
) - if
qubit1
=qubit2
- if
prob
is not in [0, 3/4]
- if
Referenced by TEST_CASE().
◆ mixTwoQubitDepolarising()
Mixes a density matrix qureg
to induce two-qubit homogeneous depolarising noise.
With probability prob
, applies to qubit1
and qubit2
any operator of the set \(\{ IX, IY, IZ, XI, YI, ZI, XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ \}\). Note this is the set of all two-qubit Pauli gates excluding \(II\).
This transforms qureg
= \(\rho\) into the mixed state
\[ (1 - \text{prob}) \, \rho \; + \; \frac{\text{prob}}{15} \; \left( \sum \limits_{\sigma_a \in \{X_a,Y_a,Z_a,I_a\}} \sum \limits_{\sigma_b \in \{X_b,Y_b,Z_b,I_b\}} \sigma_a \sigma_b \; \rho \; \sigma_a \sigma_b \right) - \frac{\text{prob}}{15} I_a I_b \; \rho \; I_a I_b \]
or verbosely
\[ (1 - \text{prob}) \, \rho + \frac{\text{prob}}{15} \; \left( \begin{aligned} &X_a \, \rho \, X_a + X_b \, \rho \, X_b + Y_a \, \rho \, Y_a + Y_b \, \rho \, Y_b + Z_a \, \rho \, Z_a + Z_b \, \rho \, Z_b \\ + &X_a X_b \, \rho \, X_a X_b + X_a Y_b \, \rho \, X_a Y_b + X_a Z_b \, \rho \, X_a Z_b + Y_a X_b \, \rho \, Y_a X_b \\ + &Y_a Y_b \, \rho \, Y_a Y_b + Y_a Z_b \, \rho \, Y_a Z_b + Z_a X_b \, \rho \, Z_a X_b + Z_a Y_b \, \rho \, Z_a Y_b + Z_a Z_b \, \rho \, Z_a Z_b \end{aligned} \right) \]
where a = qubit1
, b = qubit2
.
prob
cannot exceed 15/16, at which maximal mixing occurs.
The produced state is equivalently expressed as
\[ \left( 1 - \frac{16}{15} \text{prob} \right) \rho + \left( \frac{16}{15} \text{prob} \right) \frac{\vec{\bf{1}}}{2} \]
where \( \frac{\vec{\bf{1}}}{2} \) is the maximally mixed state of the two target qubits.
- See also
- Parameters
-
[in,out] qureg a density matrix [in] qubit1 qubit upon which to induce depolarising noise [in] qubit2 qubit upon which to induce depolarising noise [in] prob the probability of the depolarising error occuring
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if either
qubit1
orqubit2
is outside [0,qureg.numQubitsRepresented
) - if
qubit1
=qubit2
- if
prob
is not in [0, 15/16]
- if
Referenced by TEST_CASE().
◆ mixTwoQubitKrausMap()
void mixTwoQubitKrausMap | ( | Qureg | qureg, |
int | target1, | ||
int | target2, | ||
ComplexMatrix4 * | ops, | ||
int | numOps | ||
) |
Apply a general two-qubit Kraus map to a density matrix, as specified by at most sixteen Kraus operators.
A Kraus map is also referred to as a "operator-sum representation" of a quantum channel. This allows one to simulate a general two-qubit noise process.
The Kraus map must be completely positive and trace preserving, which constrains each \( K_i \) in ops
by
\[ \sum \limits_i^{\text{numOps}} K_i^\dagger K_i = I \]
where \( I \) is the identity matrix. Use mixNonTPTwoQubitKrausMap() to relax this this condition.
targetQubit1
is treated as the least
significant qubit in each op in ops
.
Note that in distributed mode, this routine requires that each node contains at least 16 amplitudes. This means an q-qubit register can be distributed by at most 2^(q-4) numTargs nodes.
- Parameters
-
[in,out] qureg the density matrix to which to apply the map [in] target1 the least significant target qubit in ops
[in] target2 the most significant target qubit in ops
[in] ops an array of at most 16 Kraus operators [in] numOps the number of operators in ops
which must be >0 and <= 16.
- Exceptions
-
invalidQuESTInputError() - if
qureg
is not a density matrix - if either
target1
ortarget2
is outside of [0,qureg.numQubitsRepresented
) - if
target1
=target2
- if
numOps
is outside [1, 16] - if
ops
do not create a completely positive, trace preserving map - if a node cannot fit 16 amplitudes in distributed mode
- if
Referenced by TEST_CASE().