Skip to content

Commit

Permalink
Merge pull request #256 from RazinShaikh/bialgebra-scalar-fix
Browse files Browse the repository at this point in the history
fixing bialgebra scalar
  • Loading branch information
jvdwetering authored Jul 15, 2024
2 parents 8917410 + 9dacf64 commit 1f78584
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pyzx/editor_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,11 @@ def bialgebra(g: BaseGraph[VT,ET],
etab[upair(n1,n2)] = [0, 0]
etab[upair(n1,n2)][0] += 1

if g.type(v2) == VertexType.Z:
t = VertexType.X
if g.type(v1) == VertexType.H_BOX or g.type(v2) == VertexType.H_BOX: # x-h bialgebra
x_vertex = v1 if g.type(v2) == VertexType.H_BOX else v2
g.scalar.add_power(g.vertex_degree(x_vertex)-2)
else: # z-x bialgebra
g.scalar.add_power((g.vertex_degree(v1)-2)*(g.vertex_degree(v2)-2))
else: #g.type(w) == VertexType.H_BOX
t = VertexType.Z
g.scalar.add_power(g.vertex_degree(v1)-2)
return (etab, rem_verts, [], False)


Expand Down

0 comments on commit 1f78584

Please sign in to comment.