Skip to content

display tags by str instead of repr in circuit diagrams#6530

Merged
pavoljuhas merged 11 commits intoquantumlib:mainfrom
richrines1:display-tags-via-str
Apr 10, 2024
Merged

display tags by str instead of repr in circuit diagrams#6530
pavoljuhas merged 11 commits intoquantumlib:mainfrom
richrines1:display-tags-via-str

Conversation

@richrines1
Copy link
Copy Markdown
Contributor

addresses #6411

as described in this comment it might also be nice to allow tags to define their own _circuit_diagram_info_ magic method - happy to add this (either here or in a follow up) if this would be preferred

@xXxH3LIOSxXx
Copy link
Copy Markdown

xXxH3LIOSxXx commented Apr 9, 2024

@richrines1 - This looks good to me considering the context of the title and considering no issues with refreshing the branch to current.

Regarding implementation of _circuit_diagram_info_ for tags and whether that should be added to this PR, I defer to @pavoljuhas on this. My 2c is that that makes more sense as a separate issue where we can discuss what that may look like and then triage accordingly.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.79%. Comparing base (1bec6b5) to head (160ef83).

❗ Current head 160ef83 differs from pull request most recent head 302bce0. Consider uploading reports for the commit 302bce0 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6530   +/-   ##
=======================================
  Coverage   97.79%   97.79%           
=======================================
  Files        1124     1124           
  Lines       95486    95468   -18     
=======================================
- Hits        93376    93359   -17     
+ Misses       2110     2109    -1     

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

Comment thread cirq-core/cirq/circuits/circuit.py Outdated
Copy link
Copy Markdown
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.

LGTM, with a small suggestion to use map for brevity.

As for the _circuit_diagram_info_ - I feel it would be better to add in a separate PR.
Thank you for contributing this!

@pavoljuhas pavoljuhas enabled auto-merge (squash) April 10, 2024 00:35
@pavoljuhas pavoljuhas merged commit c18feed into quantumlib:main Apr 10, 2024
jselig-rigetti pushed a commit to jselig-rigetti/Cirq that referenced this pull request May 28, 2024
…ib#6530)

Use more readable rendering of tagged operations in diagrams.

Fixes: quantumlib#6411
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
…ib#6530)

Use more readable rendering of tagged operations in diagrams.

Fixes: quantumlib#6411
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
…ib#6530)

Use more readable rendering of tagged operations in diagrams.

Fixes: quantumlib#6411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants