Skip to content

[QRE] Dollar cost calculator - #3680

Open
Dima Fedoriaka (fedimser) wants to merge 9 commits into
mainfrom
fedimser/cost-calc-3
Open

[QRE] Dollar cost calculator#3680
Dima Fedoriaka (fedimser) wants to merge 9 commits into
mainfrom
fedimser/cost-calc-3

Conversation

@fedimser

@fedimser Dima Fedoriaka (fedimser) commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
  • Added abstract class DollarCostModel that represent a mathematical function that takes resource physical estimates (number of qubits and runtime) and returns dollar cost.
    • The plan is to add this to Target in the future.
  • Added dataclass CostSpec which serves as JSON schema for JSON files that can be used to describe cost specification of a quantum computer.
  • Added class DollarCostModelFromSpec that implements DollarCostModel using cost spec loaded from JSON file.
  • Added method EstimationTable.add_cost_column that computes dollar cost for every entry in the table:
    • You can pass arbitrary DollarCostModel there using keyword cost_model.
    • Or you can pass cost_spec which must be path to JSON file using schema specified by CostSpec.
  • Added an example JSON spec and notebook using EstimationTable.add_cost_column.
  • Added optional (for QRE only) dependency on dataclasses-json, for automatic conversion from JSON to CostSpec dataclass.
  • Example: https://github.com/microsoft/qdk/blob/17d2462362108d4df96f98a3863110ff2a69e3e2/samples/qre/dollar_cost.ipynb

# Libraries that need to be installed to run Python static checks.
azure-quantum>=3.8.0
cirq-core>=1.6.1,<1.7
dataclasses-json>=0.6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it worth to add an extra dependency? How would the code change if you don't add this dependency?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants