@@ -69,15 +69,17 @@ extern "C" {
69
69
* which case the imaginary component of the above expression is neglected.
70
70
* The full complex value can be obtained using calcExpecNonHermitianPauliStrSum().
71
71
*
72
- * @equivalence
72
+ * @equivalences
73
73
* - When @p str is general, this function is equivalent to calling calcExpecPauliStrSum() with a
74
74
* PauliStrSum composed of only a single PauliStr term and a unity coefficient.
75
75
* - When @p str @f$ = \id^\otimes @f$, the output is equivalent to that of calcTotalProb().
76
76
*
77
77
* @myexample
78
78
* ```
79
- Qureg qureg = createQureg(4);
80
- PauliStr str = getPauliStr("XYZ");
79
+ Qureg qureg = createQureg(10);
80
+ initRandomPureState(qureg);
81
+
82
+ PauliStr str = getInlinePauliStr("XYZ", {0,2,3});
81
83
82
84
qreal expec = calcExpecPauliStr(qureg, str);
83
85
reportScalar("expec", expec);
@@ -89,11 +91,11 @@ extern "C" {
89
91
* @param[in] qureg the reference state.
90
92
* @param[in] str the observable operator.
91
93
* @returns The real component of the expectation value.
92
- * @throws invalidQuESTInputError()
94
+ * @throws @validationerror
93
95
* - if @p qureg is uninitialised.
94
96
* - if @p str contains a (non-identity) Pauli upon a higher-index qubit than exists in @p qureg.
95
97
* - if the output (with unreturned imaginary component) is not approximately real.
96
- * @notvalidated
98
+ * @notyetvalidated
97
99
* @author Tyson Jones
98
100
*/
99
101
qreal calcExpecPauliStr (Qureg qureg, PauliStr str);
@@ -125,7 +127,7 @@ qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
125
127
* Hermiticity validation is relaxed and/or @p qureg is an unnormalised density matrix.
126
128
* The full complex value can be obtained using calcExpecNonHermitianPauliStrSum().
127
129
*
128
- * @equivalence
130
+ * @equivalences
129
131
* - This function is mathematically equivalent to (albeit faster than) calling calcExpecPauliStr() upon
130
132
* each constituent @p PauliStr within @p sum, weighting each by its corresponding coefficient, and
131
133
* summing the outputs.
@@ -145,15 +147,16 @@ qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
145
147
qreal expec = calcExpecPauliStrSum(qureg, sum);
146
148
reportScalar("expec", expec);
147
149
* ```
150
+ *
148
151
* @param[in] qureg the reference state.
149
152
* @param[in] sum the observable operator.
150
153
* @returns The real component of the expectation value.
151
- * @throws invalidQuESTInputError()
154
+ * @throws @validationerror
152
155
* - if @p qureg or @p sum are uninitialised.
153
156
* - if any PauliStr in @p sum targets a higher-index qubit than exists in @p qureg.
154
157
* - if @p sum is not approximately Hermitian.
155
158
* - if the output (with unreturned imaginary component) is not approximately real.
156
- * @notvalidated
159
+ * @notyetvalidated
157
160
* @see
158
161
* - calcExpecNonHermitianPauliStrSum()
159
162
* - calcExpecFullStateDiagMatr()
@@ -162,13 +165,13 @@ qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
162
165
qreal calcExpecPauliStrSum (Qureg qureg, PauliStrSum sum);
163
166
164
167
165
- // / @notdoced
166
- // / @notvalidated
168
+ // / @notyetdoced
169
+ // / @notyetvalidated
167
170
qreal calcExpecFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matr);
168
171
169
172
170
- // / @notdoced
171
- // / @notvalidated
173
+ // / @notyetdoced
174
+ // / @notyetvalidated
172
175
qreal calcExpecFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matr, qreal exponent);
173
176
174
177
@@ -183,23 +186,23 @@ qreal calcExpecFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matr, qreal
183
186
*/
184
187
185
188
186
- // / @notdoced
187
- // / @notvalidated
189
+ // / @notyetdoced
190
+ // / @notyetvalidated
188
191
qreal calcProbOfBasisState (Qureg qureg, qindex index);
189
192
190
193
191
- // / @notdoced
192
- // / @notvalidated
194
+ // / @notyetdoced
195
+ // / @notyetvalidated
193
196
qreal calcProbOfQubitOutcome (Qureg qureg, int qubit, int outcome);
194
197
195
198
196
- // / @notdoced
197
- // / @notvalidated
199
+ // / @notyetdoced
200
+ // / @notyetvalidated
198
201
qreal calcProbOfMultiQubitOutcome (Qureg qureg, int * qubits, int * outcomes, int numQubits);
199
202
200
203
201
- // / @notdoced
202
- // / @notvalidated
204
+ // / @notyetdoced
205
+ // / @notyetvalidated
203
206
void calcProbsOfAllMultiQubitOutcomes (qreal* outcomeProbs, Qureg qureg, int * qubits, int numQubits);
204
207
205
208
@@ -214,13 +217,13 @@ void calcProbsOfAllMultiQubitOutcomes(qreal* outcomeProbs, Qureg qureg, int* qub
214
217
*/
215
218
216
219
217
- // / @notdoced
218
- // / @notvalidated
220
+ // / @notyetdoced
221
+ // / @notyetvalidated
219
222
qreal calcTotalProb (Qureg qureg);
220
223
221
224
222
- // / @notdoced
223
- // / @notvalidated
225
+ // / @notyetdoced
226
+ // / @notyetvalidated
224
227
qreal calcPurity (Qureg qureg);
225
228
226
229
@@ -235,12 +238,12 @@ qreal calcPurity(Qureg qureg);
235
238
*/
236
239
237
240
238
- // / @notdoced
239
- // / @notvalidated
241
+ // / @notyetdoced
242
+ // / @notyetvalidated
240
243
qreal calcFidelity (Qureg qureg, Qureg other);
241
244
242
- // / @notdoced
243
- // / @notvalidated
245
+ // / @notyetdoced
246
+ // / @notyetvalidated
244
247
qreal calcDistance (Qureg qureg1, Qureg qureg2);
245
248
246
249
@@ -255,13 +258,13 @@ qreal calcDistance(Qureg qureg1, Qureg qureg2);
255
258
*/
256
259
257
260
258
- // / @notdoced
259
- // / @notvalidated
261
+ // / @notyetdoced
262
+ // / @notyetvalidated
260
263
Qureg calcPartialTrace (Qureg qureg, int * traceOutQubits, int numTraceQubits);
261
264
262
265
263
- // / @notdoced
264
- // / @notvalidated
266
+ // / @notyetdoced
267
+ // / @notyetvalidated
265
268
Qureg calcReducedDensityMatrix (Qureg qureg, int * retainQubits, int numRetainQubits);
266
269
267
270
@@ -292,26 +295,26 @@ Qureg calcReducedDensityMatrix(Qureg qureg, int* retainQubits, int numRetainQubi
292
295
293
296
294
297
// / @ingroup calc_comparisons
295
- // / @notdoced
296
- // / @notvalidated
298
+ // / @notyetdoced
299
+ // / @notyetvalidated
297
300
qcomp calcInnerProduct (Qureg qureg1, Qureg qureg2);
298
301
299
302
300
303
// / @ingroup calc_expec
301
- // / @notdoced
302
- // / @notvalidated
304
+ // / @notyetdoced
305
+ // / @notyetvalidated
303
306
qcomp calcExpecNonHermitianPauliStrSum (Qureg qureg, PauliStrSum sum);
304
307
305
308
306
309
// / @ingroup calc_expec
307
- // / @notdoced
308
- // / @notvalidated
310
+ // / @notyetdoced
311
+ // / @notyetvalidated
309
312
qcomp calcExpecNonHermitianFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matr);
310
313
311
314
312
315
// / @ingroup calc_expec
313
- // / @notdoced
314
- // / @notvalidated
316
+ // / @notyetdoced
317
+ // / @notyetvalidated
315
318
qcomp calcExpecNonHermitianFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent);
316
319
317
320
@@ -330,34 +333,38 @@ qcomp calcExpecNonHermitianFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr
330
333
331
334
332
335
// / @ingroup calc_prob
333
- // / @nottested
334
- // / @notdoced
335
- // / @notvalidated
336
- // / @cpponly
336
+ // / @notyettested
337
+ // / @notyetdoced
338
+ // / @notyetvalidated
339
+ // / @cppoverload
340
+ // / @see calcProbOfMultiQubitOutcome()
337
341
qreal calcProbOfMultiQubitOutcome (Qureg qureg, std::vector<int > qubits, std::vector<int > outcomes);
338
342
339
343
340
344
// / @ingroup calc_prob
341
- // / @nottested
342
- // / @notdoced
343
- // / @notvalidated
345
+ // / @notyettested
346
+ // / @notyetdoced
347
+ // / @notyetvalidated
344
348
// / @cpponly
349
+ // / @see calcProbsOfAllMultiQubitOutcomes()
345
350
std::vector<qreal> calcProbsOfAllMultiQubitOutcomes (Qureg qureg, std::vector<int > qubits);
346
351
347
352
348
353
// / @ingroup calc_partialtrace
349
- // / @nottested
350
- // / @notdoced
351
- // / @notvalidated
352
- // / @cpponly
354
+ // / @notyettested
355
+ // / @notyetdoced
356
+ // / @notyetvalidated
357
+ // / @cppoverload
358
+ // / @see calcPartialTrace()
353
359
Qureg calcPartialTrace (Qureg qureg, std::vector<int > traceOutQubits);
354
360
355
361
356
362
// / @ingroup calc_partialtrace
357
- // / @nottested
358
- // / @notdoced
359
- // / @notvalidated
360
- // / @cpponly
363
+ // / @notyettested
364
+ // / @notyetdoced
365
+ // / @notyetvalidated
366
+ // / @cppoverload
367
+ // / @see calcReducedDensityMatrix()
361
368
Qureg calcReducedDensityMatrix (Qureg qureg, std::vector<int > retainQubits);
362
369
363
370
0 commit comments