Functions for calculating single-state properties like normalisation and purity.
More...
Functions for calculating single-state properties like normalisation and purity.
◆ calcPurity()
qreal calcPurity |
( |
Qureg | qureg | ) |
|
- 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 293 of file calculations.cpp.
293 {
294 validate_quregFields(qureg, __func__);
295
296
297
298 qreal prob = localiser_statevec_calcTotalProb(qureg);
299 return (qureg.isDensityMatrix)? prob : prob * prob;
300}
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
◆ calcTotalProb()
qreal calcTotalProb |
( |
Qureg | qureg | ) |
|
- 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 278 of file calculations.cpp.
278 {
279 validate_quregFields(qureg, __func__);
280
281 return (qureg.isDensityMatrix)?
282 localiser_densmatr_calcTotalProb(qureg):
283 localiser_statevec_calcTotalProb(qureg);
284}
Referenced by setQuregToRenormalized(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().