Skip to content

Implement ASCII drawing for all lambeq diagrams #140

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

Open
nikhilkhatri opened this issue May 7, 2024 · 2 comments
Open

Implement ASCII drawing for all lambeq diagrams #140

nikhilkhatri opened this issue May 7, 2024 · 2 comments
Labels
up-for-grabs Available to external contributors

Comments

@nikhilkhatri
Copy link
Collaborator

nikhilkhatri commented May 7, 2024

Task description

lambeq has a rich interface for drawing diagrams using matplotlib and tikz. it also has an interface for drawing diagrams as ASCII text to a CLI interface. Presently, this text drawing is limited to pregroup diagrams, such as those created by the DisCoCat model.

This task asks for the text drawing feature to be extended to arbitrary diagrams, including the grammar, tensor and quantum diagrams which lambeq provides.

The current implementation assumes that diagrams have a pregroup structure. That is, they consist of a single layer of Word boxes, followed by layers consisting of swaps, identities or cups. In general, lambeq's backend can represent arbitrary string diagrams which do not have this constraint.

Completing this task requires providing an implementation of diagram2str in the DiagramTextPrinter class which can draw arbitrary string diagrams.

Notes

  • The text drawing feature is expected to work on all 3 diagram backends provided by lambeq:
  • It is necessary to ensure that boxes are wide enough to fit the text content in them.
  • Handling of foliation (collapsing boxes into fewer layers when possible) is optional.

References

@neiljdo neiljdo added the unitaryHACK2024 Tasks for unitaryHACK 2024 label May 28, 2024
@neiljdo neiljdo changed the title Implement ASCII drawing for all lambeq diagrams [unitaryHACK 2024] Implement ASCII drawing for all lambeq diagrams May 28, 2024
@dimkart dimkart changed the title [unitaryHACK 2024] Implement ASCII drawing for all lambeq diagrams Implement ASCII drawing for all lambeq diagrams Jul 30, 2024
@dimkart dimkart added up-for-grabs Available to external contributors and removed unitaryHACK2024 Tasks for unitaryHACK 2024 labels Jul 30, 2024
@intel-eth
Copy link

Hi Nikhil.
I have just entered unitary hackaton and I am confident with my skill.
By the way, I want to know if I can get bounties right now.
Thanks,
Edward

@dimkart
Copy link
Contributor

dimkart commented Aug 15, 2024

@intel-eth Thanks for your message, however unitaryhack is unfortunately over for this year, so no bounties anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up-for-grabs Available to external contributors
Projects
None yet
Development

No branches or pull requests

4 participants