From db3f71ae7659f09fe2aef7ff48cd19dda41cb3ac Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 10 May 2024 10:35:13 -0400 Subject: [PATCH] remove unnecessary check --- src/braket/aws/aws_device.py | 2 +- src/braket/devices/device.py | 3 +-- src/braket/devices/local_simulator.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/braket/aws/aws_device.py b/src/braket/aws/aws_device.py index e6118b444..338f9c17b 100644 --- a/src/braket/aws/aws_device.py +++ b/src/braket/aws/aws_device.py @@ -113,7 +113,7 @@ def __init__( self._aws_session = self._get_session_and_initialize(aws_session or AwsSession()) self._ports = None self._frames = None - self.set_noise_model(noise_model) + self._noise_model = noise_model def run( self, diff --git a/src/braket/devices/device.py b/src/braket/devices/device.py index d644b4034..827b8e626 100644 --- a/src/braket/devices/device.py +++ b/src/braket/devices/device.py @@ -124,8 +124,7 @@ def set_noise_model(self, noise_model: NoiseModel) -> None: execution. Noise model can only be added to the devices that support noise simulation. """ - if noise_model: - self._validate_device_noise_model_support(noise_model) + self._validate_device_noise_model_support(noise_model) self._noise_model = noise_model def _validate_device_noise_model_support(self, noise_model: NoiseModel) -> None: diff --git a/src/braket/devices/local_simulator.py b/src/braket/devices/local_simulator.py index 1c10394c6..30c5ffe9c 100644 --- a/src/braket/devices/local_simulator.py +++ b/src/braket/devices/local_simulator.py @@ -74,7 +74,7 @@ def __init__( status="AVAILABLE", ) self._delegate = delegate - self.set_noise_model(noise_model) + self._noise_model = noise_model def run( self,