Skip to content
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

Add bitwise option to Sympy evaluator for classical controls #6914

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

daxfohl
Copy link
Collaborator

@daxfohl daxfohl commented Jan 3, 2025

Allow using sympy indexed objects to isolate bits within a measurement and perform bitwise logic on them.

Fixes #6434

@daxfohl daxfohl requested review from vtomole and a team as code owners January 3, 2025 10:09
@daxfohl daxfohl requested a review from senecameeks January 3, 2025 10:09
@CirqBot CirqBot added the size: M 50< lines changed <250 label Jan 3, 2025
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (ecf9ed7) to head (fe89c3c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6914   +/-   ##
=======================================
  Coverage   97.86%   97.87%           
=======================================
  Files        1084     1084           
  Lines       94315    94406   +91     
=======================================
+ Hits        92301    92396   +95     
+ Misses       2014     2010    -4     

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

@daxfohl
Copy link
Collaborator Author

daxfohl commented Jan 4, 2025

@mhucka glitch :(

@NoureldinYosri NoureldinYosri self-assigned this Jan 6, 2025
@mhucka
Copy link
Contributor

mhucka commented Jan 6, 2025

@daxfohl I restarted the checks, but if it's okay with you, I'll leave it to you to update the branch again (otherwise, my name will be attached to this PR as a contributor, and that's not fair).

@NoureldinYosri
Copy link
Collaborator

@daxfohl thanks for the contribution ... does this fix also work with simulators?

@NoureldinYosri NoureldinYosri self-requested a review January 7, 2025 00:26
@daxfohl daxfohl changed the title Add bitwise option for classical controls Add bitwise option to Sympy evaluator for classical controls Jan 7, 2025
@daxfohl
Copy link
Collaborator Author

daxfohl commented Jan 7, 2025

Yes, the test case shows it working with Simulator, unless I'm misunderstanding the question.

@NoureldinYosri
Copy link
Collaborator

@ikd-sci can you check if this change does what you want?

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.

thanks @daxfohl , this looks great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bitwise operations for classically conditioned gates
4 participants