Skip to content

Conversation

@johnzl-777
Copy link
Contributor

@johnzl-777 johnzl-777 commented Dec 1, 2025

This is what I think should be sufficient for TerminalLogicalMeasurement Validation.

I enforce the following conditions:

  1. A program should only ever have ONE TerminalLogicalMeasurement
  2. all spawned qubits should be consumed in that one terminal measurement. There should be no dangling qubits.

There are some additions that come to mind - ranging from immediately relevant to some things that are further out in terms of infrastructure:

  • I had to make a separate validation pass as opposed to tacking things onto the current logical validation. I think because of this "logical validation" should be renamed to something a bit more precise.
  • AddressAnalysis already counts the number of (unique) qubits spawned but there's no way to access that information directly. It would be nice if there was some way to attach that to the final frame returned at the end of the analysis. Currently I tally up unique qubit ids and compare that against the number of things fed into the terminal measurement

@johnzl-777 johnzl-777 self-assigned this Dec 1, 2025
@johnzl-777 johnzl-777 linked an issue Dec 1, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 94.38202% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...de/gemini/analysis/measurement_validation/impls.py 88.23% 4 Missing ⚠️
src/bloqade/analysis/measure_id/impls.py 92.85% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
10477 9216 88% 0% 🟢

New Files

File Coverage Status
src/bloqade/gemini/analysis/measurement_validation/init.py 100% 🟢
src/bloqade/gemini/analysis/measurement_validation/analysis.py 100% 🟢
src/bloqade/gemini/analysis/measurement_validation/impls.py 88% 🟢
TOTAL 96% 🟢

Modified Files

File Coverage Status
src/bloqade/analysis/measure_id/impls.py 94% 🟢
src/bloqade/gemini/dialects/logical/groups.py 100% 🟢
TOTAL 97% 🟢

updated for commit: dc6ffdd by action🐍

@johnzl-777 johnzl-777 marked this pull request as ready for review December 1, 2025 14:00
Copy link
Collaborator

@david-pl david-pl left a comment

Choose a reason for hiding this comment

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

Looks good, but I'm not sure about some stuff (see comments).

@weinbe58 weinbe58 assigned weinbe58 and unassigned johnzl-777 Dec 3, 2025
Copy link
Member

@weinbe58 weinbe58 left a comment

Choose a reason for hiding this comment

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

overall looks good 🚀 just a few comments to address

Copy link
Member

Choose a reason for hiding this comment

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

To fix the circular import put this validation inside logical folder since this is only a logical program validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By extension that would also mean that the current logical_validation should also go in there as well? Just as a heads up I'll be splitting up the rules in logical_validation right after this PR (so the scf, gate, and func impls are separate validations you can compose)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gave it a shot, didn't play nice ): Willing to revisit in a subsequent PR though, that will involve shuffling more things around anyways

@weinbe58 weinbe58 assigned johnzl-777 and unassigned weinbe58 Dec 3, 2025
Copy link
Member

@weinbe58 weinbe58 left a comment

Choose a reason for hiding this comment

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

LGTM

@weinbe58 weinbe58 merged commit 76399c1 into main Dec 4, 2025
11 of 12 checks passed
@weinbe58 weinbe58 deleted the 610-terminalmeasure-validation branch December 4, 2025 21:46
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.

TerminalMeasure Validation.

4 participants