Framework for Placement Analysis and Move heuristics. #23
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a framework for atom placement analysis and move heuristics in the quantum circuit compilation pipeline. It refactors the dialect structure by merging the execute and cpu dialects into the circuit dialect, and introduces a new analysis framework that decouples atom placement from move scheduling to simplify heuristic implementation.
Key changes:
- Adds explicit
MeasurementandYieldstatements to the static circuit library for move-level semantics - Consolidates dialects: merges
execute.ExecuteLowLevelandcpu.StaticFloatintocircuit.StaticCircuitandcircuit.ConstantFloat - Introduces placement analysis framework with
AtomStatelattice andPlacementStrategyabstraction for computing qubit placements - Implements move generation rewrite rules (
InsertMoves,RewriteCZ,RewriteR,RewriteRz,InsertMeasure) that transform circuit statements to move-level operations
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/rewrite/test_native2circuit.py | Updates tests to use renamed circuit.StaticCircuit and circuit.Yield statements |
| src/bloqade/lanes/types.py | Adds MeasurementFuture type for tracking measurement results |
| src/bloqade/lanes/rewrite/native2circuit.py | Updates rewrite rules for dialect consolidation; implements MergePlacementRegions for combining adjacent static circuits |
| src/bloqade/lanes/rewrite/circuit2move.py | New file implementing move heuristics and rewrite rules for transforming circuit operations to move-level instructions |
| src/bloqade/lanes/layout/encoding.py | Adds ZoneAddress, WordAddress, and SiteAddress encoders for addressing architecture components |
| src/bloqade/lanes/layout/arch.py | Extends ArchSpec with zones field for grouping words into gate zones |
| src/bloqade/lanes/gemini.py | Updates Gemini architecture to include gate zone configuration |
| src/bloqade/lanes/dialects/move.py | Refactors move dialect statements, adding EndMeasure and GetMeasurementResult for measurements |
| src/bloqade/lanes/dialects/execute.py | Deleted: functionality merged into circuit dialect |
| src/bloqade/lanes/dialects/cpu.py | Deleted: StaticFloat moved to circuit.ConstantFloat |
| src/bloqade/lanes/dialects/circuit.py | Consolidates circuit statements; adds QuantumStmt base class, EndMeasure, Yield, and StaticCircuit with placement analysis integration |
| src/bloqade/lanes/analysis/placement/lattice.py | Defines AtomState lattice with ConcreteState tracking atom locations and move counts |
| src/bloqade/lanes/analysis/placement/analysis.py | Implements PlacementAnalysis forward analysis and PlacementStrategy interface |
| src/bloqade/lanes/analysis/placement/init.py | Module initialization exports for placement analysis components |
| pyproject.toml | Updates kirin-toolchain dependency from 0.20.0 to 0.21.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Nov 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a few large changes: