def __init__(
        self,
        operations: cirq.OP_TREE,
        qubits: tuple[cirq.Qid, ...],
        header: str = '',
        precision: int = 10,
        version: str = '2.0',
    ) -> None:
        """Representation of a circuit in QASM format.

        Args:
            operations: Tree of operations to insert.
            qubits: The qubits used in the operations.
            header: A multi-line string that is placed in a comment at the top
                of the QASM.
            precision: The number of digits after the decimal to show for
                numbers in the QASM code.
            version: The QASM version to target. Objects may return different
                QASM depending on version.
        """
        self.operations = tuple(ops.flatten_to_ops(operations))
        self.qubits = qubits
        self.header = header
        self.measurements = tuple(
            op for op in self.operations if isinstance(op.gate, ops.MeasurementGate)
        )
        meas_key_id_map, meas_comments = self._generate_measurement_ids()
        self.meas_comments = meas_comments
        qubit_id_map = self._generate_qubit_ids()
        self.cregs = self._generate_cregs(meas_key_id_map)
        self.args = protocols.QasmArgs(
            precision=precision,
            version=version,
            qubit_id_map=qubit_id_map,
            meas_key_id_map=meas_key_id_map,
            meas_key_bitcount={k: v[0] for k, v in self.cregs.items()},
        )
Representation of a circuit in QASM format.

        Args:
            operations: Tree of operations to insert.
            qubits: The qubits used in the operations.
            header: A multi-line string that is placed in a comment at the top
                of the QASM.
            precision: The number of digits after the decimal to show for
                numbers in the QASM code.
            version: The QASM version to target. Objects may return different
                QASM depending on version.
        
cirq-core/cirq/circuits/qasm_output.py