Skip to content

Optimize resource estimator pipeline#9021

Open
austingmhuang wants to merge 4 commits intomasterfrom
optimize_estimate
Open

Optimize resource estimator pipeline#9021
austingmhuang wants to merge 4 commits intomasterfrom
optimize_estimate

Conversation

@austingmhuang
Copy link
Contributor

Context:
The _update_counts_from_compressed_res_ops was doing brute force recursive tree traversal, which scales exponentially. As the recursive depth increases, this will lead to serious performance degradation.

Description of the Change:
We implement memoization to reduce the time complexity to polynomial.

Benefits:
Dramatic speed up of XAS notebook from 3 minutes to 4 seconds.

Possible Drawbacks:
None

Related GitHub Issues:

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.44%. Comparing base (51e257d) to head (4be5b05).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
pennylane/estimator/estimate.py 97.56% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9021      +/-   ##
==========================================
- Coverage   99.44%   99.44%   -0.01%     
==========================================
  Files         601      601              
  Lines       64883    64917      +34     
==========================================
+ Hits        64523    64555      +32     
- Misses        360      362       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant