Skip to content

Branch selection - #300

Merged
thierry-martinez merged 21 commits into
TeamGraphix:masterfrom
thierry-martinez:branch_selector
Aug 2, 2025
Merged

Branch selection#300
thierry-martinez merged 21 commits into
TeamGraphix:masterfrom
thierry-martinez:branch_selector

Conversation

@thierry-martinez

Copy link
Copy Markdown
Collaborator

This commit adds an abstract class BranchSelector and the following branch selection strategies:

  • RandomBranchSelector, which corresponds to the strategy that was already implemented.

  • FixedBranchSelector, for a selector where a dictionary sets the outcome for each measurement.

  • ConstBranchSelector, for a selector that always returns the same outcome, whatever the measurement is.

This commit adds an abstract class `BranchSelector` and the following
branch selection strategies:
- `RandomBranchSelector`, which corresponds to the strategy that was
already implemented.
- `FixedBranchSelector`, for a selector where a dictionary sets the
outcome for each measurement.
- `ConstBranchSelector`, for a selector that always returns the same
outcome, whatever the measurement is.
@codecov

codecovBot commented Jun 10, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.39496% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.28%. Comparing base (ff63f49) to head (2dab444).
⚠️ Report is 1 commits behind head on master.

Files with missing linesPatch %Lines
graphix/simulator.py65.00%14 Missing ⚠️
graphix/sim/tensornet.py91.66%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #300 +/- ##
==========================================
- Coverage 79.36% 79.28% -0.08% 
==========================================
Files 39 40 +1 Lines 5733 5794 +61 ==========================================
+ Hits 4550 4594 +44 - Misses 1183 1200 +17 

☔ 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.

@EarlMilktea

Copy link
Copy Markdown
Contributor

@thierry-martinez I'm not against the concept of this PR but I cannot sure whether it is appropriate to introduce this feature to the untyped/obsolete simulators.

@thierry-martinez

Copy link
Copy Markdown
CollaboratorAuthor

Granted. I just opened #312, which will hopefully help unblock this.

@thierry-martinez

Copy link
Copy Markdown
CollaboratorAuthor

Branch selection is now ready for review with the typed simulator!

Comment threadgraphix/branch_selector.py Outdated
Comment threadgraphix/branch_selector.py Outdated
Comment threadgraphix/branch_selector.py Outdated
Comment threadgraphix/simulator.py
Comment threadgraphix/branch_selector.py Outdated
Comment threadtests/test_branch_selector.py Outdated
@thierry-martinez

Copy link
Copy Markdown
CollaboratorAuthor

Thanks, @EarlMilktea, for your review!

@shinich1, I updated the documentation. Could you take a look at this PR and let us know what you think? Thanks!

@shinich1shinich1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay, looks great.

Sign up for freeto 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.

3 participants

@thierry-martinez@EarlMilktea@shinich1