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

Fix pivot basic rewrite with new PyZX version #334

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

colltoaction
Copy link
Contributor

This draft uncovers the issue with pivoting which I will solve next. cc @RazinShaikh. #256

Traceback (most recent call last):
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_action.py", line 281, in do_rewrite
    node.rewrite_action.do_rewrite(self.proof_panel)
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_action.py", line 114, in do_rewrite
    g, rem_verts = self.apply_rewrite(g, matches)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_action.py", line 129, in apply_rewrite
    etab, rem_verts, rem_edges, check_isolated_vertices = self.rule(g, matches)
                                                          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_data.py", line 117, in rule
    simplification(g)
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/simplify.py", line 109, in pivot_simp
    return simp(g, 'pivot_simp', match_pivot_parallel, pivot, matchf=matchf, quiet=quiet, stats=stats)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/simplify.py", line 98, in simp
    g.remove_edges(rem_edges)
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/graph/multigraph.py", line 237, in remove_edges
    self.remove_edge(e)
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/graph/multigraph.py", line 240, in remove_edge
    s,t,ty = edge
    ^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)

Traceback (most recent call last):
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_action.py", line 281, in do_rewrite
    node.rewrite_action.do_rewrite(self.proof_panel)
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_action.py", line 114, in do_rewrite
    g, rem_verts = self.apply_rewrite(g, matches)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_action.py", line 129, in apply_rewrite
    etab, rem_verts, rem_edges, check_isolated_vertices = self.rule(g, matches)
                                                          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/mcoll/repos/github.com/colltoaction/zxlive/zxlive/rewrite_data.py", line 117, in rule
    simplification(g)
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/simplify.py", line 109, in pivot_simp
    return simp(g, 'pivot_simp', match_pivot_parallel, pivot, matchf=matchf, quiet=quiet, stats=stats)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/simplify.py", line 98, in simp
    g.remove_edges(rem_edges)
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/graph/multigraph.py", line 237, in remove_edges
    self.remove_edge(e)
  File "/home/mcoll/.local/lib/python3.11/site-packages/pyzx/graph/multigraph.py", line 240, in remove_edge
    s,t,ty = edge
    ^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)
@colltoaction
Copy link
Contributor Author

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

Successfully merging this pull request may close these issues.

1 participant