From 0f1f1a2353c844fcbc6a99b44ee361817fe94329 Mon Sep 17 00:00:00 2001 From: Lauren Capelluto Date: Sat, 28 Oct 2023 12:36:35 -0400 Subject: [PATCH] Fix coverage, remove dup test --- src/braket/experimental/autoqasm/api.py | 5 ++-- .../experimental/autoqasm/test_parameters.py | 23 ------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/braket/experimental/autoqasm/api.py b/src/braket/experimental/autoqasm/api.py index 2acea01bb..6e3c4feef 100644 --- a/src/braket/experimental/autoqasm/api.py +++ b/src/braket/experimental/autoqasm/api.py @@ -547,9 +547,8 @@ def _get_gate_args(f: Callable) -> aq_program.GateArgs: if param.annotation == aq_instructions.QubitIdentifierType: gate_args.append_qubit(param.name) - elif param.annotation in [float, aq_types.FloatVar] or ( - get_args(param.annotation) - and any(type_ in [float, aq_types.FloatVar] for type_ in get_args(param.annotation)) + elif param.annotation == float or any( + type_ == float for type_ in get_args(param.annotation) ): gate_args.append_angle(param.name) else: diff --git a/test/unit_tests/braket/experimental/autoqasm/test_parameters.py b/test/unit_tests/braket/experimental/autoqasm/test_parameters.py index fa80c6d79..137327a31 100644 --- a/test/unit_tests/braket/experimental/autoqasm/test_parameters.py +++ b/test/unit_tests/braket/experimental/autoqasm/test_parameters.py @@ -78,29 +78,6 @@ def test_multiple_parameters(): assert multi_parametric().to_ir() == expected -def test_typed_parameters(): - """Test that multiple free parameters all appear in the processed program.""" - - @aq.main - def multi_parametric(): - rx(0, FreeParameter("alpha")) - rx(1, FreeParameter("theta")) - c = measure([0, 1]) # noqa: F841 - - expected = """OPENQASM 3.0; -bit[2] c; -input float[64] alpha; -input float[64] theta; -qubit[2] __qubits__; -rx(alpha) __qubits__[0]; -rx(theta) __qubits__[1]; -bit[2] __bit_0__ = "00"; -__bit_0__[0] = measure __qubits__[0]; -__bit_0__[1] = measure __qubits__[1]; -c = __bit_0__;""" - assert multi_parametric().to_ir() == expected - - def test_sim_multi_param(): measurements = _test_parametric_on_local_sim(multi_parametric(), {"alpha": 3.14, "theta": 0}) assert all(val == "10" for val in measurements["c"])