Skip to content

Remove pretty_name part 3 #1402

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

Merged
merged 5 commits into from
Sep 11, 2024

Conversation

dstrain115
Copy link
Contributor

Change the default implementation of Bloq.pretty_name to go via str. Removing pretty_name implementations and moving them to str or wire_symbols as necessary.

This change removes all references to pretty_name

Change the default implementation of Bloq.pretty_name to go via str. Removing pretty_name implementations and moving them to str or wire_symbols as necessary.

This change removes all references to pretty_name
@mpharrigan
Copy link
Collaborator

nice. can you fix the two notebooks as well?

Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

Hold off on merging until I cut v0.5

@dstrain115
Copy link
Contributor Author

Ok, notebooks fixed. Feel free to merge when ready

Comment on lines 170 to 172
def pretty_name(self) -> str:
"""The subbloq's pretty_name with a dagger."""
return self.subbloq.pretty_name() + '†'

def __str__(self) -> str:
"""Delegate to subbloq's `__str__` method."""
return f'Adjoint(subbloq={str(self.subbloq)})'
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use str(subbloq) + dagger in __str__ instead of Adjoint(subloq=...)? It would make the diagrams easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1, I wanted to do this for a while; but feared the test changes that would need to accompany it

@dstrain115 dstrain115 requested a review from anurudhp September 11, 2024 16:32
@mpharrigan mpharrigan merged commit 0f4deee into quantumlib:main Sep 11, 2024
8 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.

4 participants