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 construction examples to docstrings of ClassicallyControlledOperation #6913

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

justinpan0
Copy link

To address #4883, added construction usage:

"""
Examples:
        q0, q1, q2 = cirq.LineQubit.range(3)
        # Apply X if measurement was non-zero (single condition)
        circuit = cirq.Circuit(
            cirq.measure(q0, key='control_key'),
            cirq.X(q1).with_classical_controls('control_key')
        )
        # Apply X if both measurements were non-zero (multiple conditions)
        circuit = cirq.Circuit([
            cirq.measure(q0, key='control_key1'),
            cirq.measure(q1, key='control_key2'),
            cirq.X(q2).with_classical_controls('control_key1', 'control_key2')  
        ])
"""

@justinpan0 justinpan0 requested review from vtomole and a team as code owners January 3, 2025 07:43
@CirqBot CirqBot added the size: S 10< lines changed <50 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.86%. Comparing base (83a8e0e) to head (06260ce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6913      +/-   ##
==========================================
- Coverage   97.86%   97.86%   -0.01%     
==========================================
  Files        1084     1084              
  Lines       94290    94290              
==========================================
- Hits        92280    92279       -1     
- Misses       2010     2011       +1     

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

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.

2 participants