def test_resolve_parameters():
    """Test that parameters are correctly resolved for defined parametric gate."""
    theta, beta = Parameter("theta"), Parameter("beta")
    xy_matrix = np.array(
        [
            [1, 0, 0, 0],
            [0, quil_cos(theta / 2), 1j * quil_sin(theta / 2) * quil_exp(1j * beta), 0],
            [0, 1j * quil_sin(theta / 2) * quil_exp(1j * beta), 1j * quil_cos(theta / 2), 0],
            [0, 0, 0, 1],
        ]
    )

    defgate = DefGate("PHASEDXY", xy_matrix, parameters=[beta, theta])

    cirq_phased_xy = defgate_to_cirq(defgate)

    op = cirq_phased_xy(beta=sympy.Symbol("beta"), theta=sympy.Symbol("theta"))(
        cirq.LineQubit(0), cirq.LineQubit(1)
    )

    op._resolve_parameters_({"beta": 1.0, "theta": 2.0}, True)
Test that parameters are correctly resolved for defined parametric gate.
cirq-rigetti/cirq_rigetti/quil_input_test.py