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 tags to cirq.FrozenCircuit #6266

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented Aug 28, 2023

Fixes #6265

Things left to do as a follow up

  • Update circuit diagrams for cirq.FrozenCircuit to print the tags if they exist
  • Tags on FrozenCircuits are not automatically "imported" to the operation level when a frozen circuit get's wrapped in a circuit operation. I think we should leave this as it is for now and, if a need arises later, we can update the interop methods to propagate the tags.

@tanujkhattar tanujkhattar requested review from vtomole, cduck and a team as code owners August 28, 2023 23:01
@tanujkhattar tanujkhattar requested a review from dabacon August 28, 2023 23:01
@CirqBot CirqBot added the size: M 50< lines changed <250 label Aug 28, 2023
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Looks good modulo few nits.

@tanujkhattar tanujkhattar enabled auto-merge (squash) August 28, 2023 23:42
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 95.13% and no project coverage change.

Comparison is base (ed26d2f) 97.60% compared to head (7d8607c) 97.61%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #6266    +/-   ##
========================================
  Coverage   97.60%   97.61%            
========================================
  Files        1116     1116            
  Lines       95848    95973   +125     
========================================
+ Hits        93556    93680   +124     
- Misses       2292     2293     +1     
Files Changed Coverage Δ
cirq-google/cirq_google/api/v2/sweeps.py 100.00% <ø> (ø)
...rq_google/cloud/quantum_v1alpha1/types/__init__.py 100.00% <ø> (ø)
cirq-google/cirq_google/api/v2/run_context_pb2.py 35.48% <12.50%> (ø)
cirq-core/cirq/circuits/circuit.py 98.43% <100.00%> (+<0.01%) ⬆️
cirq-core/cirq/circuits/frozen_circuit.py 99.26% <100.00%> (+0.25%) ⬆️
cirq-core/cirq/circuits/frozen_circuit_test.py 100.00% <100.00%> (ø)
...q-core/cirq/sim/density_matrix_simulation_state.py 99.02% <100.00%> (+0.10%) ⬆️
cirq-core/cirq/sim/simulation_state_test.py 98.51% <100.00%> (ø)
cirq-google/cirq_google/api/v2/sweeps_test.py 100.00% <100.00%> (ø)
cirq-google/cirq_google/cloud/quantum/__init__.py 100.00% <100.00%> (ø)
... and 4 more

... and 1 file with indirect coverage changes

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

@dstrain115
Copy link
Collaborator

This looks pretty awkward to use. Since you usually get a FrozenCircuit from circuit.freeze(), should we add circuit.freeze(tags=tags) or a cirq.freeze_with_tags(tags)?

@tanujkhattar tanujkhattar merged commit 041ce5d into quantumlib:master Aug 29, 2023
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
* Add tags to FrozenCircuit

* Address comments and fix tests

* Address maffoo's comments
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.

Adding tags to Circuit objects
5 participants