Repository navigation
changed Pauli summation to use finite state machine construction - #308
Conversation
…lkit/yaqs into pauli-upgrade
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughReplaces the internal MPO.from_pauli_sum implementation: direct-sum construction is replaced by a finite state machine (FSM) based assembly; internal helper methods were removed. Changelog and a test that asserted internal behavior were updated accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 14-15: The changelog entry "changed Pauli summation to use finite
state machine construction" is split across lines and not aligned with the
project template; update that entry so the title, PR link and author link are on
a single line using the template format: include the PR as
([`#308`](https://github.com/…/pull/308)) and the author as
([**aaronleesander**](https://github.com/aaronleesander)), removing any separate
issue references and combining the pieces into one line for the entry.
In `@src/mqt/yaqs/core/data_structures/networks.py`:
- Around line 1417-1431: The loop in the term-parsing block (iterating over
terms and calling self._parse_pauli_string) currently processes even
zero-coefficient terms; modify the loop in the method that fills parsed_terms so
it first checks the term coefficient (coeff) and skips appending or parsing when
coeff is exactly zero (or effectively zero using a small epsilon for
floats/complex), i.e., do not call self._parse_pauli_string or build op_list for
such terms; ensure the check happens before validating sites or using
self._VALID so parsed_terms only receives nonzero contributions.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Aaron Sander <61705296+aaronleesander@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 14: The changelog entry line "Changed Pauli summation to use finite state
machine construction ([`#308`]) ([**@aaronleesander**])" has a broken PR
reference; replace the backticked reference with the proper PR reference format
and follow the project template: change "([`#308`])" to "([`#308`])" (or use an
inline link like
"([`#308`](https://github.com/munich-quantum-toolkit/yaqs/pull/308))") and ensure
the author remains as
"([**@aaronleesander**](https://github.com/aaronleesander))" to match other
entries (update the PR link URL if you choose the inline form).
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Description
This pull request updates the construction of Hamiltonian MPOs from Pauli Strings to use a more standard finite state machine construction.
This leads to a significant speedup, especially for larger systems.
Checklist: