Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Tracker to track number of tasks in LocalSimulator #975

Open
mbeach-aws opened this issue May 10, 2024 · 2 comments
Open

Use Tracker to track number of tasks in LocalSimulator #975

mbeach-aws opened this issue May 10, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@mbeach-aws
Copy link
Contributor

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
@rmshaffer rmshaffer added the good first issue Good for newcomers label May 14, 2024
@njones93531
Copy link

Hi! I would like to work on this task as part of unitaryhack.

@rmshaffer
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants