def test_program_with_parameterized_defgate():
    """Convert a Quil program with a parameterized DefGate."""
    program = Program(QUIL_PROGRAM_WITH_PARAMETERIZED_DEFGATE)
    circuit = circuit_from_quil(program)

    pyquil_unitary = np.array([[1, 0], [0, np.exp(1j * np.pi / 2)]]) @ matrices.X
    cirq_unitary = circuit.unitary()

    assert allclose_up_to_global_phase(pyquil_unitary, cirq_unitary, atol=1e-8)
Convert a Quil program with a parameterized DefGate.
cirq-rigetti/cirq_rigetti/quil_input_test.py