GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing quest-kit.github.io — The Quantum Exact Simulation Toolkit: Reporting
Loading...
Searching...
No Matches
Functions to control how QuEST's reporters display and truncate information. More...
Detailed DescriptionFunctions to control how QuEST's reporters display and truncate information. Function Documentation◆ setQuESTMaxNumReportedItems()
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
This function presently affects the output of functions:
In contrast, it has no effect on the output of functions:
Qureg qureg = createDensityQureg(6);
initRandomPureState(qureg);
reportQureg(qureg);
void setQuESTMaxNumReportedItems(qindex numRows, qindex numCols) Definition debug.cpp:128 Definition qureg.h:49 will report 7 rows and 4 columns of Qureg (6 qubit density matrix, 64x64 qcomps, 64.1 KiB):
0.012273+(3.2329e-19)i -0.0056906+0.0072884i … -0.0052104-0.0070839i 0.00092891-0.0086299i
-0.0056906-0.0072884i 0.0069669-(1.363e-20)i … -0.0017909+0.0063788i -0.0055556+0.0034498i
0.014757-0.0083751i -0.0018689+0.012647i … -0.011099-0.0049622i -0.0047721-0.011011i
0.00078401+0.0014319i -0.0012139-0.00019834i … 0.00049365-0.0010604i 0.0010662-0.00044291i
⋮
-0.010456+0.012047i -0.0023056-0.011795i … 0.011393+0.00092115i 0.0076794+0.0082644i
-0.0052104+0.0070839i -0.0017909-0.0063788i … 0.0063009-(3.3799e-20)i 0.0045868+0.0041999i
0.00092891+0.0086299i -0.0055556-0.0034498i … 0.0045868-0.0041999i 0.0061386-(1.4941e-19)i
Definition at line 128 of file debug.cpp. 128 {
129 validate_envIsInit(__func__);
130 validate_newMaxNumReportedScalars(numRows, numCols, __func__);
131
132 // replace 0 values (indicating no truncation) with max-val,
133 // since there can never be max(qindex)-many amps
134 qindex max = std::numeric_limits<qindex>::max();
135 numRows = (numRows == 0)? max : numRows;
136 numCols = (numCols == 0)? max : numCols;
137
138 printer_setMaxNumPrintedScalars(numRows, numCols);
139}
◆ setQuESTMaxNumReportedSigFigs()
Sets the maximum number of significant figures in floating-point numbers printed by QuEST's reporter functions. This function is useful for keeping
Qureg qureg = createQureg(3);
initRandomPureState(qureg);
reportQureg(qureg);
reportQureg(qureg);
void setQuESTMaxNumReportedSigFigs(int numSigFigs) Definition debug.cpp:142 may output Qureg (3 qubit statevector, 8 qcomps, 232 bytes):
0.49+0.35i |0⟩
-0.085+0.17i |1⟩
0.37+0.099i |2⟩
-0.14+0.088i |3⟩
-0.29+0.078i |4⟩
0.19+0.019i |5⟩
0.02-0.5i |6⟩
-0.032+0.22i |7⟩
Qureg (3 qubit statevector, 8 qcomps, 232 bytes):
0.4915502074+0.3471270204i |0⟩
-0.08473589829+0.1685819182i |1⟩
0.3702183582+0.0991921232i |2⟩
-0.142193399+0.08829704821i |3⟩
-0.2881909331+0.07795511511i |4⟩
0.1868915394+0.01946703883i |5⟩
0.01956017542-0.5029788111i |6⟩
-0.03171267079+0.220342331i |7⟩
Meanwhile, CompMatr1 matr = getInlineCompMatr1({{1,2},{3,4.123456789}});
reportCompMatr1(matr);
CompMatr1 getInlineCompMatr1({{ matrix }}) Definition matrices.h:85 will output CompMatr1 (1 qubit, 2x2 qcomps, 80 bytes):
1 2
3 4.12
Definition at line 142 of file debug.cpp. 142 {
143 validate_envIsInit(__func__);
144 validate_newMaxNumReportedSigFigs(numSigFigs, __func__);
145
146 printer_setMaxNumPrintedSigFig(numSigFigs);
147}
◆ setQuESTNumReportedNewlines()
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
By default, the sequence reportCompMatr1(getInlineCompMatr1({{1,2},{3,4}}));
reportScalar("x", 5);
reportStr("hello world!");
PauliStr getInlinePauliStr(const char *paulis, { list }) will print with the internal default of CompMatr1 (1 qubit, 2x2 qcomps, 80 bytes):
1 2
3 4
ZIYIX
x: 5
hello world!
but if called after CompMatr1 (1 qubit, 2x2 qcomps, 80 bytes):
1 2
3 4
ZIYIX
x: 5
hello world!
It is possible to forego all trailing newlines, and also to write to printf(" * ");
printf(" = ");
printf("\n");
void setQuESTNumReportedNewlines(int numNewlines) Definition debug.cpp:150 ZIYIX * ZZZ = ZIXZY
Definition at line 150 of file debug.cpp. 150 {
151 validate_envIsInit(__func__);
152 validate_newNumReportedNewlines(numNewlines, __func__);
153
154 printer_setNumTrailingNewlines(numNewlines);
155}
◆ setQuESTReportedPauliChars()
Sets the characters used by reportPauliStr() and reportPauliStrSum() to indicate the
Definition at line 158 of file debug.cpp. 158 {
159 validate_envIsInit(__func__);
160 validate_numPauliChars(paulis, __func__);
161
162 printer_setPauliChars(paulis);
163}
◆ setQuESTReportedPauliStrStyle()
Sets the visual style of Pauli strings printed by reportPauliStr() and reportPauliStrSum().
The symbols for
Definition at line 166 of file debug.cpp. 166 {
167 validate_envIsInit(__func__);
168 validate_reportedPauliStrStyleFlag(flag, __func__);
169
170 printer_setPauliStrFormat(flag);
171}
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||