Skip to content

Comments

Optimize Dependent Chain Collection Routine in PauliFrame#118

Merged
masa10-f merged 5 commits intomasterfrom
optimize-dependent-chain-collection
Oct 27, 2025
Merged

Optimize Dependent Chain Collection Routine in PauliFrame#118
masa10-f merged 5 commits intomasterfrom
optimize-dependent-chain-collection

Conversation

@masa10-f
Copy link
Collaborator

Before submitting, please check the following:

  • Make sure you have tests for the new code and that test passes (run pytest)
  • If applicable, add a line to the [unreleased] part of CHANGELOG.md, following keep-a-changelog.
  • Format added code by ruff
  • Type checking by mypy and pyright
  • Make sure the checks (github actions) pass.
  • Check that the docs compile without errors (run make html in ./docs/ - you may need to install dependency for sphinx docs, see docs/requirements.txt.)

Then, please fill in below:

Context (if applicable):

The PauliFrame._collect_dependent_chain method was too slow for practical FT-MBQC compilation.

Description of the change:

  • Added Pauli axis cache to avoid redundant basis computations
  • Implemented chain memoization cache to prevent recalculating dependent chains
  • Optimized set operations for better performance in large graph states

Related issue:

NA

@masa10-f masa10-f self-assigned this Oct 27, 2025
@masa10-f masa10-f added the enhancement New feature or request label Oct 27, 2025
@masa10-f masa10-f requested a review from d1ssk October 27, 2025 05:10
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.58%. Comparing base (c2a052e) to head (cff07ea).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #118      +/-   ##
==========================================
+ Coverage   66.81%   67.58%   +0.76%     
==========================================
  Files          21       21              
  Lines        1962     1968       +6     
  Branches      300      300              
==========================================
+ Hits         1311     1330      +19     
+ Misses        603      590      -13     
  Partials       48       48              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@masa10-f masa10-f requested a review from d1ssk October 27, 2025 10:35
Copy link
Collaborator

@d1ssk d1ssk left a comment

Choose a reason for hiding this comment

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

Looks good, huge improvement!

@masa10-f masa10-f merged commit d794b08 into master Oct 27, 2025
23 checks passed
@masa10-f masa10-f deleted the optimize-dependent-chain-collection branch October 27, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants