The Quantum Exact Simulation Toolkit v4.1.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 494 of file paulis.cpp.

494 {
495
496 // no header, so no indentation
497 string indent = "";
498 print_elemsWithoutNewline(str, indent);
499
500 // print all user-set newlines (including none)
501 print_newlines();
502}

◆ 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 505 of file paulis.cpp.

505 {
506 validate_pauliStrSumFields(sum, __func__);
507 validate_numReportedNewlinesAboveZero(__func__);
508
509 // calculate memory usage
510 qindex numStrBytes = sum.numTerms * sizeof *sum.strings;
511 qindex numCoeffBytes = sum.numTerms * sizeof *sum.coeffs;
512 qindex numStrucBytes = sizeof(sum);
513
514 // we don't bother checking for overflow since total memory scales
515 // linearly with user input parameters, unlike Qureg and matrices.
516 qindex numTotalBytes = numStrBytes + numCoeffBytes + numStrucBytes;
517
518 print_header(sum, numTotalBytes);
519 print_elems(sum);
520
521 // exclude mandatory newline above
522 print_oneFewerNewlines();
523}