Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove unused discretization fields #953

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/braket/ahs/local_detuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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"],
},
}

Expand Down
2 changes: 0 additions & 2 deletions test/unit_tests/braket/ahs/test_local_detuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down