Skip to content

Support merge symbolized 1 qubit gate transformer #7393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 24, 2025

Conversation

babacry
Copy link
Collaborator

@babacry babacry commented May 30, 2025

Merge single qubit gates for symbolized circuits.

It is a updated version of #7149 where tag_transformers and symbolize transformers are already merged.

@github-actions github-actions bot added the size: L 250< lines changed <1000 label May 30, 2025
@babacry babacry changed the title Support merge symbolized 1 qubit gate. Support merge symbolized 1 qubit gate transformer May 30, 2025
@NoureldinYosri NoureldinYosri self-assigned this Jun 4, 2025
@babacry babacry force-pushed the merge_single_1 branch 5 times, most recently from c283401 to 85586b1 Compare June 6, 2025 01:21
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (b1ff3ae) to head (de7e88f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7393   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files        1112     1112           
  Lines       97993    98076   +83     
=======================================
+ Hits        96714    96797   +83     
  Misses       1279     1279           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@babacry babacry marked this pull request as ready for review June 6, 2025 01:39
@babacry babacry requested review from vtomole and a team as code owners June 6, 2025 01:39
@babacry babacry requested a review from tanujkhattar June 6, 2025 01:39
@babacry
Copy link
Collaborator Author

babacry commented Jun 6, 2025

@NoureldinYosri @eliottrosenberg I re-synced and refactored #7149 here, re-review calls! Thank you! And thank you Nour for noticing this and self assigning!

Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

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

I tested it in this colab and got an error.

@babacry
Copy link
Collaborator Author

babacry commented Jun 12, 2025

I tested it in this colab and got an error.

Good catch!! I should align the circuit after the parameterization. Patched. Could you help take another look? @eliottrosenberg

@babacry
Copy link
Collaborator Author

babacry commented Jun 12, 2025

I also added unit tests by calling gauge_compiling.as_sweep as input similar to the colab: test case.

Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you, @babacry!

Copy link
Collaborator

@NoureldinYosri NoureldinYosri left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @babacry

def test_case1(self):
"""Test case diagram.
Input circuit:
0: ───X─────────@──────────H[ignore]───H───X───PhXZ(a=a0,x=x0,z=z0)───X───PhXZ(a=a1,x=x1,z=z1)─── # pylint: disable=line-too-long
Copy link
Collaborator

Choose a reason for hiding this comment

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

the pylint statement here won't work since it is seen as just text inside a comment. I think you should just reduce the amout of to save space

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, good suggestion. This is really annoying.

@babacry
Copy link
Collaborator Author

babacry commented Jun 24, 2025

Thanks Nour!

@babacry babacry added this pull request to the merge queue Jun 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 24, 2025
Merge single qubit gates for symbolized circuits.

It is a updated version of #7149 where tag_transformers and symbolize
transformers are already merged.

---------

Co-authored-by: eliottrosenberg <61400172+eliottrosenberg@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 24, 2025
@NoureldinYosri NoureldinYosri added this pull request to the merge queue Jun 24, 2025
Merged via the queue into quantumlib:main with commit 9a58a8b Jun 24, 2025
65 of 66 checks passed
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 25, 2025
Merge single qubit gates for symbolized circuits.

It is a updated version of quantumlib#7149 where tag_transformers and symbolize
transformers are already merged.

---------

Co-authored-by: eliottrosenberg <61400172+eliottrosenberg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants