qiskit.circuit.QuantumCircuit.qasm¶
- QuantumCircuit.qasm(formatted=False, filename=None, encoding=None)[source]¶
Return OpenQASM string.
- Paramètres
formatted (bool) – Return formatted Qasm string.
filename (str) – Save Qasm to file with name “filename”.
encoding (str) – 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 (ie whateverlocale.getpreferredencoding()
returns) and can be set to any valid codec or alias from stdlib’s codec module
- Renvoie
If formatted=False.
- Type renvoyé
str
- Lève
MissingOptionalLibraryError – If pygments is not installed and
formatted
isTrue
.QasmError – If circuit has free parameters.