Skip to content

Conversation

david-pl
Copy link
Collaborator

@david-pl david-pl commented Oct 1, 2025

Closes #497

I had to cut down support for some cirq features in lowering, but I don't think they were used heavily. For example, we no longer have CZPowGate with arbitrary exponents or arbitrary controlled operations.

Also, one more significant breaking change is that func.Invoke statements are no longer emitted as CircuitOperation, but are added to the circuit flat-out. I think this matches user expectations and otherwise would have been really odd given our new approach with stdlib functions.

Finally, noise still needs to be done, but that is pending #495, which should be merged first, I think.

Edit: Noise is also done now, but I also had to cut support for AmplitudeDampingChannel, since we can't really represent this with the current statements in the noise dialect (I think). However, I haven't seen this used anywhere so far, so I'd suggest we wait for someone to actually require that feature.

@david-pl david-pl requested a review from Roger-luo October 1, 2025 13:17
@david-pl david-pl added the breaking breaking changes or proposed changes that would break existing APIs label Oct 1, 2025
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 91.20000% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bloqade/cirq_utils/lowering.py 91.89% 12 Missing ⚠️
src/bloqade/cirq_utils/emit/noise.py 77.77% 6 Missing ⚠️
src/bloqade/cirq_utils/emit/base.py 80.00% 3 Missing ⚠️
src/bloqade/cirq_utils/emit/clifford.py 98.24% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Oct 2, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11111 9251 83% 0% 🟢

New Files

File Coverage Status
src/bloqade/cirq_utils/emit/clifford.py 98% 🟢
TOTAL 98% 🟢

Modified Files

File Coverage Status
src/bloqade/cirq_utils/emit/init.py 100% 🟢
src/bloqade/cirq_utils/emit/base.py 93% 🟢
src/bloqade/cirq_utils/emit/noise.py 83% 🟢
src/bloqade/cirq_utils/emit/qubit.py 88% 🟢
src/bloqade/cirq_utils/lowering.py 93% 🟢
TOTAL 91% 🟢

updated for commit: 6ba3ccf by action🐍

@david-pl david-pl marked this pull request as ready for review October 2, 2025 12:07
@weinbe58
Copy link
Member

weinbe58 commented Oct 6, 2025

@Roger-luo @david-pl This PR has to go before #518 because qubit.new touches a alot of the code base including cirq lowering.

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, @Roger-luo, I know we had discussed doc-strings on the new API, but here all the visitor methods and interpreter methods are not Private. Should we mark the classes as private in this case?

@david-pl
Copy link
Collaborator Author

david-pl commented Oct 7, 2025

@weinbe58 @Roger-luo I went ahead and marked the method tables as private, since there's really no point in having those public. I'm not so sure about the target classes themselves though, so let me know how to proceed here.

I'll still go ahead and merge so as to not block other progress in the refactor. We can still change this during the refactor to make it private or add docstrings.

@david-pl david-pl merged commit 0480e3e into main Oct 7, 2025
11 checks passed
@david-pl david-pl deleted the david/497-refactor-cirq branch October 7, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking breaking changes or proposed changes that would break existing APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

re-implementing the SQUIN <-> Cirq pass

2 participants