- class Exporter(includes=('stdgates.inc',), basis_gates=('U',), disable_constants=False, alias_classical_registers=False, indent=' ')¶
QASM3 exporter main class.
str]) -- the filenames that should be emitted as includes. These files will be parsed for gates, and any objects dumped from this exporter will use those definitions where possible.
str]) -- the basic defined gate set of the backend.
bool) -- if
True, always emit floating-point constants for numeric parameter values. If
False(the default), then values close to multiples of QASM 3 constants (
tau) will be emitted in terms of those constants instead, potentially improving accuracy in the output.
bool) -- If
True, then classical bit and classical register declarations will look similar to quantum declarations, where the whole set of bits will be declared in a flat array, and the registers will just be aliases to collections of these bits. This is inefficient for running OpenQASM 3 programs, however, and may not be well supported on backends. Instead, the default behaviour of
Falsemeans that individual classical registers will gain their own
bit[size] register;declarations, and loose
Clbits will go onto their own declaration. In this form, each
Clbitmust be in either zero or one
str) -- the indentation string to use for each level within an indented block. Can be set to the empty string to disable indentation.
Convert the circuit to QASM 3, dumping the result to a file or text stream.
Convert the circuit to QASM 3, returning the result as a string.