Skip to content

Framework for Placement Analysis and Move heuristics. #23

Merged
weinbe58 merged 14 commits intomainfrom
14-move-analysis-for-fixed-qubit-location
Nov 12, 2025
Merged

Framework for Placement Analysis and Move heuristics. #23
weinbe58 merged 14 commits intomainfrom
14-move-analysis-for-fixed-qubit-location

Conversation

@weinbe58
Copy link
Copy Markdown
Member

This PR implements a few large changes:

  1. Adds an explicit measurement statement to the static circuit library. The main reason for this is because there needs to be a statement that can be used to rewrite to the move-level measurement semantics.
  2. Merges some dialects together and renaming some of the statements.
  3. Adds a analysis framework for atom placement. This new analysis framework decouples the path and move scheduling from atom placement to simplify the heuristics a bit. If we feel like we need to merge them back we can update the lattice elements.
  4. A series of rewrite rules along with a framework for generating move schedules. The idea here is that the moves can be calculated between an initial and final configuration of the qubits so the rewrite are very easy compose. There is a rewrite to insert moves between two atom configurations and then there is a rewrite that is used to insert the moves that makes sure the atoms are in the same initial configuration when exiting the StaticCircuit region.

@weinbe58 weinbe58 linked an issue Nov 12, 2025 that may be closed by this pull request
@weinbe58 weinbe58 changed the title Framework for Placement Analysis. Framework for Placement Analysis and Move heuristics. Nov 12, 2025
@weinbe58 weinbe58 requested a review from Copilot November 12, 2025 22:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Measurement and Yield statements to the static circuit library for move-level semantics
  • Consolidates dialects: merges execute.ExecuteLowLevel and cpu.StaticFloat into circuit.StaticCircuit and circuit.ConstantFloat
  • Introduces placement analysis framework with AtomState lattice and PlacementStrategy abstraction 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.

weinbe58 and others added 3 commits November 12, 2025 17:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@weinbe58 weinbe58 merged commit 94ffd4b into main Nov 12, 2025
5 of 8 checks passed
@weinbe58 weinbe58 deleted the 14-move-analysis-for-fixed-qubit-location branch November 12, 2025 23:06
@weinbe58 weinbe58 self-assigned this Jan 16, 2026
Sign up for free to 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.

2 participants