amazon-braket-sdk-python icon indicating copy to clipboard operation
amazon-braket-sdk-python copied to clipboard

The AWS device module does not allow you to retrieve the device region

Open christianbmadsen opened this issue 3 years ago • 1 comments

Describe the bug According to the documentation I can retrieve the regions of a device via the Braket SDK. This doesnt appear to be supported in the code.

The Amazon Braket SDK the docs state that you can access the device region as a property of your declared device: https://amazon-braket-sdk-python.readthedocs.io/en/stable/_apidoc/braket.aws.aws_device.html#braket.aws.aws_device.AwsDevice. Here's the doc string: https://github.com/aws/amazon-braket-sdk-python/blob/main/src/braket/aws/aws_device.py#L70.

To reproduce Open https://amazon-braket-testnbiex.notebook.us-east-1.sagemaker.aws/notebooks/Braket%20examples/braket_features/Getting_Devices_and_Checking_Device_Properties.ipynb and modify cell 20 to

# the managed simulator SV1
device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")

print(device.DEVICE_REGIONS)

You will get an attribute error AttributeError: 'AwsDevice' object has no attribute 'DEVICE_REGIONS'

Expected behavior The statement returns the device regions. In this case: ('us-east-1', 'us-west-1', 'us-west-2', 'eu-west-2')

Additional context This bug is the inconsistency between the documentation and what's supported. Function and docs need to be reconciled.

christianbmadsen avatar Apr 01 '22 15:04 christianbmadsen

Calling device.DEVICE_REGIONS does not return anything by design. Pushed: https://github.com/aws/amazon-braket-sdk-python/pull/321 A follow up fix is needed for including a device.regions property. This is being discussed to align on the implementation details.

AbeCoull avatar Apr 05 '22 18:04 AbeCoull

Resolving since this has been fixed by #321

kshitijc avatar May 24 '23 22:05 kshitijc