Skip to content

Instantly share code, notes, and snippets.

@hariby
Created January 21, 2021 03:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hariby/3ccfa965be98a145957d17d2c3d3482b to your computer and use it in GitHub Desktop.
Save hariby/3ccfa965be98a145957d17d2c3d3482b to your computer and use it in GitHub Desktop.
You can check cost of your recent Amazon Braket tasks (based on the pricing table as of 2021-01-21). Compatible with AWS CloudShell.
aws braket search-quantum-tasks --region us-west-2 --filters 'name=deviceArn,operator=EQUAL,values=arn:aws:braket:::device/qpu/d-wave/DW_2000Q_6' | jq '.[] | map({quantumTaskArn: .quantumTaskArn, price: (.shots * 0.00019 + 0.30000)})'
aws braket search-quantum-tasks --region us-west-2 --filters 'name=deviceArn,operator=EQUAL,values=arn:aws:braket:::device/qpu/d-wave/Advantage_system1' | jq '.[] | map({quantumTaskArn: .quantumTaskArn, price: (.shots * 0.00019 + 0.30000)})'
aws braket search-quantum-tasks --region us-east-1 --filters 'name=deviceArn,operator=EQUAL,values=arn:aws:braket:::device/qpu/ionq/ionQdevice' | jq '.[] | map({quantumTaskArn: .quantumTaskArn, price: (.shots * 0.01000 + 0.30000)})'
aws braket search-quantum-tasks --region us-west-1 --filters 'name=deviceArn,operator=EQUAL,values=arn:aws:braket:::device/qpu/rigetti/Aspen-8' | jq '.[] | map({quantumTaskArn: .quantumTaskArn, price: (.shots * 0.00035 + 0.30000)})'
@Peneheals
Copy link

Thanks! Two minor comments:

  1. It looks like older AWS CLI (like 1.16 etc.) doesn't recognize the "braket" option (there wasn't a service like this in that time). So it is necessary to update to the - almost - latest version or install AWS CLI 2.
  2. If you use a named AWS profile, just add --profile AWSCONFIGNAME before the | jq part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment