qBraid / qBraid

A platform-agnostic quantum runtime framework
https://docs.qbraid.com/sdk
GNU General Public License v3.0
69 stars 27 forks source link

qbraid token calculator #222

Closed junliangtan1 closed 2 weeks ago

junliangtan1 commented 1 year ago

What should we have?

A calculator for how much qbraid token estimate spending, we can apply it on top of the device wrapper or calculate with input variable(shots) according to the device.

related to #32 and #33

Implementation

No response

ryanhill1 commented 1 year ago

Agreed! Related to #32.

Right now since the IBMQ devices are free, would only be relevant for Amazon Braket devices, see Amazon Braket pricing. Would be pretty straightforward to implement for the QPUs since they each operate on a per-task / per-shot basis. But on-demand simulator jobs (e.g. SV1, DM1) and hybrid jobs are priced on a per-minute basis, which there isn't a reliable way to estimate up-front. Amazon Braket does have a cost tracker (https://github.com/aws/amazon-braket-sdk-python/pull/404) which can be used to track the cost of simulator tasks as they are going, so maybe could substitute that in for these devices?

ryanhill1 commented 8 months ago

Should be an abstract method estimate_run_cost or similar implemented in the respective QuantumDevice class which returns USD estimate of quantum job.

For Amazon Braket, can potentially do programmatically via https://github.com/amazon-braket/amazon-braket-sdk-python/blob/main/src/braket/tracking/pricing.py

TBD for IBM once pricing rolls out