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

Definition at line 95 of file QuEST.c.

95  {
96  qasm_clearRecorded(qureg);
97 }

References qasm_clearRecorded().

◆ 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

Definition at line 99 of file QuEST.c.

99  {
100  qasm_printRecorded(qureg);
101 }

References qasm_printRecorded().

◆ 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

Definition at line 87 of file QuEST.c.

87  {
88  qasm_startRecording(qureg);
89 }

References qasm_startRecording().

◆ 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

Definition at line 91 of file QuEST.c.

91  {
92  qasm_stopRecording(qureg);
93 }

References qasm_stopRecording().

◆ 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

Definition at line 103 of file QuEST.c.

103  {
104  int success = qasm_writeRecordedToFile(qureg, filename);
105  validateFileOpened(success, filename, __func__);
106 }

References qasm_writeRecordedToFile(), and validateFileOpened().

void qasm_printRecorded(Qureg qureg)
Definition: QuEST_qasm.c:871
void qasm_clearRecorded(Qureg qureg)
Definition: QuEST_qasm.c:864
void qasm_startRecording(Qureg qureg)
Definition: QuEST_qasm.c:85
void validateFileOpened(int opened, char *fn, const char *caller)
void qasm_stopRecording(Qureg qureg)
Definition: QuEST_qasm.c:89
int qasm_writeRecordedToFile(Qureg qureg, char *filename)
returns success of file write
Definition: QuEST_qasm.c:876