Use Tracker to track number of tasks in LocalSimulator
Describe the feature you'd like Currently, the Tracker counts the number of on-demand tasks, but not LocalSimulator tasks. For example
from braket.aws import AwsDevice
from braket.circuits import Circuit
from braket.tracking import Tracker
circ = Circuit().h(0).cnot(0,1)
device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
with Tracker() as tracker:
task = device.run(circ, shots=1000).result()
print(tracker.quantum_tasks_statistics())
>> {'arn:aws:braket:::device/quantum-simulator/amazon/sv1':
{'shots': 1000,
'tasks': {'COMPLETED': 1},
'execution_duration': datetime.timedelta(microseconds=4000),
'billed_execution_duration': datetime.timedelta(seconds=3)}}
print(tracker.simulator_tasks_cost())
>> $0.00375
The proposal is to add this functionality to track task counts on local simulator like this:
from braket.aws import AwsDevice
from braket.circuits import Circuit
from braket.tracking import Tracker
from braket.devices import LocalSimulator
circ = Circuit().h(0).cnot(0,1)
device = LocalSimulator()
with Tracker() as tracker:
task = device.run(circ, shots=1000).result()
print(tracker.quantum_tasks_statistics())
>> {'braket:local/simulator':
{'shots': 1000,
'tasks': {'COMPLETED': 1},
'execution_duration': datetime.timedelta(microseconds=4000),
'billed_execution_duration': None}}
print(tracker.simulator_tasks_cost())
>> $0
Hi! I would like to work on this task as part of unitaryhack.
Hi! I would like to work on this task as part of unitaryhack.
Hi @njones93531, thanks for your interest! Feel free to create a PR with your changes and we will be happy to review it and provide feedback.
Hello! I think I've got a change for this that should be working. I am currently seeing this issue when attempting to run integ tests.
INTERNALERROR> botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the CreateJob operation: This account is not authorized to use this resource. In order to access additional resources, please contact customer support
Looks like others have seen this issue before, too. I have explored the issue and solutions posted online pretty exhaustively, and now cut a support ticket to AWS to address it. Hopefully I will hear back on that soon, be able to run the integ tests, and submit a PR for this issue. We will probably want a second revision on that PR before merging, too, as there are a few details that may need ironing out.