The Quantum Exact Simulation Toolkit v4.3.0
Loading...
Searching...
No Matches
Decoherence

Functions for effecting decoherence channels upon density matrices. More...

Functions

void mixDamping (Qureg qureg, int target, qreal prob)
 
void mixDephasing (Qureg qureg, int target, qreal prob)
 
void mixDepolarising (Qureg qureg, int target, qreal prob)
 
void mixKrausMap (Qureg qureg, int *targets, int numTargets, KrausMap map)
 
void mixPaulis (Qureg qureg, int target, qreal probX, qreal probY, qreal probZ)
 
void mixQureg (Qureg qureg, Qureg other, qreal prob)
 
void mixSuperOp (Qureg qureg, int *targets, int numTargets, SuperOp superop)
 
void mixTwoQubitDephasing (Qureg qureg, int target1, int target2, qreal prob)
 
void mixTwoQubitDepolarising (Qureg qureg, int target1, int target2, qreal prob)
 

Detailed Description

Functions for effecting decoherence channels upon density matrices.

Function Documentation

◆ mixDamping()

void mixDamping ( Qureg qureg,
int target,
qreal prob )

Applies a one-qubit amplitude damping channel upon the density matrix qureg, where prob is the probability of the target qubit relaxing to the zero state.

Formulae

Let \( \dmrho = \) qureg, \( p = \) prob and \( t = \) target.

This function effects

\[ \dmrho \; \rightarrow \; \hat{K}_t^{(1)} \dmrho \, {\hat{K}_t^{(1)}}^\dagger \,+\, \hat{K}_t^{(2)} \dmrho \, {\hat{K}_t^{(2)}}^\dagger \]

where \( \hat{K}^{(1)} \) and \( \hat{K}^{(2)} \) are one-qubit Kraus operators

\[ \hat{K}^{(1)} = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1-p} \end{pmatrix}, \;\; \hat{K}^{(2)} = \begin{pmatrix} 0 & \sqrt{p} \\ 0 & 0 \end{pmatrix}. \]

This is a physically valid operation (the channel is completely positive and trace preserving) for \( 0 \le p \le 1 \). Note however that it may actually reduce mixing and increase purity, depending on \( p \) and the qubit's initial state.

Constraints
  • Parameter prob must be a valid probability and ergo satisfy \( 0 \le p \le 1 \). Beware that disabling validation with setQuESTValidationOff() and passing prob outside this domain will result in mathematically erroneous results; amplitudes which are erroneously zero, or NaN, as output by sqrt().
Equivalences

This function is equivalent to (but much faster than):

Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]targetthe index of the target qubit.
[in]probthe probability of relaxing to zero.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix (unless prob is 0).
  • if target is an invalid qubit index.
  • if prob < 0 or prob > 1.
See also
Author
Tyson Jones

Definition at line 91 of file decoherence.cpp.

91 {
92 validate_quregFields(qureg, __func__);
93 validate_target(qureg, qubit, __func__);
94 validate_oneQubitDampingProb(prob, __func__);
95
96 // permit but do not change non-decohering statevecs
97 if (prob == 0)
98 return;
99
100 validate_quregIsDensityMatrix(qureg, __func__);
101
102 localiser_densmatr_oneQubitDamping(qureg, qubit, prob);
103}

Referenced by TEST_CASE(), and TEST_CASE().

◆ mixDephasing()

void mixDephasing ( Qureg qureg,
int target,
qreal prob )

Applies a one-qubit dephasing channel upon the density matrix qureg, where prob is the probability of a \( \hat{Z} \) error upon the target qubit.

This is also known as a phase-flip channel.

Formulae

Let \( \dmrho = \) qureg, \( p = \) prob and \( t = \) target.

This function effects

\[ \dmrho \;\rightarrow\; (1 - p) \, \dmrho \,+\, p \, \hat{Z}_t \,\dmrho\, \hat{Z}_t. \]

This is a physically valid operation (is completely positive and trace preserving) when \( 0 \le p \le 1 \), and is a meaningful noise channel (i.e. induces mixing) for \( 0 < p \le 1/2 \).

Constraints
  • Parameter prob must be a valid probability and ergo satisfy \( 0 \le p \le 1 \) unless validation is disabled via setQuESTValidationOff(), which permits quasi-probability channels with, for example, negative probabilities.
  • The maximum permitted error probability is \( p = 1/2 \) (unless validation is disabled) at which the qubit becomes completely "dephased", and the off-diagonal "coherences" become zero.
  • With validation disabled, the channel remains CPTP for \( 1/2 \le p \le 1 \).
Equivalences

This function is equivalent to (but much faster than):

Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]targetthe index of the target qubit.
[in]probthe probability of any error.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix (unless prob is 0).
  • if target is an invalid qubit index.
  • if prob < 0, or prob > 1/2.
See also
Author
Tyson Jones

Definition at line 31 of file decoherence.cpp.

31 {
32 validate_quregFields(qureg, __func__);
33 validate_target(qureg, qubit, __func__);
34 validate_oneQubitDepashingProb(prob, __func__);
35
36 // permit but do not change non-decohering statevecs
37 if (prob == 0)
38 return;
39
40 validate_quregIsDensityMatrix(qureg, __func__);
41
42 localiser_densmatr_oneQubitDephasing(qureg, qubit, prob);
43}

Referenced by TEST_CASE(), and TEST_CASE().

◆ mixDepolarising()

void mixDepolarising ( Qureg qureg,
int target,
qreal prob )

Applies a one-qubit homogeneous depolarising channel upon the density matrix qureg, where prob is the probability of any error upon the target qubit.

Formulae

Let \( \dmrho = \) qureg, \( p = \) prob and \( t = \) target.

This function effects

\[ \dmrho \;\rightarrow\; (1 - p) \, \dmrho \,+\, \frac{p}{3} \left( \hat{X}_t \dmrho \hat{X}_t \,+\, \hat{Y}_t \dmrho \hat{Y}_t \,+\, \hat{Z}_t \dmrho \hat{Z}_t \right). \]

This is a physically valid operation (is completely positive and trace preserving) when \( 0 \le p \le 1 \), and is a meaningful noise channel (i.e. induces mixing) for \( 0 < p \le 3/4 \).

Constraints
  • Parameter prob must be a valid probability and ergo satisfy \( 0 \le p \le 1 \) unless validation is disabled via setQuESTValidationOff(), which permits quasi-probability channels with, for example, negative probabilities.
  • The maximum permitted error probability is \( p = 3/4 \) (unless validation is disabled), at which the channel is maximum strength, and the qubit enters the maximally mixed state.
  • With validation disabled, the channel remains CPTP for \( 3/4 \le p \le 1 \).
Equivalences

This function is equivalent to (but much faster than):

  • mixPaulis() with a uniform probability.
    mixPaulis(qureg, target, prob/3, prob/3, prob/3);
  • mixKrausMap() with (scaled) \(\hat{\id}\), \(\hat{X}\), \(\hat{Y}\) and \(\hat{Z}\) Kraus operators.
    qreal a = sqrt(1-prob);
    qreal b = sqrt(prob/3);
    KrausMap map = createInlineKrausMap(1, 4, {
    {{a,0},{0, a}}, // a * I
    {{0,b},{b, 0}}, // b * X
    {{b,0},{0,-b}}, // b * Z
    {{0,-1i*b},{1i*b,0}}, // b * Y
    });
    mixKrausMap(qureg, &target, 1, map);
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]targetthe index of the target qubit.
[in]probthe probability of any error.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix (unless prob is 0).
  • if target is an invalid qubit index.
  • if prob < 0, or prob > 3/4.
See also
Author
Tyson Jones

Definition at line 61 of file decoherence.cpp.

61 {
62 validate_quregFields(qureg, __func__);
63 validate_target(qureg, qubit, __func__);
64 validate_oneQubitDepolarisingProb(prob, __func__);
65
66 // permit but do not change non-decohering statevecs
67 if (prob == 0)
68 return;
69
70 validate_quregIsDensityMatrix(qureg, __func__);
71
72 localiser_densmatr_oneQubitDepolarising(qureg, qubit, prob);
73}

Referenced by TEST_CASE(), and TEST_CASE().

◆ mixKrausMap()

void mixKrausMap ( Qureg qureg,
int * targets,
int numTargets,
KrausMap map )

Applies a general, any-size channel described as a Kraus map upon the density matrix qureg.

Formulae

Let \( \dmrho = \) qureg, \( \vec{t} = \) targets and \( \hat{K}^{(i)} \) denote the \(i\)-th Kraus operator in map.

This function effects

\[ \dmrho \; \rightarrow \; \sum\limits_i \hat{K}_{\vec{t}}^{(i)} \dmrho \, {\hat{K}_{\vec{t}}^{(i)}}^\dagger. \]

The channel is completely positive and trace preserving (CPTP) when the Kraus operators satisfy

\[ \sum\limits_i {\hat{K}_{\vec{t}}^{(i)}}^\dagger \hat{K}_{\vec{t}}^{(i)} = \mathbb{1}. \]

Constraints
  • The number of channel targets numTargets must agree with the size of the Kraus map.
  • The channel must be approximately CPTP, such that difference between \( \sum\limits_i {\hat{K}_{\vec{t}}^{(i)}}^\dagger \hat{K}_{\vec{t}}^{(i)} \) and \( \mathbb{1} \) has no element of absolute value greater than the validation epsilon \( \valeps \). This can be adjusted with setQuESTValidationEpsilon(), and relaxed entirely by setting \( \valeps = 0 \).
  • When qureg is distributed, each node must contain at least pow(2,2*numTargets) many amplitudes, to ensure sufficient communication buffers are allocated.
Equivalences

This function calls mixSuperOp(), passing the corresponding superoperator of map, which has the form

\[ \hat{S} = \sum\limits_i {\hat{K}_{\vec{t}}^{(i)}}^* \otimes \hat{K}_{\vec{t}}^{(i)}. \]

Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]targetsthe list of target qubit indices.
[in]numTargetsthe length of targets
[in]mapa compatible-sized KrausMap.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix.
  • if targets contains a duplicate or invalid qubit index.
  • if numTargets is less than one, or exceeds the size of qureg.
  • if map is not initialised.
  • if map contains a different number of qubits than numTargets.
  • if map is not CPTP.
  • if qureg is distributed and numTargets exceeds the number of qubits in qureg minus half log-2 of the number of processes.
See also
Author
Tyson Jones

Definition at line 121 of file decoherence.cpp.

121 {
122 validate_quregFields(qureg, __func__);
123 validate_quregIsDensityMatrix(qureg, __func__);
124 validate_targets(qureg, qubits, numQubits, __func__);
125 validate_mixedAmpsFitInNode(qureg, 2*numQubits, __func__); // superop acts on 2x
126 validate_krausMapIsCPTP(map, __func__); // also checks fields and is-sync
127 validate_krausMapMatchesTargets(map, numQubits, __func__);
128
129 localiser_densmatr_krausMap(qureg, map, lists_getList64(qubits, numQubits));
130}

Referenced by mixKrausMap(), and TEST_CASE().

◆ mixPaulis()

void mixPaulis ( Qureg qureg,
int target,
qreal probX,
qreal probY,
qreal probZ )

Applies a one-qubit inhomogeneous Pauli channel upon the density matrix qureg.

This is a generalisation of mixDepolarising(), permitting inhomogeneous error probabilities.

Formulae

Let \( \dmrho = \) qureg, \( t = \) target, and \( p_x = \) probX, \( p_y = \) probY, \( p_z = \) probZ.

This function effects

\[ \dmrho \;\rightarrow\; (1 - p) \, \dmrho \,+\, p_x \, \hat{X}_t \dmrho \hat{X}_t \,+\, p_y \, \hat{Y}_t \dmrho \hat{Y}_t \,+\, p_z \, \hat{Z}_t \dmrho \hat{Z}_t. \]

This operation is physically valid (completely positive and trace preserving) when each probability is valid ( \( 0 \le p_i \le 1 \)), and together satisfy

\[ p_x + p_y + p_z \le 1. \]

The operation is a meaningful noise channel (decreases purity) when the probabilities are below that which induces maximal mixing; when the probability of no error is greater than (or equal to) the probability of any error.

\[ 1 - (p_x + p_y + p_z) \ge \max(p_x, p_y, p_z). \]

Constraints
  • Each of probX, probY, and probZ must be a valid probability, i.e. \( 0 \le p_i \le 1 \), and the probability of no error (one minus their sum) must also be valid. This particular validation is insensitive to the validation epsilon as controlled with setQuESTValidationEpsilon(), but can instead be relaxed with setQuESTValidationOff(), to effect channels which are not completely-positive and trace-preserving, such as quasi-probability channels.
  • The channel strength must not exceed that which induces maximal mixing (unless validation is disabled), whereby the probability of any particular error equals that of no error, as discussed above.
Equivalences

This function is equivalent to (but much faster than):

  • mixKrausMap() with (scaled) \(\hat{\id}\), \(\hat{X}\), \(\hat{Y}\) and \(\hat{Z}\) Kraus operators.
    qreal a = sqrt(1-probX-probY-probZ);
    qreal b = sqrt(probX);
    qreal c = sqrt(probY);
    qreal d = sqrt(probZ);
    KrausMap map = createInlineKrausMap(1, 4, {
    {{a,0},{0, a}}, // a * I
    {{0,b},{b, 0}}, // b * X
    {{d,0},{0,-d}}, // d * Z
    {{0,-1i*c},{1i*c,0}}, // c * Y
    });
    mixKrausMap(qureg, &target, 1, map);
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]targetthe index of the target qubit.
[in]probXthe probability of an X operator upon target.
[in]probYthe probability of an Y operator upon target.
[in]probZthe probability of an Z operator upon target.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix (unless probX = probY = probZ = 0).
  • if target is an invalid qubit index.
  • if any probability is invalid (below zero or above one).
  • if the probability of any error exceeds that of no error.
See also
Author
Tyson Jones

Definition at line 106 of file decoherence.cpp.

106 {
107 validate_quregFields(qureg, __func__);
108 validate_target(qureg, qubit, __func__);
109 validate_oneQubitPauliChannelProbs(probX, probY, probZ, __func__);
110
111 // permit but do not change non-decohering statevecs
112 if (probX == 0 && probY == 0 && probZ == 0)
113 return;
114
115 validate_quregIsDensityMatrix(qureg, __func__);
116
117 localiser_densmatr_oneQubitPauliChannel(qureg, qubit, probX, probY, probZ);
118}

Referenced by TEST_CASE().

◆ mixQureg()

void mixQureg ( Qureg qureg,
Qureg other,
qreal prob )

Modifies the density matrix qureg to the mixture of itself and the density matrix or statevector other.

Formulae

Let \( \dmrho_1 = \) qureg and \( p = \) prob.

  • When other is a density matrix \( \dmrho_2 \), this function effects

    \[ \dmrho_1 \;\rightarrow \; (1 - p) \, \dmrho_1 \,+\, p \, \dmrho_2. \]

  • When other is a statevector \( \ket{\psi_2} \), this function effects

    \[ \dmrho_1 \;\rightarrow \; (1 - p) \, \dmrho_1 \,+\, p \, \ketbra{\psi_2}{\psi_2}. \]

Constraints
  • Parameter prob must be a valid probability, satisfying \( 0 \le p \le 1 \), though can be relaxed to any real scalar by disabling validation with setQuESTValidationOff().
  • qureg and other must contain the same number of qubits.
  • If other is a density matrix, it must be identically distributed to qureg (although the parallelisation backends, like multithreading and GPU acceleration, are permitted to differ).
  • If other is a statevector and qureg is not distributed, neither too must other.
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]otherthe density matrix or statevector to mix into qureg.
[in]probthe coefficient of other in the mixture.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix.
  • if qureg and other contain a different number of qubits.
  • if prob is not a valid probability.
  • if other is a density matrix which is differently distributed to qureg.
  • if other is a distributed statevector, but qureg is not distributed.
See also
Author
Tyson Jones

Definition at line 133 of file decoherence.cpp.

133 {
134 validate_quregFields(outQureg, __func__);
135 validate_quregFields(inQureg, __func__);
136 validate_probability(inProb, __func__);
137 validate_quregPairCanBeMixed(outQureg, inQureg, __func__); // checks outQureg is densmatr
138
139 qreal outProb = 1 - inProb;
140 localiser_densmatr_mixQureg(outProb, outQureg, inProb, inQureg);
141}

Referenced by TEST_CASE().

◆ mixSuperOp()

void mixSuperOp ( Qureg qureg,
int * targets,
int numTargets,
SuperOp superop )

Applies a superoperator upon the linearised density matrix qureg, where targets span the ket space.

Formulae

Let \( \dmrho = \) qureg contain \(N\) qubits, with amplitudes \( \alpha_{ij} \).

\[ \dmrho = \sum\limits_i^{2^N} \sum\limits_j^{2^N} \alpha_{ij} \ket{i}\bra{j}. \]

Internally, this matrix of dimension \( 2^N \times 2^N \) is stored in a vectorised form \( \ket{\rho} \) of dimension \( 2^{2N} \times 1 \), which concatenates the columns of \( \dmrho \).

\[ \begin{aligned} \ket{\rho} &= \sum\limits_i^{2^N} \sum\limits_j^{2^N} \alpha_{ij} \ket{j} \ket{i} \\ &= \sum\limits_k^{2^{2N}} \beta_k \ket{k} \end{aligned} \]

This resembles an unnormalised statevector of twice as many qubits as \( \dmrho \), whereby operators are left- and right-multiplied as

\[ \ket{ \hat{A} \, \rho \, \hat{B} } = \hat{B}^T\otimes \hat{A} \ket{\rho}. \]

Let \( \vec{t} = \) targets, \( n = \) numTargets, and let \( \hat{S} = \) superop. The \(n\)-qubit superoperator \(\hat{S}\) is a \( 2^{2n} \times 2^{2n} \) complex matrix which operates upon both the ket and bra partitions of the linearised density matrix \(\ket{\rho}\).

The targets \(\vec{t}\) are treated as the ket qubits, specified in order of increasing significance, where the first qubit corresponds to the rightmost partition of the matrix \(\hat{S}\). Concretely, let \(\vec{t}+N\) notate the list of indices obtained by adding \(N\) to every element of \(\vec{t}\), and let \((\vec{t} \cup \vec{t}+N)\) the result of concatenating this new list with \(\vec{t}\). Then, this function effects

\[ \ket{\rho} \rightarrow \hat{S}_{(\vec{t} \cup \vec{t}+N)} \ket{\rho}, \]

which is mathematically identical to left-applying the \(2n\)-qubit matrix \(\hat{S}\) upon a \(2N\)-qubit statevector \(\ket{\rho}\).

See mixKrausMap() for an example of the construction of \(\hat{S}\).

Constraints
  • There is no requirement nor validation that superop is CPTP, and so is permitted to break state normalisation and interpretability.
  • The number of targets must agree with the number of qubits upon which superop acts.
  • When qureg is distributed, each node must contain at least pow(2,2*numTargets) many amplitudes, to ensure sufficient communication buffers are allocated.
Equivalences

This function is equivalent to calling leftapplyCompMatr() upon qureg, having prepared superop as a CompMatr, and passing a target list prepared as \((\vec{t} \cup \vec{t}+N)\) above.

Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]targetsthe list of target qubit indices.
[in]numTargetsthe length of targets
[in]superopa compatible-sized SuperOp.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix.
  • if targets contains a duplicate or invalid qubit index.
  • if numTargets is less than one, or exceeds the size of qureg.
  • if superop is not initialised, or not sync'ed (e.g. via syncSuperOp()).
  • if superop contains a different number of qubits than numTargets.
  • if qureg is distributed and numTargets exceeds the number of qubits in qureg minus half log-2 of the number of processes.
See also
Author
Tyson Jones

Definition at line 144 of file decoherence.cpp.

144 {
145 validate_quregFields(qureg, __func__);
146 validate_targets(qureg, targets, numTargets, __func__);
147 validate_superOpFields(superop, __func__);
148 validate_superOpIsSynced(superop, __func__);
149 validate_superOpDimMatchesTargs(superop, numTargets, __func__);
150 validate_mixedAmpsFitInNode(qureg, 2*numTargets, __func__); // superop acts on 2x
151
152 localiser_densmatr_superoperator(qureg, superop, lists_getList64(targets, numTargets));
153}

Referenced by mixSuperOp(), and TEST_CASE().

◆ mixTwoQubitDephasing()

void mixTwoQubitDephasing ( Qureg qureg,
int target1,
int target2,
qreal prob )

Applies a two-qubit dephasing channel upon the density matrix qureg, where prob is the probability of a \( \hat{Z} \) error upon either or both of qubits target1 and target2, which are interchangeable.

Formulae

Let \( \dmrho = \) qureg, \( p = \) prob, \( t_1 = \) target1 and \( t_2 = \) target2.

This function effects

\[ \dmrho \;\rightarrow\; (1 - p) \, \dmrho \,+\, \frac{p}{3} \left( \hat{Z}_{t_1} \dmrho \hat{Z}_{t_1} \,+\, \hat{Z}_{t_2} \dmrho \hat{Z}_{t_2} \,+\, \hat{Z}_{t_1} \hat{Z}_{t_2} \dmrho \hat{Z}_{t_1} \hat{Z}_{t_2} \right). \]

This is a physically valid operation (is completely positive and trace preserving) when \( 0 \le p \le 1 \), and is a meaningful noise channel (i.e. induces mixing) for \( 0 < p \le 3/4 \).

Constraints
  • Parameter prob must be a valid probability and ergo satisfy \( 0 \le p \le 1 \) unless validation is disabled via setQuESTValidationOff(), which permits quasi-probability channels with, for example, negative probabilities.
  • The maximum permitted error probability is \( p = 3/4 \) (unless validation is disabled), at which the channel is "maximum strength" and the off-diagonal "coherences" of the two qubits become zero.
  • With validation disabled, the channel remains CPTP for \( 3/4 \le p \le 1 \).
Equivalences

This function is equivalent to (but much faster than):

  • mixKrausMap() with (scaled) \(\hat{\id}\otimes\hat{\id}\), \(\hat{\id}\otimes\hat{Z}\), \(\hat{Z}\otimes\hat{\id}\) and \(\hat{Z}\otimes\hat{Z}\) Kraus operators.
    qreal a = sqrt(1-prob);
    qreal b = sqrt(prob/3);
    KrausMap map = createInlineKrausMap(2, 4, {
    {{a,0,0,0},{0, a,0,0},{0,0, a,0},{0,0,0, a}}, // a * II
    {{b,0,0,0},{0,-b,0,0},{0,0, b,0},{0,0,0,-b}}, // b * IZ
    {{b,0,0,0},{0, b,0,0},{0,0,-b,0},{0,0,0,-b}}, // b * ZI
    {{b,0,0,0},{0,-b,0,0},{0,0,-b,0},{0,0,0, b}} // b * ZZ
    });
    int targets[] = {target1, target2};
    mixKrausMap(qureg, targets, 2, map);
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]target1the index of the first target qubit.
[in]target2the index of the second target qubit.
[in]probthe probability of any error.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix (unless prob is 0).
  • if target1 or target2 is an invalid qubit index, or are the same.
  • if prob < 0, or prob > 3/4.
See also
Author
Tyson Jones

Definition at line 46 of file decoherence.cpp.

46 {
47 validate_quregFields(qureg, __func__);
48 validate_twoTargets(qureg, qubit1, qubit2, __func__);
49 validate_twoQubitDepashingProb(prob, __func__);
50
51 // permit but do not change non-decohering statevecs
52 if (prob == 0)
53 return;
54
55 validate_quregIsDensityMatrix(qureg, __func__);
56
57 localiser_densmatr_twoQubitDephasing(qureg, qubit1, qubit2, prob);
58}

Referenced by TEST_CASE(), and TEST_CASE().

◆ mixTwoQubitDepolarising()

void mixTwoQubitDepolarising ( Qureg qureg,
int target1,
int target2,
qreal prob )

Applies a two-qubit homogeneous depolarising channel upon the density matrix qureg, where prob is the probability of any error upon either or both of qubits target1 and target2, which are interchangeable.

Formulae

Let \( \dmrho = \) qureg, \( p = \) prob, \( t_1 = \) target1 and \( t_2 = \) target2.

This function effects:

\[ \dmrho \; \rightarrow \; (1 - p) \dmrho + \frac{p}{15} \left( \sum_{\hat{\sigma} \in \{\hat{\id},\hat{X},\hat{Y},\hat{Z}\}} \sum_{\hat{\sigma}' \in \{\hat{\id},\hat{X},\hat{Y},\hat{Z}\}} \hat{\sigma}_{t_1} \hat{\sigma}_{t_2}' \; \dmrho \; \hat{\sigma}_{t_1} \hat{\sigma}_{t_2}' \right) - \frac{p}{15} \hat{\id}_{t_1} \hat{\id}_{t_2} \dmrho \hat{\id}_{t_1} \hat{\id}_{t_2}, \]

or verbosely:

\[ \dmrho \; \rightarrow \; (1 - p) \, \rho + \frac{p}{15} \; \left( \begin{gathered} \hat{X}_{t_1} \, \rho \, \hat{X}_{t_1} + \hat{Y}_{t_1} \, \rho \, \hat{Y}_{t_1} + \hat{Z}_{t_1} \, \rho \, \hat{Z}_{t_1} + \\ \hat{X}_{t_2} \, \rho \, \hat{X}_{t_2} + \hat{Y}_{t_2} \, \rho \, \hat{Y}_{t_2} + \hat{Z}_{t_2} \, \rho \, \hat{Z}_{t_2} + \\ \hat{X}_{t_1} \hat{X}_{t_2} \, \rho \, \hat{X}_{t_1} \hat{X}_{t_2} + \hat{Y}_{t_1} \hat{Y}_{t_2} \, \rho \, \hat{Y}_{t_1} \hat{Y}_{t_2} + \hat{Z}_{t_1} \hat{Z}_{t_2} \, \rho \, \hat{Z}_{t_1} \hat{Z}_{t_2} + \\ \hat{X}_{t_1} \hat{Y}_{t_2} \, \rho \, \hat{X}_{t_1} \hat{Y}_{t_2} + \hat{Y}_{t_1} \hat{Z}_{t_2} \, \rho \, \hat{Y}_{t_1} \hat{Z}_{t_2} + \hat{Z}_{t_1} \hat{X}_{t_2} \, \rho \, \hat{Z}_{t_1} \hat{X}_{t_2} + \\ \hat{X}_{t_1} \hat{Z}_{t_2} \, \rho \, \hat{X}_{t_1} \hat{Z}_{t_2} + \hat{Y}_{t_1} \hat{X}_{t_2} \, \rho \, \hat{Y}_{t_1} \hat{X}_{t_2} + \hat{Z}_{t_1} \hat{Y}_{t_2} \, \rho \, \hat{Z}_{t_1} \hat{Y}_{t_2} \end{gathered} \right). \]

This is a physically valid operation (is completely positive and trace preserving) when \( 0 \le p \le 1 \), and is a meaningful noise channel (i.e. induces mixing) for \( 0 < p \le 15/16 \).

Constraints
  • Parameter prob must be a valid probability and ergo satisfy \( 0 \le p \le 1 \) unless validation is disabled via setQuESTValidationOff(), which permits quasi-probability channels with, for example, negative probabilities.
  • The maximum permitted error probability is \( p = 15/16 \) (unless validation is disabled), at which the channel is maximum strength, and the target qubits become maximally mixed.
  • With validation disabled, the channel remains CPTP for \( 15/16 \le p \le 1 \).
Equivalences

This function is equivalent to (but much faster than):

  • mixKrausMap() with Kraus operators containing every possible tensor product of two Pauli matrices, all scaled by \( (p/15)^{1/2} \), except for \( \hat{\id} \otimes \hat{\id} \) which is scaled by \( (1-16p/15)^{1/2} \).
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Parameters
[in,out]quregthe density matrix to modify.
[in]target1the index of the first target qubit.
[in]target2the index of the second target qubit.
[in]probthe probability of any error.
Exceptions
error
  • if qureg is not initialised.
  • if qureg is not a density matrix (unless prob is 0).
  • if target1 or target2 is an invalid qubit index, or are the same.
  • if prob < 0, or prob > 15/16.
See also
Author
Tyson Jones

Definition at line 76 of file decoherence.cpp.

76 {
77 validate_quregFields(qureg, __func__);
78 validate_twoTargets(qureg, qubit1, qubit2, __func__);
79 validate_twoQubitDepolarisingProb(prob, __func__);
80
81 // permit but do not change non-decohering statevecs
82 if (prob == 0)
83 return;
84
85 validate_quregIsDensityMatrix(qureg, __func__);
86
87 localiser_densmatr_twoQubitDepolarising(qureg, qubit1, qubit2, prob);
88}

Referenced by TEST_CASE(), and TEST_CASE().