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, (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 | 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
= into the mixed state
where q = targetQubit
and and are Kraus operators
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
Definition at line 1283 of file QuEST.c.
References densmatr_mixDamping(), validateDensityMatrQureg(), validateOneQubitDampingProb(), and validateTarget().
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
Definition at line 1012 of file QuEST.c.
References densmatr_mixDensityMatrix(), validateDensityMatrQureg(), validateMatchingQuregDims(), and validateProb().
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
= into the mixed state
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
Definition at line 1250 of file QuEST.c.
References densmatr_mixDephasing(), qasm_recordComment(), validateDensityMatrQureg(), validateOneQubitDephaseProb(), and validateTarget().
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
= into the mixed state
where q = targetQubit
. prob
cannot exceed 3/4, at which maximal mixing occurs. The produced state is equivalently expressed as
where 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
Definition at line 1272 of file QuEST.c.
References densmatr_mixDepolarising(), qasm_recordComment(), validateDensityMatrQureg(), validateOneQubitDepolProb(), and validateTarget().
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, (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
The Kraus map must be completely positive and trace preserving, which constrains each in ops
by
where is the identity matrix.
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
Definition at line 1314 of file QuEST.c.
References densmatr_mixKrausMap(), qasm_recordComment(), validateDensityMatrQureg(), validateOneQubitKrausMap(), and validateTarget().
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 in ops
by
where is the identity matrix.
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.
- 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
Definition at line 1334 of file QuEST.c.
References densmatr_mixMultiQubitKrausMap(), qasm_recordComment(), validateDensityMatrQureg(), validateMultiQubitKrausMap(), and validateMultiTargets().
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
= into the mixed state
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
Definition at line 1303 of file QuEST.c.
References densmatr_mixPauli(), qasm_recordComment(), validateDensityMatrQureg(), validateOneQubitPauliProbs(), and validateTarget().
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
= into the mixed state
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
Definition at line 1260 of file QuEST.c.
References densmatr_mixTwoQubitDephasing(), ensureIndsIncrease(), qasm_recordComment(), validateDensityMatrQureg(), validateTwoQubitDephaseProb(), and validateUniqueTargets().
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 . Note this is the set of all two-qubit Pauli gates excluding .
This transforms qureg
= into the mixed state
or verbosely
where a = qubit1
, b = qubit2
.
prob
cannot exceed 15/16, at which maximal mixing occurs.
The produced state is equivalently expressed as
where 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
Definition at line 1291 of file QuEST.c.
References densmatr_mixTwoQubitDepolarising(), ensureIndsIncrease(), qasm_recordComment(), validateDensityMatrQureg(), validateTwoQubitDepolProb(), and validateUniqueTargets().
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 in ops
by
where is the identity matrix.
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
Definition at line 1324 of file QuEST.c.
References densmatr_mixTwoQubitKrausMap(), qasm_recordComment(), validateDensityMatrQureg(), validateMultiTargets(), and validateTwoQubitKrausMap().
Referenced by TEST_CASE().