Skip to content

Commit 75a2f14

Browse files
committed
match spider type as well
1 parent 947829b commit 75a2f14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ZX/rules.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ function Base.match(::Rule{:gf}, zxg::ZXGraph{T, P}) where {T, P}
320320
v1, v2, gad_v = gads[i]
321321
for j in (i+1):length(gads)
322322
u1, u2, gad_u = gads[j]
323-
if gad_u == gad_v && phase(zxg, v2) in (zero(P), one(P)) && phase(zxg, u2) in (zero(P), one(P))
323+
if gad_u == gad_v &&
324+
(spider_type(zxg, v2) == SpiderType.Z && phase(zxg, v2) in (zero(P), one(P))) &&
325+
(spider_type(zxg, u2) == SpiderType.Z && phase(zxg, u2) in (zero(P), one(P)))
324326
push!(matches, Match{T}([v1, v2, u1, u2]))
325327
end
326328
end

0 commit comments

Comments
 (0)