Skip to content

Commit

Permalink
Fix more type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsutcliffe99 authored Aug 9, 2024
1 parent e33bb65 commit f129f47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyzx/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ def check_catn(g: BaseGraph[VT,ET], vert: VT, n):
assert g.phase(vert) == 0, "The cat"+str(n)+" decomposition acts on a phaseless spider but specified vertex has phase "+str(g.phase(vert)) # TODO: the cat decomps should be updated to work even if the central phase is pi (i.e. not just zero)
assert len(g.neighbors(vert)) == n, "The cat"+str(n)+" decomposition acts on a "+str(n)+"-degree spider but specified vertex has degree "+str(len(g.neighbors(vert)))
for v in g.neighbors(vert):
assert (g.edge_type((vert,v)) == EdgeType.HADAMARD and g.type(v) == g.type(vert)) or \
(g.edge_type((vert,v)) == EdgeType.SIMPLE and g.type(v) == toggle_vertex(g.type(vert))), \
assert (g.edge_type(g.edge(vert,v)) == EdgeType.HADAMARD and g.type(v) == g.type(vert)) or \
(g.edge_type(g.edge(vert,v)) == EdgeType.SIMPLE and g.type(v) == toggle_vertex(g.type(vert))), \
"The cat"+str(n)+" decomposition must act on a spider with "+str(n)+" opposite colour neighbours (or like-coloured with Hadamard edges)"
return True

Expand Down

0 comments on commit f129f47

Please sign in to comment.