![]() |
The Quantum Exact Simulation Toolkit v4.3.0
|
Functions to control how QuEST's reporters display and truncate information. More...
Functions | |
| void | setQuESTMaxNumReportedItems (qindex numRows, qindex numCols) |
| void | setQuESTMaxNumReportedSigFigs (int numSigFigs) |
| void | setQuESTNumReportedNewlines (int numNewlines) |
| void | setQuESTReportedPauliChars (const char *paulis) |
| void | setQuESTReportedPauliStrStyle (int style) |
Functions to control how QuEST's reporters display and truncate information.
| void setQuESTMaxNumReportedItems | ( | qindex | numRows, |
| qindex | numCols ) |
Sets the maximum number of rows and columns of data structures subsequently printed by QuEST's report functions, with remaining elements ellipted.
This function is useful for keeping stdout concise and readable when reporting large data structures, such as matrices and Qureg. The ellipted elements are in the center of the reported data structure. The specified maximums persist until changed again with this function.
numRows=0 or numCols=0 respectively disables ellipsis across rows and columns respectively. Beware this means that functions like reportQureg() will display the entirety of their data, which can be very large.This function presently affects the output of functions:
In contrast, it has no effect on the output of functions:
When this function is not called, the QuEST defaults are adopted, which are presently:
numRows=32numCols=4
will report 7 rows and 4 columns of qureg.
| [in] | numRows | the max number of rows to report (all if =0). |
| [in] | numCols | the max number of columns to report (all if =0). |
| error |
|
Definition at line 128 of file debug.cpp.
| void setQuESTMaxNumReportedSigFigs | ( | int | numSigFigs | ) |
Sets the maximum number of significant figures in floating-point numbers printed by QuEST's reporter functions.
This function is useful for keeping stdout concise and readable when reporting numerical quantites, such as matrices and Qureg amplitudes. The specified number of significant figures persists until changed again with this function.
numSigFigs, keeping the output concise.5.32 KiB) which is always shown with three significant figures (or four when in bytes, e.g. 1023 bytes).may output
Meanwhile,
will output
| [in] | numSigFigs | the max number of significant figures to print in subsequent report functions. |
| error |
|
Definition at line 142 of file debug.cpp.
| void setQuESTNumReportedNewlines | ( | int | numNewlines | ) |
Sets the number of trailing newlines printed at the end of QuEST's report functions.
These newlines are merely a convenience so that users do not have to manually intersperse newlines in stdout between functions like reportScalar() and reportPauliStr(), which becomes a greater pain in distributed settings when avoiding duplicated output across processes. The specified number of newlines persists until changed again with this function.
By default, the sequence
will print with the internal default of numNewLines=2
but if called after setQuESTNumReportedNewlines(1), will output
It is possible to forego all trailing newlines, and also to write to stdout between report functions.
| [in] | numNewlines | the new number of trailing newlines. |
| error |
|
Definition at line 150 of file debug.cpp.
| void setQuESTReportedPauliChars | ( | const char * | paulis | ) |
Sets the characters used by reportPauliStr() and reportPauliStrSum() to indicate the I, X, Y and Z Pauli operators.
| [in] | paulis | four characters to indicate I, X, Y and Z respectively. |
| error |
|
| seg-fault |
|
Definition at line 158 of file debug.cpp.
| void setQuESTReportedPauliStrStyle | ( | int | style | ) |
Sets the visual style of Pauli strings printed by reportPauliStr() and reportPauliStrSum().
When style=0 (default), every Pauli operator in the string is printed, until the largest-index non-identity operator. The rightmost printed operator is the least significant (i.e. of qubit index 0).
For example:
When style=1, only non-identity Pauli operators are printed, followed by their indices.
For example:
The symbols for I, X, Y and Z can be overridden with setQuESTReportedPauliChars().
| [in] | style | either 0 or 1 to respectively indicate the above styles. |
| error |
|
Definition at line 166 of file debug.cpp.