def test_transform_with_post_transformation_hooks(
    bell_circuit_with_qids: tuple[cirq.Circuit, list[cirq.Qid]],
) -> None:
    """test that a user can transform a `cirq.Circuit` to a `pyquil.Program`
    functionally with explicit physical qubit address mapping.
    """
    bell_circuit, qubits = bell_circuit_with_qids

    def reset_hook(program, measurement_id_map):
        program = Program(Reset()) + program
        return program, measurement_id_map

    reset_hook_spec = create_autospec(reset_hook, side_effect=reset_hook)

    pragma = Pragma('INTIAL_REWIRING', freeform_string='GREEDY')

    def rewire_hook(program, measurement_id_map):
        program = Program(pragma) + program
        return program, measurement_id_map

    rewire_hook_spec = create_autospec(rewire_hook, side_effect=rewire_hook)
    transformer = transformers.build(
        qubits=tuple(qubits), post_transformation_hooks=[reset_hook_spec, rewire_hook_spec]
    )
    program, _ = transformer(circuit=bell_circuit)

    assert 1 == reset_hook_spec.call_count
    assert Reset() in program.instructions, "hook should add reset"

    assert 1 == rewire_hook_spec.call_count
    assert pragma in program.instructions, "hook should add pragma"

    assert H(0) in program.instructions, "bell circuit should include Hadamard"
    assert CNOT(0, 1) in program.instructions, "bell circuit should include CNOT"
    assert (
        DECLARE("m0", memory_size=2) in program.instructions
    ), "executable should declare a read out bit"
    assert (
        MEASURE(0, ("m0", 0)) in program.instructions
    ), "executable should measure the first qubit to the first read out bit"
    assert (
        MEASURE(1, ("m0", 1)) in program.instructions
    ), "executable should measure the second qubit to the second read out bit"
test that a user can transform a `cirq.Circuit` to a `pyquil.Program`
    functionally with explicit physical qubit address mapping.
    
cirq-rigetti/cirq_rigetti/circuit_transformers_test.py