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

Improve the function to display TemplateOrchestrator as svg #71

Closed
inmzhang opened this issue Jan 24, 2024 · 11 comments
Closed

Improve the function to display TemplateOrchestrator as svg #71

inmzhang opened this issue Jan 24, 2024 · 11 comments
Assignees
Labels
backend Issue pertaining to the Python backend (tqec package) enhancement New feature or request, may not be in the task flow good first issue Good for newcomers help wanted Extra attention is needed

Comments

@inmzhang
Copy link
Contributor

As discussed in #70, there can be some improvement ideas on the tqec.display.display_templates_svg function, which includes the following or more:

  1. Display the relationships between templates (corner pinning).
  2. Find a way to display the "scalable" property of the outer outer edges. For example, outer edges that will scale when scale_to is called are depicted as double-ended arrows whereas those that does not scale are depicted with inward-arrows.

This may also relate to issue #67.

@inmzhang inmzhang added enhancement New feature or request, may not be in the task flow good first issue Good for newcomers help wanted Extra attention is needed backend Issue pertaining to the Python backend (tqec package) labels Jan 24, 2024
@nelimee
Copy link
Contributor

nelimee commented Jan 25, 2024

Better idea about point number 2.

The problem of what I proposed first in 2. is that the arrows of different edges might intersect, which will lead to an hard-to-read representation, which is the opposite of the main goal.
Basically, any visualisation should be obvious at first glance if possible.
In this regard, here are two replacement proposals for 2. :

  1. Make "scalable" and "non-scalable" outer edges a different colour.
  2. Make "scalable" outer edges dotted and "non-scalable" outer edges plain.

Other ideas are of course welcome.

@inmzhang
Copy link
Contributor Author

And we should also note that the current implementation relies on the assumption that all the plaquette is of the same square shape. According to #34, this function should also change quite a lot once the assumption is lifted.

@inmzhang
Copy link
Contributor Author

inmzhang commented Feb 3, 2024

And we should also note that the current implementation relies on the assumption that all the plaquette is of the same square shape. According to #34, this function should also change quite a lot once the assumption is lifted.

As discussed in #34 and #80, the plaquettes should all be rectangular. This constraint implies that the display_templates_svg function currently works as expected without any modifications, or with only slight adjustments, once issue #80 is merged.

In cases where increment_x is not equal to increment_y, and if there is a need to display the plaquettes1 as rectangles, some minor code modifications will be required to ensure that displayed as intended.

Footnotes

  1. Strictly speaking, the inner grid is not the boundary of the plaquettes in the sense that the shape of a plaquette is useless information. It just shows the tiling which is determined by the increment property of the templates.

@inmzhang
Copy link
Contributor Author

inmzhang commented Feb 3, 2024

This issue is related to #107 and #108, we can rename display_templates_svg as display_template_svg and accept a template: Template as the argument. The implementation needs to be changed to accout for both AtomicTemplate and composed TemplateOrchestrator.

@nelimee
Copy link
Contributor

nelimee commented May 7, 2024

@smburdick might be nice for UF hack? (I know, this is a little bit late, I am sorry)

@giangiac
Copy link
Contributor

@nelimee I was thinking of starting by improving the ASCII representation of the circuit as generated by ComposedTemplate.display_template().
Shall I open a new issue or do you think I can use this?

@nelimee
Copy link
Contributor

nelimee commented May 15, 2024

@nelimee I was thinking of starting by improving the ASCII representation of the circuit as generated by ComposedTemplate.display_template().
Shall I open a new issue or do you think I can use this?

I think a new issue is the best, this one is specifically about the SVG representation.

@giangiac
Copy link
Contributor

I think a new issue is the best, this one is specifically about the SVG representation.

Opened new issue #234

@KabirDubey KabirDubey self-assigned this Jul 24, 2024
@KabirDubey
Copy link
Contributor

I'm unfamiliar with this part of the backend but will take on this issue for learning purposes. I'll review the 1/3 meeting, the revised task flow, and every part of the repo linked in this issue.

Please let me know if you'd advise differently and if there have been any updates to this issue I should be aware of.

@nelimee
Copy link
Contributor

nelimee commented Jul 25, 2024

I'm unfamiliar with this part of the backend but will take on this issue for learning purposes. I'll review the 1/3 meeting, the revised task flow, and every part of the repo linked in this issue.

Please let me know if you'd advise differently and if there have been any updates to this issue I should be aware of.

There have been no change in this issue, you should be able to safely go on :)

To summarise what would be nice-to-have features:

  • It would be nice to be able to distinguish between scalable and non-scalable edges. Basically, if a template is scalable in a given dimension, the 2 edges in that dimension are considered scalable. The idea for the moment is to either use a different colour or use a different type of line to draw the edge, but you are free to propose any other solution, the deciding factor being clearness.
  • It would be nice to have a way of seeing which corners are glued together.

Feel free to ask questions here or to send me a mail, we can schedule a meeting if you think this will help you understanding the Templates =)

@KabirDubey
Copy link
Contributor

Stale after refactoring of Template in #317 and the frontend in #325. Current sentiments about desired visuals are in #357.

@KabirDubey KabirDubey closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issue pertaining to the Python backend (tqec package) enhancement New feature or request, may not be in the task flow good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants