Skip to content

Commit c474226

Browse files
updated doc (#621)
including - removing references to defunct `invalidQuESTInputError` - essential doc needed to disambiguate function conventions (like relationship between function parameters and effected operation phases) - renamed Doxygen keyword `@equivalent` to `@equivalences` - ... `@notvalidated` to `@notyetvalidated` - ... `@notdoced` to `@notyetdoced` - ... `@nottested` to `@notyettested` - changed some `@cpponly` functions into new `@cppvectoroverload`, and then hid the latter - added links from doc to the example PR - linked `C++`-overload doc to corresponding `C` function (using `@see`)
1 parent f11fb95 commit c474226

19 files changed

+2656
-909
lines changed

docs/architecture.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
@author Tyson Jones
88
-->
99

10+
> [!TIP]
11+
> See [PR #615](https://github.com/QuEST-Kit/QuEST/pull/615) for an illustration of integrating
12+
> new functions into the QuEST software architecture.
13+
1014
All user-visible API signatures are contained in `include/`, divided into semantic submodules (like `calculations.h` and `qureg.h`), but all exposed by `quest.h`. They are all strictly `C` _and_ `C++` compatible, hence their `.h` file extension.
1115

1216
The source code within `src/` is divided between five subdirectories, listed below in order of increasing control flow depth. All code is parsed strictly by `C++`, hence all files have `.cpp` and `.hpp` extensions.

docs/contributing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
<!--- @todo -->
1414

1515
In the meantime, feel free to open an issue, a discussion or a pull request, or reach out to `[email protected]`.
16+
17+
> [!TIP]
18+
> See [PR #615](https://github.com/QuEST-Kit/QuEST/pull/615) for an illustration of integrating
19+
> new functions into the QuEST software architecture.

docs/launch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ For convenience however, we offer some example [SLURM](https://slurm.schedmd.com
595595
#SBATCH --nodes=4
596596
#SBATCH --ntasks-per-node=1
597597
#SBATCH --cpus-per-task=8
598-
OMP_NUM_THREADS=8 mpirun ./myexec
598+
OMP_NUM_THREADS=8 srun ./myexec
599599
```
600600
601601
1 machine with 4 local GPUs:

quest/include/calculations.h

Lines changed: 62 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ extern "C" {
6969
* which case the imaginary component of the above expression is neglected.
7070
* The full complex value can be obtained using calcExpecNonHermitianPauliStrSum().
7171
*
72-
* @equivalence
72+
* @equivalences
7373
* - When @p str is general, this function is equivalent to calling calcExpecPauliStrSum() with a
7474
* PauliStrSum composed of only a single PauliStr term and a unity coefficient.
7575
* - When @p str @f$ = \id^\otimes @f$, the output is equivalent to that of calcTotalProb().
7676
*
7777
* @myexample
7878
* ```
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});
8183
8284
qreal expec = calcExpecPauliStr(qureg, str);
8385
reportScalar("expec", expec);
@@ -89,11 +91,11 @@ extern "C" {
8991
* @param[in] qureg the reference state.
9092
* @param[in] str the observable operator.
9193
* @returns The real component of the expectation value.
92-
* @throws invalidQuESTInputError()
94+
* @throws @validationerror
9395
* - if @p qureg is uninitialised.
9496
* - if @p str contains a (non-identity) Pauli upon a higher-index qubit than exists in @p qureg.
9597
* - if the output (with unreturned imaginary component) is not approximately real.
96-
* @notvalidated
98+
* @notyetvalidated
9799
* @author Tyson Jones
98100
*/
99101
qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
@@ -125,7 +127,7 @@ qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
125127
* Hermiticity validation is relaxed and/or @p qureg is an unnormalised density matrix.
126128
* The full complex value can be obtained using calcExpecNonHermitianPauliStrSum().
127129
*
128-
* @equivalence
130+
* @equivalences
129131
* - This function is mathematically equivalent to (albeit faster than) calling calcExpecPauliStr() upon
130132
* each constituent @p PauliStr within @p sum, weighting each by its corresponding coefficient, and
131133
* summing the outputs.
@@ -145,15 +147,16 @@ qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
145147
qreal expec = calcExpecPauliStrSum(qureg, sum);
146148
reportScalar("expec", expec);
147149
* ```
150+
*
148151
* @param[in] qureg the reference state.
149152
* @param[in] sum the observable operator.
150153
* @returns The real component of the expectation value.
151-
* @throws invalidQuESTInputError()
154+
* @throws @validationerror
152155
* - if @p qureg or @p sum are uninitialised.
153156
* - if any PauliStr in @p sum targets a higher-index qubit than exists in @p qureg.
154157
* - if @p sum is not approximately Hermitian.
155158
* - if the output (with unreturned imaginary component) is not approximately real.
156-
* @notvalidated
159+
* @notyetvalidated
157160
* @see
158161
* - calcExpecNonHermitianPauliStrSum()
159162
* - calcExpecFullStateDiagMatr()
@@ -162,13 +165,13 @@ qreal calcExpecPauliStr(Qureg qureg, PauliStr str);
162165
qreal calcExpecPauliStrSum(Qureg qureg, PauliStrSum sum);
163166

164167

165-
/// @notdoced
166-
/// @notvalidated
168+
/// @notyetdoced
169+
/// @notyetvalidated
167170
qreal calcExpecFullStateDiagMatr(Qureg qureg, FullStateDiagMatr matr);
168171

169172

170-
/// @notdoced
171-
/// @notvalidated
173+
/// @notyetdoced
174+
/// @notyetvalidated
172175
qreal calcExpecFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matr, qreal exponent);
173176

174177

@@ -183,23 +186,23 @@ qreal calcExpecFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matr, qreal
183186
*/
184187

185188

186-
/// @notdoced
187-
/// @notvalidated
189+
/// @notyetdoced
190+
/// @notyetvalidated
188191
qreal calcProbOfBasisState(Qureg qureg, qindex index);
189192

190193

191-
/// @notdoced
192-
/// @notvalidated
194+
/// @notyetdoced
195+
/// @notyetvalidated
193196
qreal calcProbOfQubitOutcome(Qureg qureg, int qubit, int outcome);
194197

195198

196-
/// @notdoced
197-
/// @notvalidated
199+
/// @notyetdoced
200+
/// @notyetvalidated
198201
qreal calcProbOfMultiQubitOutcome(Qureg qureg, int* qubits, int* outcomes, int numQubits);
199202

200203

201-
/// @notdoced
202-
/// @notvalidated
204+
/// @notyetdoced
205+
/// @notyetvalidated
203206
void calcProbsOfAllMultiQubitOutcomes(qreal* outcomeProbs, Qureg qureg, int* qubits, int numQubits);
204207

205208

@@ -214,13 +217,13 @@ void calcProbsOfAllMultiQubitOutcomes(qreal* outcomeProbs, Qureg qureg, int* qub
214217
*/
215218

216219

217-
/// @notdoced
218-
/// @notvalidated
220+
/// @notyetdoced
221+
/// @notyetvalidated
219222
qreal calcTotalProb(Qureg qureg);
220223

221224

222-
/// @notdoced
223-
/// @notvalidated
225+
/// @notyetdoced
226+
/// @notyetvalidated
224227
qreal calcPurity(Qureg qureg);
225228

226229

@@ -235,12 +238,12 @@ qreal calcPurity(Qureg qureg);
235238
*/
236239

237240

238-
/// @notdoced
239-
/// @notvalidated
241+
/// @notyetdoced
242+
/// @notyetvalidated
240243
qreal calcFidelity(Qureg qureg, Qureg other);
241244

242-
/// @notdoced
243-
/// @notvalidated
245+
/// @notyetdoced
246+
/// @notyetvalidated
244247
qreal calcDistance(Qureg qureg1, Qureg qureg2);
245248

246249

@@ -255,13 +258,13 @@ qreal calcDistance(Qureg qureg1, Qureg qureg2);
255258
*/
256259

257260

258-
/// @notdoced
259-
/// @notvalidated
261+
/// @notyetdoced
262+
/// @notyetvalidated
260263
Qureg calcPartialTrace(Qureg qureg, int* traceOutQubits, int numTraceQubits);
261264

262265

263-
/// @notdoced
264-
/// @notvalidated
266+
/// @notyetdoced
267+
/// @notyetvalidated
265268
Qureg calcReducedDensityMatrix(Qureg qureg, int* retainQubits, int numRetainQubits);
266269

267270

@@ -292,26 +295,26 @@ Qureg calcReducedDensityMatrix(Qureg qureg, int* retainQubits, int numRetainQubi
292295

293296

294297
/// @ingroup calc_comparisons
295-
/// @notdoced
296-
/// @notvalidated
298+
/// @notyetdoced
299+
/// @notyetvalidated
297300
qcomp calcInnerProduct(Qureg qureg1, Qureg qureg2);
298301

299302

300303
/// @ingroup calc_expec
301-
/// @notdoced
302-
/// @notvalidated
304+
/// @notyetdoced
305+
/// @notyetvalidated
303306
qcomp calcExpecNonHermitianPauliStrSum(Qureg qureg, PauliStrSum sum);
304307

305308

306309
/// @ingroup calc_expec
307-
/// @notdoced
308-
/// @notvalidated
310+
/// @notyetdoced
311+
/// @notyetvalidated
309312
qcomp calcExpecNonHermitianFullStateDiagMatr(Qureg qureg, FullStateDiagMatr matr);
310313

311314

312315
/// @ingroup calc_expec
313-
/// @notdoced
314-
/// @notvalidated
316+
/// @notyetdoced
317+
/// @notyetvalidated
315318
qcomp calcExpecNonHermitianFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp exponent);
316319

317320

@@ -330,34 +333,38 @@ qcomp calcExpecNonHermitianFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr
330333

331334

332335
/// @ingroup calc_prob
333-
/// @nottested
334-
/// @notdoced
335-
/// @notvalidated
336-
/// @cpponly
336+
/// @notyettested
337+
/// @notyetdoced
338+
/// @notyetvalidated
339+
/// @cppoverload
340+
/// @see calcProbOfMultiQubitOutcome()
337341
qreal calcProbOfMultiQubitOutcome(Qureg qureg, std::vector<int> qubits, std::vector<int> outcomes);
338342

339343

340344
/// @ingroup calc_prob
341-
/// @nottested
342-
/// @notdoced
343-
/// @notvalidated
345+
/// @notyettested
346+
/// @notyetdoced
347+
/// @notyetvalidated
344348
/// @cpponly
349+
/// @see calcProbsOfAllMultiQubitOutcomes()
345350
std::vector<qreal> calcProbsOfAllMultiQubitOutcomes(Qureg qureg, std::vector<int> qubits);
346351

347352

348353
/// @ingroup calc_partialtrace
349-
/// @nottested
350-
/// @notdoced
351-
/// @notvalidated
352-
/// @cpponly
354+
/// @notyettested
355+
/// @notyetdoced
356+
/// @notyetvalidated
357+
/// @cppoverload
358+
/// @see calcPartialTrace()
353359
Qureg calcPartialTrace(Qureg qureg, std::vector<int> traceOutQubits);
354360

355361

356362
/// @ingroup calc_partialtrace
357-
/// @nottested
358-
/// @notdoced
359-
/// @notvalidated
360-
/// @cpponly
363+
/// @notyettested
364+
/// @notyetdoced
365+
/// @notyetvalidated
366+
/// @cppoverload
367+
/// @see calcReducedDensityMatrix()
361368
Qureg calcReducedDensityMatrix(Qureg qureg, std::vector<int> retainQubits);
362369

363370

0 commit comments

Comments
 (0)