Skip to content

Clean up recent changes in sub_state_vector#8081

Merged
pavoljuhas merged 5 commits into
quantumlib:mainfrom
pavoljuhas:sub-state-vector-amends
May 15, 2026
Merged

Clean up recent changes in sub_state_vector#8081
pavoljuhas merged 5 commits into
quantumlib:mainfrom
pavoljuhas:sub-state-vector-amends

Conversation

@pavoljuhas
Copy link
Copy Markdown
Collaborator

  • Verify the maximum eigenvalue is indeed close to 1.

  • Enable arbitrary order of keep_indices as before.

  • Use the same tolerance check as before Sub state vector #8077 with rtol=0.
    This allows to restore previous tests instead of having
    to do them with larger state vector deviation.

  • Put back RaiseValueErrorIfNotProvided as a default for sub_state_vector.
    This allows using None for the fallback return value.

  • Add check for negative values in keep_indices.

Follow-up to #8077

In `sub_state_vector` use the same tolerance check as was there before
with `approx_eq` which has rtol=0.

Also verify the maximum eigenvalue is indeed close to 1.
Allow using `None` as a fallback return value of `sub_state_vector`.
Restore behavior as before quantumlib#8077.  Also drop duplicate variable.
@pavoljuhas pavoljuhas requested a review from a team as a code owner May 15, 2026 22:24
@pavoljuhas pavoljuhas requested a review from tanujkhattar May 15, 2026 22:24
@github-actions github-actions Bot added the size: M 50< lines changed <250 label May 15, 2026
@pavoljuhas pavoljuhas requested a review from NoureldinYosri May 15, 2026 22:31
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.63%. Comparing base (02e927f) to head (c0484cf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8081   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files        1110     1110           
  Lines      100074   100074           
=======================================
  Hits        99712    99712           
  Misses        362      362           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavoljuhas pavoljuhas added this pull request to the merge queue May 15, 2026
Merged via the queue into quantumlib:main with commit 7228447 May 15, 2026
44 checks passed
@pavoljuhas pavoljuhas deleted the sub-state-vector-amends branch May 15, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants