The Quantum Exact Simulation Toolkit v4.0.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 )
Note
Documentation for this function or struct is under construction!
Formulae
Let \( \dmrho = \) qureg, \( p = \) prob and \( t = \) target.

This function effects

\[ \dmrho \; \rightarrow \; \hat{K}_t^{(1)} \dmrho \, {\hat{K}_t^{(2)}}^\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}^{(1)} = \begin{pmatrix} 0 & \sqrt{p} \\ 0 & 0 \end{pmatrix}. \]

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!

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 )
Note
Documentation for this function or struct is under construction!
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. \]

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!

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 )
Note
Documentation for this function or struct is under construction!
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). \]

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);
    {{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!

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 )
Note
Documentation for this function or struct is under construction!
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 \]

Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!

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, util_getVector(qubits, numQubits));
130}

Referenced by mixKrausMap(), and TEST_CASE().

◆ mixPaulis()

void mixPaulis ( Qureg qureg,
int target,
qreal probX,
qreal probY,
qreal probZ )
Note
Documentation for this function or struct is under construction!
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. \]

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);
    {{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!

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 )
Note
Documentation for this function or struct is under construction!
Formulae
Let \( \dmrho_1 = \) qureg, \( \dmrho_2 = \) other and \( p = \) prob.

This function effects

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

Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!

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_quregsCanBeMixed(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 )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!

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, util_getVector(targets, numTargets));
153}

Referenced by mixSuperOp(), and TEST_CASE().

◆ mixTwoQubitDephasing()

void mixTwoQubitDephasing ( Qureg qureg,
int target1,
int target2,
qreal prob )
Note
Documentation for this function or struct is under construction!
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_1} \dmrho \hat{Z}_{t_1} \,+\, \hat{Z}_{t_1} \hat{Z}_{t_2} \dmrho \hat{Z}_{t_1} \hat{Z}_{t_2} \right). \]

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);
    {{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!

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 )
Note
Documentation for this function or struct is under construction!
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{Z}_{t_2} + \hat{Z}_{t_1} \hat{Y}_{t_2} \, \rho \, \hat{Z}_{t_1} \hat{Y}_{t_2} \end{gathered} \right). \]

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!

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().