The Quantum Exact Simulation Toolkit v4.2.0
Loading...
Searching...
No Matches

Functions for printing Pauli data structures. More...

Functions

void reportPauliStr (PauliStr str)
 
void reportPauliStrSum (PauliStrSum str)
 

Detailed Description

Functions for printing Pauli data structures.

Function Documentation

◆ reportPauliStr()

void reportPauliStr ( PauliStr str)
Note
Documentation for this function or struct is under construction!
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
See also

Definition at line 264 of file paulis.cpp.

264 {
265
266 // no header, so no indentation
267 string indent = "";
268 print_elemsWithoutNewline(str, indent);
269
270 // print all user-set newlines (including none)
271 print_newlines();
272}

◆ reportPauliStrSum()

void reportPauliStrSum ( PauliStrSum str)
Note
Documentation for this function or struct is under construction!
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
See also

Definition at line 275 of file paulis.cpp.

275 {
276 validate_pauliStrSumFields(sum, __func__);
277 validate_numReportedNewlinesAboveZero(__func__);
278
279 // calculate memory usage
280 qindex numStrBytes = sum.numTerms * sizeof *sum.strings;
281 qindex numCoeffBytes = sum.numTerms * sizeof *sum.coeffs;
282 qindex numStrucBytes = sizeof(sum);
283
284 // we don't bother checking for overflow since total memory scales
285 // linearly with user input parameters, unlike Qureg and matrices.
286 qindex numTotalBytes = numStrBytes + numCoeffBytes + numStrucBytes;
287
288 print_header(sum, numTotalBytes);
289 print_elems(sum);
290
291 // exclude mandatory newline above
292 print_oneFewerNewlines();
293}