Skip to content

Commit

Permalink
tox fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Coull committed Apr 12, 2024
1 parent f0c914a commit 4c1de15
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/braket/ahs/driving_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,32 @@ def discretize(self, properties: DiscretizationProperties) -> DrivingField:
DrivingField: A new discretized DrivingField.
"""
driving_parameters = properties.rydberg.rydbergGlobal
time_resolution = driving_parameters.timeResolution
time_resolution = None
if hasattr(driving_parameters, "timeResolution"):
time_resolution = driving_parameters.timeResolution

amplitude_value_resolution = None
if hasattr(driving_parameters, "rabiFrequencyResolution"):
amplitude_value_resolution = driving_parameters.rabiFrequencyResolution
discretized_amplitude = self.amplitude.discretize(
time_resolution=time_resolution,
value_resolution=driving_parameters.rabiFrequencyResolution,
value_resolution=amplitude_value_resolution,
)

phase_value_resolution = None
if hasattr(driving_parameters, "phaseResolution"):
phase_value_resolution = driving_parameters.phaseResolution
discretized_phase = self.phase.discretize(
time_resolution=time_resolution,
value_resolution=driving_parameters.phaseResolution,
value_resolution=phase_value_resolution,
)

detuning_value_resolution = None
if hasattr(driving_parameters, "detuningResolution"):
detuning_value_resolution = driving_parameters.detuningResolution
discretized_detuning = self.detuning.discretize(
time_resolution=time_resolution,
value_resolution=driving_parameters.detuningResolution,
value_resolution=detuning_value_resolution,
)
return DrivingField(
amplitude=discretized_amplitude, phase=discretized_phase, detuning=discretized_detuning
Expand Down

0 comments on commit 4c1de15

Please sign in to comment.