Greedy Scheduling Algorithm, Feedforward Optimization, and Additional Pattern metrics#131
Greedy Scheduling Algorithm, Feedforward Optimization, and Additional Pattern metrics#131
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
==========================================
- Coverage 76.05% 74.00% -2.05%
==========================================
Files 21 22 +1
Lines 2209 2497 +288
Branches 378 454 +76
==========================================
+ Hits 1680 1848 +168
- Misses 456 564 +108
- Partials 73 85 +12 🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
graphqomb/greedy_scheduler.py
Outdated
| for node in to_measure: | ||
| for neighbor in neighbors_map[node]: | ||
| if neighbor not in prepared: | ||
| prepare_time[neighbor] = current_time | ||
| prepared.add(neighbor) |
There was a problem hiding this comment.
Prepare measured nodes when neighbors already prepared
The greedy schedulers never assign a preparation time to the node being measured; the loop only schedules its neighbors. When a candidate’s neighbors are already in prepared (e.g., the first non‑input node in the DAG is only adjacent to inputs), the block at lines 110‑114 leaves that measured node out of prepare_time, so solve_schedule(use_greedy=True) records None for its prep time. validate_schedule then fails with “Nodes … have no preparation time scheduled” and entanglement auto‑scheduling cannot run, even though a valid schedule exists. The same neighbor‑only preparation appears in greedy_minimize_space (lines 272‑277).
Useful? React with 👍 / 👎.
…_time Add alap_prepare_times() function that recomputes preparation times using ALAP (As Late As Possible) strategy. Given fixed measurement times, this computes the latest possible preparation time for each node while respecting neighbor constraints. Changes: - Add alap_prepare_times() function to greedy_scheduler.py - Apply ALAP post-processing in _greedy_minimize_time_unlimited() - Apply ALAP post-processing in _greedy_minimize_time_limited() - Update and add test cases for ALAP behavior This reduces active volume (sum of qubit lifetimes) without changing the measurement schedule or depth. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The greedy scheduler will be implemented in #158 . Thus, this PR is closed. |
Before submitting, please check the following:
pytest)ruffmypyandpyrightmake htmlin./docs/- you may need to install dependency for sphinx docs, seedocs/requirements.txt.)Then, please fill in below:
Description of the change:
This PR significantly enhances the MBQC pattern scheduling functionality
and adds feedforward optimization capabilities.
alternatives to CP-SAT solver (updated the previous algorithms I have implemented in Graphix)
feedforward optimization
Related issue: