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 qubit, qreal prob)
 
void mixDephasing (Qureg qureg, int qubit, qreal prob)
 
void mixDepolarising (Qureg qureg, int qubit, qreal prob)
 
void mixKrausMap (Qureg qureg, int *targets, int numTargets, KrausMap map)
 
void mixKrausMap (Qureg qureg, std::vector< int > targets, KrausMap map)
 
void mixPaulis (Qureg qureg, int qubit, 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 mixSuperOp (Qureg qureg, std::vector< int > targets, SuperOp superop)
 
void mixTwoQubitDephasing (Qureg qureg, int qubit1, int qubit2, qreal prob)
 
void mixTwoQubitDepolarising (Qureg qureg, int qubit1, int qubit2, qreal prob)
 

Detailed Description

Functions for effecting decoherence channels upon density matrices.

Function Documentation

◆ mixDamping()

void mixDamping ( Qureg qureg,
int qubit,
qreal prob )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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 qubit,
qreal prob )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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 qubit,
qreal prob )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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() [1/2]

void mixKrausMap ( Qureg qureg,
int * targets,
int numTargets,
KrausMap map )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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().

◆ mixKrausMap() [2/2]

void mixKrausMap ( Qureg qureg,
std::vector< int > targets,
KrausMap map )
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!
Remarks
This function is only available in C++.

Definition at line 171 of file decoherence.cpp.

171 {
172 mixKrausMap(qureg, targets.data(), targets.size(), map);
173}
void mixKrausMap(Qureg qureg, int *qubits, int numQubits, KrausMap map)

◆ mixPaulis()

void mixPaulis ( Qureg qureg,
int qubit,
qreal probX,
qreal probY,
qreal probZ )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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!
Attention
This function's input validation has not yet been 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() [1/2]

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

◆ mixSuperOp() [2/2]

void mixSuperOp ( Qureg qureg,
std::vector< int > targets,
SuperOp superop )
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!
Remarks
This function is only available in C++.

Definition at line 175 of file decoherence.cpp.

175 {
176 mixSuperOp(qureg, targets.data(), targets.size(), superop);
177}
void mixSuperOp(Qureg qureg, int *targets, int numTargets, SuperOp superop)

◆ mixTwoQubitDephasing()

void mixTwoQubitDephasing ( Qureg qureg,
int qubit1,
int qubit2,
qreal prob )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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 qubit1,
int qubit2,
qreal prob )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been 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().