Skip to content

Ensure SycamoreGate instances are preserved over serialization #7093

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 2 commits into from
Feb 26, 2025

Conversation

dstrain115
Copy link
Collaborator

  • Put in a special case for fsimgate deserialization so that sycamore gates are serialized to that representation.
  • This will avoid potential floating point errors when deserializing.

- Put in a special case for fsimgate deserialization so that
sycamore gates are serialized to that representation.
- This will avoid potential floating point errors when deserializing.
@dstrain115 dstrain115 requested review from wcourtney, vtomole, verult and a team as code owners February 24, 2025 19:24
@CirqBot CirqBot added the size: S 10< lines changed <50 label Feb 24, 2025
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.17%. Comparing base (db08b9b) to head (4107740).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7093      +/-   ##
==========================================
- Coverage   98.17%   98.17%   -0.01%     
==========================================
  Files        1089     1089              
  Lines       95217    95202      -15     
==========================================
- Hits        93480    93464      -16     
- Misses       1737     1738       +1     

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

and np.isclose(theta, np.pi / 2)
and np.isclose(phi, np.pi / 6)
):
op = SYC(*qubits)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if the SYC gate also has the FSimViaModelTag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call. Added a condition so that it does not convert to SYC if it is tagged.

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.

Thanks, Doug!

@dstrain115 dstrain115 added this pull request to the merge queue Feb 26, 2025
Merged via the queue into quantumlib:main with commit 8f2f198 Feb 26, 2025
38 checks passed
@dstrain115 dstrain115 deleted the fsimgate_directly_to_syc branch February 26, 2025 23:33
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
…umlib#7093)

* Ensure SycamoreGate instances are preserved over serialization

- Put in a special case for fsimgate deserialization so that
sycamore gates are serialized to that representation.
- This will avoid potential floating point errors when deserializing.

* Don't convert to SYC if tags on the FSim.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants