qrisp.QuantumCircuit.qasm#

QuantumCircuit.qasm(formatted=False, filename=None, encoding=None)[source]#

Returns the OpenQASM string of self.

Parameters:
formattedbool, optional

Return formatted Qasm string. The default is False.

filenamestring, optional

Save Qasm to file with name ‘filename’. The default is None.

encodingTYPE, optional

Optionally specify the encoding to use for the output file if filename is specified. By default, this is set to the system’s default encoding (i.e. whatever locale.getpreferredencoding() returns) and can be set to any valid codec or alias from stdlib’s codec module.

Returns:
string

The OPENQASM string.