From f69c824da1122ad00640a88fd458ad433c108f11 Mon Sep 17 00:00:00 2001 From: Abe Coull <85974725+math411@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:34:57 -0700 Subject: [PATCH] fix: remove optional discretization fields (#953) --- src/braket/ahs/local_detuning.py | 4 ---- .../braket/ahs/test_analog_hamiltonian_simulation.py | 6 ++---- test/unit_tests/braket/ahs/test_local_detuning.py | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/braket/ahs/local_detuning.py b/src/braket/ahs/local_detuning.py index 1906ce837..39a475922 100644 --- a/src/braket/ahs/local_detuning.py +++ b/src/braket/ahs/local_detuning.py @@ -154,11 +154,7 @@ def discretize(self, properties: DiscretizationProperties) -> LocalDetuning: """ local_detuning_parameters = properties.rydberg.rydbergLocal time_resolution = local_detuning_parameters.timeResolution - value_resolution = local_detuning_parameters.commonDetuningResolution - pattern_resolution = local_detuning_parameters.localDetuningResolution discretized_magnitude = self.magnitude.discretize( time_resolution=time_resolution, - value_resolution=value_resolution, - pattern_resolution=pattern_resolution, ) return LocalDetuning(discretized_magnitude) diff --git a/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py b/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py index 65cc2a074..83178c120 100644 --- a/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py +++ b/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py @@ -141,8 +141,6 @@ def test_discretize(register, driving_field, local_detuning): device.properties.paradigm.rydberg.rydbergGlobal.phaseResolution = Decimal("5E-7") device.properties.paradigm.rydberg.rydbergLocal.timeResolution = Decimal("1E-9") - device.properties.paradigm.rydberg.rydbergLocal.commonDetuningResolution = Decimal("2000.0") - device.properties.paradigm.rydberg.rydbergLocal.localDetuningResolution = Decimal("0.01") discretized_ahs = ahs.discretize(device) discretized_ir = discretized_ahs.to_ir() @@ -179,10 +177,10 @@ def test_discretize(register, driving_field, local_detuning): } local_detuning = discretized_json["hamiltonian"]["localDetuning"][0]["magnitude"] assert local_detuning == { - "pattern": ["0.50", "1.00", "0.50", "0.50", "0.50", "0.50"], + "pattern": ["0.5", "1", "0.5", "0.5", "0.5", "0.5"], "time_series": { "times": ["0E-9", "0.000003000"], - "values": ["-125664000.0", "125664000.0"], + "values": ["-125664000", "125664000"], }, } diff --git a/test/unit_tests/braket/ahs/test_local_detuning.py b/test/unit_tests/braket/ahs/test_local_detuning.py index 4c4f94675..8768dce64 100644 --- a/test/unit_tests/braket/ahs/test_local_detuning.py +++ b/test/unit_tests/braket/ahs/test_local_detuning.py @@ -129,8 +129,6 @@ def test_discretize(): discretized_field = field.discretize(mock_properties) magnitude_mock.discretize.assert_called_with( time_resolution=mock_properties.rydberg.rydbergLocal.timeResolution, - value_resolution=mock_properties.rydberg.rydbergLocal.commonDetuningResolution, - pattern_resolution=mock_properties.rydberg.rydbergLocal.localDetuningResolution, ) assert field is not discretized_field assert discretized_field.magnitude == magnitude_mock.discretize.return_value