Skip to content

Comments

Add TICK command and edge scheduler for temporal scheduling#126

Merged
masa10-f merged 42 commits intomasterfrom
edge-scheduler
Nov 13, 2025
Merged

Add TICK command and edge scheduler for temporal scheduling#126
masa10-f merged 42 commits intomasterfrom
edge-scheduler

Conversation

@masa10-f
Copy link
Collaborator

@masa10-f masa10-f commented Oct 28, 2025

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

Context:

This PR implements temporal scheduling features for MBQC (Measurement-Based Quantum Computing) patterns. The TICK command provides time slice boundary markers, and the edge scheduler automatically schedules entanglement operations based on node preparation times.

Description of the change:

This PR introduces two major features:

  1. TICK Command: A time slice boundary marker that enables temporal scheduling in MBQC patterns

    • Added TICK command type to mark boundaries between time slices
    • Integrated TICK command handling in PatternSimulator (no-op for quantum state)
    • Integrated TICK command processing in Stim compiler (outputs TICK instruction)
  2. Edge Scheduler: Automatic entanglement operation scheduling based on node preparation times

    • Added entangle_time attribute to Scheduler for tracking entanglement operation timing
    • Added auto_schedule_entanglement() method to automatically schedule CZ gates when both nodes are prepared
    • Added detailed_timeline property for comprehensive scheduling information including entanglement operations
    • Added entanglement time validation in schedule validation
    • Extended compress_schedule() function to support entanglement time compression
  3. Scheduler Integration: Enhanced qompile() to support temporal scheduling

    • Added scheduler parameter to qompile() for custom scheduling
    • Added insert_tick parameter to enable TICK command insertion between time slices
    • Automatically inserts TICK commands between time slices when scheduler is provided
  4. Tests: Added comprehensive test suite

    • Added test_simulator_with_tick_commands() for TICK command handling in PatternSimulator
    • Added test_stim_compile_with_tick_commands() for TICK command compilation to Stim format
    • Extended scheduler integration tests with comprehensive edge scheduling validation
  5. Examples: Added entanglement_scheduling_demo.py demonstrating edge scheduler features

All tests pass (220 tests), and code quality checks (mypy, pyright, ruff) pass successfully.

Related issue:

Closes #99

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 73.52941% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.32%. Comparing base (933eb4a) to head (0302898).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   68.35%   74.32%   +5.97%     
==========================================
  Files          21       21              
  Lines        2035     2154     +119     
  Branches      326      360      +34     
==========================================
+ Hits         1391     1601     +210     
+ Misses        592      478     -114     
- Partials       52       75      +23     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@masa10-f masa10-f added the enhancement New feature or request label Oct 28, 2025
@masa10-f masa10-f self-assigned this Oct 28, 2025
@masa10-f masa10-f requested a review from d1ssk November 10, 2025 13:41
@masa10-f
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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".

@masa10-f masa10-f requested a review from d1ssk November 12, 2025 11:37
@masa10-f masa10-f merged commit e185012 into master Nov 13, 2025
23 checks passed
@masa10-f masa10-f deleted the edge-scheduler branch November 13, 2025 05:10
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.

Edge Scheduler

2 participants