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

Make DumpMachine/DumpRegister output more compact and reduce use of Unicode symbols #1699

Open
tcNickolas opened this issue Jul 3, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@tcNickolas
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  1. DumpMachine output is very verbose. In my default screen layout, I can see one complete DumpMachine output with 4 basis states, anything extra requires scrolling. Our teleportation sample, for example, has 8 DumpMachine outputs, requiring a lot of scrolling, and the "DumpMachine:" headers and empty lines dominate the output.
  2. Symbols ⟩ and 𝑖 are not recognized by a lot of editing environments (such as LaTeX), so copy-pasting DumpMachine output requires post-production.

Describe the solution you'd like

  1. Remove "DumpMachine:" header from before the table of basis states, and some of the empty lines around it.
  2. Replace 𝑖 with i in the complex number output. I don't think we can replace ⟩ as easily, using > is very ugly, but having i in italic doesn't add a lot of visual value.
@tcNickolas tcNickolas added enhancement New feature or request needs triage labels Jul 3, 2024
@sezna
Copy link
Contributor

sezna commented Aug 15, 2024

Point number 1 around removing DumpMachine is certainly doable and a likely improvement, but number 2 introduces an inconsistency that we are undecided on. We think it makes more sense to either leave unicode in or remove all unicode.

@tcNickolas
Copy link
Contributor Author

Not all Unicode is equal :-) There is a lot of value in using ⟩ instead of > for ket, but having i in italic is not important, so I'm willing to trade off some non-uniformity for better usability

@sezna
Copy link
Contributor

sezna commented Aug 15, 2024

I think the concern is more about what precisely the usability improvement is. As far as I understand, having a unicode string is of usability level X, and having a non-unicode string is of usability level Y. Removing some but not all unicode does not change the usability level from X to Y, as any external tools you're using still have to deal with a unicode string. I understand the sentiment that the italic 𝒊 is less important, but I mean...if we are already outputting strings of usability level X, we might as well take full advantage of this and provide the most prettified output possible, right?

@tcNickolas
Copy link
Contributor Author

It does actually change usability, since I need to make a decision about what to do with each type of character individually. Reducing the number of characters to think about improves usability

@tcNickolas
Copy link
Contributor Author

One more odd thing I noticed was that the minus signs in the second and the last columns were different, one was highlighted as special by VS Code. That didn't cause any rendering issues with my particular platform, but looked odd

@swernli
Copy link
Collaborator

swernli commented Aug 26, 2024

Looks like #1885 addresses at least the first point, removing the titles from the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants