def build(
    *,
    qubits: tuple[cirq.Qid, ...] | None = None,
    decompose_operation: Callable[[cirq.Operation], list[cirq.Operation]] | None = None,
    qubit_id_map: dict[cirq.Qid, str] | None = None,
    post_transformation_hooks: list[_PostTransformationHook] | None = None,
) -> CircuitTransformer:
    """This builds a `CircuitTransformer` that the client may use over multiple sweeps of
    `cirq.Sweepable`.

    Args:
        qubits: The qubits defined on the circuit that this function will transform. If None,
            the transformer will pull qubits from the `cirq.Circuit` and order them by
            `cirq.ops.QubitOrder.DEFAULT` on each transformation.
        decompose_operation: A callable that can decompose each individual operation on the
            `cirq.Circuit` before being transformed. This will override the default Quil
            decompositions in cirq. You may optimize your circuit before transformation and pass
            a no-op here.
        qubit_id_map: A map of `cirq.Qid` to physical qubit addresses that will end up in
            the executed native Quil.
        post_transformation_hooks: A list of transformation functions you may pass to further
            convert a `pyquil.Program` after transformation.

    Returns:
        A `CircuitTransformer` transforming the `cirq.Circuit` s as specified above.
    """

    def transformer(*, circuit: cirq.Circuit) -> tuple[Program, dict[str, str]]:
        return _transform_cirq_circuit_to_pyquil_program(
            circuit=circuit,
            qubits=qubits,
            decompose_operation=decompose_operation,
            qubit_id_map=qubit_id_map,
            post_transformation_hooks=post_transformation_hooks,
        )

    return transformer
This builds a `CircuitTransformer` that the client may use over multiple sweeps of
    `cirq.Sweepable`.

    Args:
        qubits: The qubits defined on the circuit that this function will transform. If None,
            the transformer will pull qubits from the `cirq.Circuit` and order them by
            `cirq.ops.QubitOrder.DEFAULT` on each transformation.
        decompose_operation: A callable that can decompose each individual operation on the
            `cirq.Circuit` before being transformed. This will override the default Quil
            decompositions in cirq. You may optimize your circuit before transformation and pass
            a no-op here.
        qubit_id_map: A map of `cirq.Qid` to physical qubit addresses that will end up in
            the executed native Quil.
        post_transformation_hooks: A list of transformation functions you may pass to further
            convert a `pyquil.Program` after transformation.

    Returns:
        A `CircuitTransformer` transforming the `cirq.Circuit` s as specified above.
    
cirq-rigetti/cirq_rigetti/circuit_transformers.py