|View source on GitHub|
Representation of a circuit in QASM (quantum assembly) format.
cirq.circuits.QasmOutput( operations: 'cirq.OP_TREE', qubits: Tuple['cirq.Qid', ...], header: str = '', precision: int = 10, version: str = '2.0' ) -> None
Please note that the QASM importer is in an experimental state and currently only supports a subset of the full OpenQASM spec. Amongst others, classical control, arbitrary gate definitions, and even some of the gates that don't have a one-to-one representation in Cirq, are not yet supported.
QASM output can be saved to a file using the save method.
||Tree of operations to insert.|
||The qubits used in the operations.|
||A multi-line string that is placed in a comment at the top of the QASM.|
||The number of digits after the decimal to show for numbers in the QASM code.|
||The QASM version to target. Objects may return different QASM depending on version.|
is_valid_qasm_id( id_str: str ) -> bool
Test if id_str is a valid id in QASM grammar.
save( path: Union[str, bytes, int] ) -> None
Write QASM output to a file specified by path.