diff --git a/src/braket/ahs/driving_field.py b/src/braket/ahs/driving_field.py index f6c6430f2..c01632f07 100644 --- a/src/braket/ahs/driving_field.py +++ b/src/braket/ahs/driving_field.py @@ -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