Alexis Toumi

Results 26 comments of Alexis Toumi

Hey! I'm not sure exactly how to specify "in an automatic way" in this case, there are potentially many ways to connect two boxes. The closest thing that is implemented...

The method `hypergraph.Diagram.downgrade` essentially works like you suggest, but for arbitrary diagrams rather than only pregroups. As you mention, there are potentially many ways to add swaps, with some more...

Thanks for your feedback! I'm working on a v1.0 where the error management will be refactored. Before that's merged with the main branch and released, even the smallest pull requests...

It's true we never had to take the tensor of two pregroup diagrams. What is your use case exactly? When you have two diagrams `f0 >> g0` and `f1 >>...

You can translate your diagram back and forth the `hypergraph.Diagram` class: ```python from discopy import Ty, Id, Swap, hypergraph x = Ty("x") back_n_forth = lambda f: hypergraph.Diagram.upgrade(f).downgrade() assert back_n_forth(Swap(x, x)...

The problem comes from the greedy algorithm used for the "forth" part of `back_n_forth`: it takes the boxes one at a time and when they have no wires coming in,...

Maybe the diagrams you are trying to simplify have some special shape for which a simple heuristic can do the trick? In your example it would make sense to add...

I'm busy with other things right now but you can try replacing this one line: https://github.com/oxford-quantum-group/discopy/blob/87dcd350480532b616eb7acf9043ab94b8300c70/discopy/drawing.py#L223 with ```python box, offset = box_node.box, getattr(box_node, "offset", len(scan)) ```

Even better, you could submit a PR for a new optional argument to `hypergraph.Diagram.downgrade` for switching from left to right.

Beautiful! If double lines are a headache, maybe we can use thick lines for qubits instead? Should we also make the lines for quantum boxes thick as well? In this...