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

Remove short_name method #934

Merged
merged 11 commits into from
May 14, 2024
Merged

Conversation

dstrain115
Copy link
Contributor

@dstrain115 dstrain115 commented May 8, 2024

  • Replace with wire_symbol(reg=None)

For item 2 in #728

dstrain115 added 2 commits May 8, 2024 15:20
- Replace with wire_symbol(reg=None)
if reg.name not in self.ctrl_reg_names:
# Delegate to subbloq
print(self.subbloq)
print(type(self.subbloq))
Copy link
Collaborator

Choose a reason for hiding this comment

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

whoops

@mpharrigan
Copy link
Collaborator

One of the motivations was that the author of the wire_symbol method could declare that "the symbols are sufficient to tell what bloq this is, I don't need an additional label in the diagrams". For example: writing "CNOT" over a circle and modplus in the musical score diagram just adds clutter. Follow on work would aim to try to make some of the symbols more expressive. For example: the Add bloq could have its symbols be x and x+y and then get rid of the label.

Could you add support for this use case? both in the types and docs and in the musical score drawer?

@dstrain115
Copy link
Contributor Author

One of the motivations was that the author of the wire_symbol method could declare that "the symbols are sufficient to tell what bloq this is, I don't need an additional label in the diagrams". For example: writing "CNOT" over a circle and modplus in the musical score diagram just adds clutter. Follow on work would aim to try to make some of the symbols more expressive. For example: the Add bloq could have its symbols be x and x+y and then get rid of the label.

Could you add support for this use case? both in the types and docs and in the musical score drawer?

Would returning Text('') be sufficient here? (wire_symbol() should return a WireSymbol)

I will probably leave modifying the symbols of specific gates to a different PR (also, will only do obvious ones, like arithmetic operators, since I am not super familiar with all of these bloqs)

@dstrain115 dstrain115 requested a review from mpharrigan May 9, 2024 16:29
@mpharrigan
Copy link
Collaborator

I sortof defer to you on how to signal "no label", but whatever it is: it should be documented and the musical_score drawer should avoid drawing the label

@dstrain115
Copy link
Contributor Author

@mpharrigan I think this is ready for review. Please let me know if I missed anything.

@dstrain115 dstrain115 merged commit 03d09a0 into quantumlib:main May 14, 2024
7 checks passed
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.

2 participants