[QRE] Dollar cost calculator - #3672
Closed
Dima Fedoriaka (fedimser) wants to merge 6 commits into
Closed
Conversation
Dima Fedoriaka (fedimser)
marked this pull request as ready for review
September 1, 2026 17:51
Copilot started reviewing on behalf of
Dima Fedoriaka (fedimser)
September 1, 2026 17:52
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Python Quantum Resource Estimator (QRE) surface area to optionally compute and display an estimated monetary cost (USD) for each Pareto-optimal estimate, based on user-provided pricing logic on the target Architecture.
Changes:
- Adds a
cost_usdfield toEstimationTableEntryand threads cost computation through result materialization. - Conditionally adds a
"USD cost"column to the results table/DataFrame when at least one estimate has a computable cost. - Adds a unit test and a sample notebook demonstrating how to set
usd_cost_per_hourto enable runtime-proportional costing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| source/qdk_package/tests/qre/test_estimation.py | Adds a test asserting that results include a "USD cost" column when pricing is configured. |
| source/qdk_package/qdk/qre/_results.py | Adds cost_usd to EstimationTableEntry and computes it during from_result. |
| source/qdk_package/qdk/qre/_estimation.py | Conditionally adds the "USD cost" column to the output table. |
| source/qdk_package/qdk/qre/_architecture.py | Introduces usd_cost_per_hour, a default cost_usd hook, and exposes arch on ISAContext. |
| samples/qre/dollar_cost.ipynb | Adds a demo notebook showing USD cost estimation in practice. |
Suppressed comments (2)
source/qdk_package/qdk/qre/_architecture.py:76
- The
cost_usddocstring contains a typo/formatting issue (usd_cost_per_hour``) that makes the API guidance confusing.
Subclasses need to define usd_`cost_per_hour` (if USD cost is proportional to
runtime) or override `cost_usd`.
source/qdk_package/qdk/qre/_architecture.py:85
- Typo in docstring: "applicaiton" → "application".
Otherwise, returns estimated cost of running an applicaiton, in dollars.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Dima Fedoriaka (fedimser)
September 1, 2026 19:05
View session
Dima Fedoriaka (fedimser)
requested review from
Yingrong Chen (YingrongChen) and
Alexis W. Mills (awoodwa)
September 1, 2026 20:39
Contributor
Author
|
This is not correct domain model, because costs belong to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds capability to Quantum Resource Estimator to compute monetary cost (in USD) of running an application.
User needs to specify how to compute USD cost for a specific Architecture, as a function of qubits and runtime. This can be done in multiple ways:
usd_cost_per_houron Architecture object (see demo notebook). In this case it's assumed that the cost is proportional to runtime.@qubitdecorator, addingusd_cost_per_hour = ....cost_usdon subclass ofArchitecture.In the resource estimator, if cost can be computed for at least one of estimates in the table, the table will have an additional column "USD cost", with estimated cost of running the application, rounded to 2 decimal digits.