QASM Logging

Functions for recording performed gates to QASM More...

Functions

void clearRecordedQASM (Qureg qureg)
 Clear all QASM so far recorded. More...
 
void printRecordedQASM (Qureg qureg)
 Print recorded QASM to stdout. More...
 
void startRecordingQASM (Qureg qureg)
 Enable QASM recording. More...
 
void stopRecordingQASM (Qureg qureg)
 Disable QASM recording. More...
 
void writeRecordedQASMToFile (Qureg qureg, char *filename)
 Writes recorded QASM to a file, throwing an error if inaccessible. More...
 

Detailed Description

Functions for recording performed gates to QASM

Function Documentation

◆ clearRecordedQASM()

void clearRecordedQASM ( Qureg  qureg)

Clear all QASM so far recorded.

This does not start or stop recording.

Parameters
[in,out]quregThe qureg of which to clear the QASM log
Author
Tyson Jones

◆ printRecordedQASM()

void printRecordedQASM ( Qureg  qureg)

Print recorded QASM to stdout.

This does not clear the QASM log, nor does it start or stop QASM recording.

Parameters
[in]quregPrints the QASM recorded for this qureg.
Author
Tyson Jones

◆ startRecordingQASM()

void startRecordingQASM ( Qureg  qureg)

Enable QASM recording.

Gates applied to qureg will here-after be added to a growing log of QASM instructions, progressively consuming more memory until disabled with stopRecordingQASM(). The QASM log is bound to this qureg instance.

Parameters
[in,out]quregThe qureg to begin recording subsequent operations upon
Author
Tyson Jones

◆ stopRecordingQASM()

void stopRecordingQASM ( Qureg  qureg)

Disable QASM recording.

The recorded QASM will be maintained in qureg and continue to be appended to if startRecordingQASM is recalled.

Has no effect if qureg was not already recording operations.

Parameters
[in,out]quregThe qureg to halt recording subsequent operations upon
Author
Tyson Jones

◆ writeRecordedQASMToFile()

void writeRecordedQASMToFile ( Qureg  qureg,
char *  filename 
)

Writes recorded QASM to a file, throwing an error if inaccessible.

Parameters
[in]quregWrites the QASM recorded for this qureg to file
[in]filenameThe filename of the file to contain the recorded QASM
Exceptions
invalidQuESTInputError()
  • if filename cannot be written to
Author
Tyson Jones