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 RemoveCupsRewriter #141

Open
dimkart opened this issue May 7, 2024 · 0 comments
Open

Improve RemoveCupsRewriter #141

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

Comments

@dimkart
Copy link
Contributor

dimkart commented May 7, 2024

Description

Some of the syntax-based diagrams in lambeq, such as pregroup diagrams, include cups that indicate syntactic interactions between the words in the sentence. For example, in the diagram:

John       gave      Mary    a    flower                                                                                            
────  ─────────────  ────  ─────  ──────
 n    n.r·s·n.l·n.l   n    n·n.l    n
 ╰─────╯  │  │   ╰────╯    │  ╰─────╯
          │  ╰─────────────╯

cups are indicated by ╰─╯ links. These operations are expensive, since they introduce post-selections which increase exponentially the number of the required circuit executions. lambeq addresses this problem with RemoveCupsRewriter, which attempts to remove as many cups as possible while retaining the same connections as the original diagram.

The goal of this task is to improve RemoveCupsRewriter, or to create a new rewriter class, so that the new implementation:

  1. is more effective than the old one concerning the number of cups removed from a diagram
  2. keeps the rewriting speed in acceptable ranges

Notes

  • A robust implementation of a related diagram rewriting routine can be found here.
  • The PRs should be accompanied with some proof-of-concept benchmarks of the new implementation and comparisons with the old one, with regard to both effectiveness and performance, as these were defined above.

References

@neiljdo neiljdo added the unitaryHACK2024 Tasks for unitaryHACK 2024 label May 28, 2024
@neiljdo neiljdo changed the title Improve RemoveCupsRewriter [unitaryHACK 2024] Improve RemoveCupsRewriter May 28, 2024
@dimkart dimkart changed the title [unitaryHACK 2024] Improve RemoveCupsRewriter Improve RemoveCupsRewriter Jul 30, 2024
@dimkart dimkart added up-for-grabs Available to external contributors and removed unitaryHACK2024 Tasks for unitaryHACK 2024 labels Jul 30, 2024
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

2 participants