Skip to content

Refactor Gemini simulator tasks around backend objects#790

Draft
Krastanov-agent wants to merge 6 commits into
QuEraComputing:mainfrom
Krastanov-agent:issue-789-simulator-backends
Draft

Refactor Gemini simulator tasks around backend objects#790
Krastanov-agent wants to merge 6 commits into
QuEraComputing:mainfrom
Krastanov-agent:issue-789-simulator-backends

Conversation

@Krastanov-agent

Copy link
Copy Markdown

Draft PR for #789.

cc @Krastanov

Summary

  • add a minimal simulator backend layer with Tsim, CliffT, and PyQrack backends
  • move logical and physical simulator config from task() into simulator constructors
  • route logical and physical task run() through backend sampling with consistent signatures
  • add GeminiPhysicalSimulator while keeping PhysicalSimulator as a compatibility alias
  • update demos for the new constructor-owned config/backend API

Breaking changes

  • GeminiLogicalSimulator.task() now takes only the application kernel; m2dets and m2obs are simulator constructor arguments
  • physical simulator task() now takes only the physical kernel; placement and annotation config are simulator constructor arguments
  • GeminiLogicalSimulator(backend="clifft", seed=...) is replaced by GeminiLogicalSimulator(backend=CliffTSimulatorBackend(seed=...))

Verification

  • uv sync --locked --dev --all-extras --index-strategy=unsafe-best-match
  • uv run --locked pytest python/tests/ -q -> 1520 passed, 9 skipped
  • uv run --locked ruff check ... on touched files
  • uv run --locked black --check --target-version py312 ... on touched files
  • uv run --locked pyright python/bloqade/gemini/device python/bloqade/gemini/decoding/experiments.py

Notes

  • PyQrack records raw measurement samples and uses Tsim for detector error model generation so public result containers keep a DEM when available.
  • Tsim-specific compatibility properties (tsim_circuit, samplers) remain available for Tsim-compatible backends because decoding utilities still use them.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.29437% with 64 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
python/bloqade/gemini/device/simulator_backend.py 74.12% 37 Missing ⚠️
python/bloqade/gemini/device/physical_simulator.py 54.34% 21 Missing ⚠️
python/bloqade/gemini/device/simulator.py 85.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

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