Skip to content
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
2 changes: 1 addition & 1 deletion src/braket/devices/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Devices:
class _Amazon(StrEnum):
SV1 = "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
TN1 = "arn:aws:braket:::device/quantum-simulator/amazon/tn1"
_TN1 = "arn:aws:braket:::device/quantum-simulator/amazon/tn1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why private rather than removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently the pattern for all retired devices in this file. The idea is that this would prevent retired devices from showing up in API docs or IDE autocomplete, but still keep a visible record in case users were relying on it. Open to other suggestions though; probably we shouldn't just accumulate these forever.

DM1 = "arn:aws:braket:::device/quantum-simulator/amazon/dm1"

class _AQT(StrEnum):
Expand Down
3 changes: 0 additions & 3 deletions src/braket/tracking/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ def _get_simulator_task_cost(task_arn: str, details: dict) -> Decimal:
else:
product_family = "Simulator Task"
operation = "CompleteTask"
if details["status"] == "FAILED" and device_name == "TN1":
# Rehearsal step of TN1 can fail and charges still apply.
operation = "FailedTask"

search_dict = {
"Region Code": task_region,
Expand Down
3 changes: 1 addition & 2 deletions test/integ_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@

SV1_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
DM1_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/dm1"
TN1_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/tn1"
SIMULATOR_ARNS = [SV1_ARN, DM1_ARN, TN1_ARN]
SIMULATOR_ARNS = [SV1_ARN, DM1_ARN]

job_complete_name = "".join(random.choices(string.ascii_lowercase + string.digits, k=12))
job_fail_name = "".join(random.choices(string.ascii_lowercase + string.digits, k=12))
Expand Down
92 changes: 0 additions & 92 deletions test/integ_tests/test_tensor_network_simulator.py

This file was deleted.

1 change: 0 additions & 1 deletion test/unit_tests/braket/aws/common_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
SV1_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
DM1_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/dm1"
TN1_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/tn1"
XANADU_ARN = "arn:aws:braket:us-east-1::device/qpu/xanadu/Borealis"

RIGETTI_REGION = "us-west-1"
Expand Down
9 changes: 4 additions & 5 deletions test/unit_tests/braket/aws/test_aws_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
RIGETTI_ARN,
RIGETTI_REGION,
SV1_ARN,
TN1_ARN,
run_and_assert,
run_batch_and_assert,
)
Expand Down Expand Up @@ -977,7 +976,7 @@ def test_device_simulator_not_found():
"Error": {
"Code": "ResourceNotFoundException",
"Message": (
"Braket device 'arn:aws:braket:::device/quantum-simulator/amazon/tn1' "
"Braket device 'arn:aws:braket:::device/quantum-simulator/amazon/dm1' "
"not found in us-west-1. You can find a list of all supported device "
"ARNs and the regions in which they are available in the documentation: "
"https://docs.aws.amazon.com/braket/latest/developerguide/braket-devices.html"
Expand All @@ -1001,7 +1000,7 @@ def test_device_qpu_not_found(mock_copy_session):
"Error": {
"Code": "ResourceNotFoundException",
"Message": (
"Braket device 'arn:aws:braket:::device/quantum-simulator/amazon/tn1' "
"Braket device 'arn:aws:braket:::device/quantum-simulator/amazon/dm1' "
"not found in us-west-1. You can find a list of all supported device "
"ARNs and the regions in which they are available in the documentation: "
"https://docs.aws.amazon.com/braket/latest/developerguide/braket-devices.html"
Expand All @@ -1025,7 +1024,7 @@ def test_device_qpu_exception(mock_copy_session):
"Error": {
"Code": "ResourceNotFoundException",
"Message": (
"Braket device 'arn:aws:braket:::device/quantum-simulator/amazon/tn1' "
"Braket device 'arn:aws:braket:::device/quantum-simulator/amazon/dm1' "
"not found in us-west-1. You can find a list of all supported device "
"ARNs and the regions in which they are available in the documentation: "
"https://docs.aws.amazon.com/braket/latest/developerguide/braket-"
Expand Down Expand Up @@ -1851,7 +1850,7 @@ def test_get_devices_simulators_only(mock_copy_session, aws_session):
session_for_region.get_device.side_effect = ValueError("should not be reachable")
mock_copy_session.return_value = session_for_region
results = AwsDevice.get_devices(
arns=[SV1_ARN, TN1_ARN],
arns=[SV1_ARN, DM1_ARN],
types=["SIMULATOR"],
provider_names=["Amazon Braket"],
statuses=["ONLINE"],
Expand Down
12 changes: 1 addition & 11 deletions test/unit_tests/braket/tracking/test_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ def test_receive_fake_event(empty_tracker):
_TaskCreationEvent(
arn="notjob_sim_task:::region", shots=0, is_job_task=False, device="simulator/bar"
),
_TaskCreationEvent(
arn="task_fail:::region", shots=0, is_job_task=False, device="simulator/tn1"
),
_TaskCreationEvent(
arn="task_cancel:::region", shots=0, is_job_task=False, device="simulator/baz"
),
Expand Down Expand Up @@ -114,7 +111,6 @@ def test_receive_fake_event(empty_tracker):
_TaskCompletionEvent(
arn="notjob_sim_task:::region", execution_duration=1729, status="COMPLETED"
),
_TaskCompletionEvent(arn="task_fail:::region", execution_duration=12345, status="FAILED"),
_TaskCompletionEvent(arn="task_cancel:::region", execution_duration=None, status="CANCELLED"),
_TaskCompletionEvent(
arn="unbilled_task0:::region",
Expand Down Expand Up @@ -186,7 +182,7 @@ def test_qpu_task_cost(price_mock, completed_tracker):
def test_simulator_task_cost(price_mock, completed_tracker):
price_mock.return_value = [{"PricePerUnit": "6.0", "Currency": "USD", "Unit": "minutes"}]
cost = completed_tracker.simulator_tasks_cost()
expected = Decimal("0.0001") * (3000 + 3000 + 12345)
expected = Decimal("0.0001") * (3000 + 3000)
assert cost == expected

price_mock.return_value = []
Expand All @@ -213,12 +209,6 @@ def test_quantum_task_statistics(completed_tracker):
"execution_duration": timedelta(seconds=1, microseconds=852000),
"billed_execution_duration": timedelta(seconds=6),
},
"simulator/tn1": {
"shots": 0,
"tasks": {"FAILED": 1},
"execution_duration": timedelta(seconds=12, microseconds=345000),
"billed_execution_duration": timedelta(seconds=12, microseconds=345000),
},
"simulator/baz": {"shots": 0, "tasks": {"CANCELLED": 1}},
"qpu/Ibex-Q1": {"shots": 100, "tasks": {"CREATED": 1}},
"qpu/2000Qxyz": {"shots": 100, "tasks": {"CREATED": 1}},
Expand Down
Loading