Skip to content

Commit 277bac8

Browse files
committed
up testing
1 parent 35f128a commit 277bac8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

example/floquetify.jl

+17
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,23 @@ function has_even_dg1_zx_spiders(zxwd::ZXWDiagram{T,P}) where {T,P}
101101
num_dg1_z_spiders = 0
102102
num_dg1_x_spiders = 0
103103

104+
for sp in ZXW.spiders(zxwd)
105+
@match ZXW.spider_type(zxwd,sp) begin
106+
ZXW.Input(_) || ZXW.Output(_) => continue
107+
ZXW.Z(_) => if ZXW.degree(zxwd, sp) == 1
108+
num_dg1_z_spiders += 1
109+
end
110+
ZXW.X(_) => if ZXW.degree(zxwd, sp) == 1
111+
num_dg1_x_spiders += 1
112+
end
113+
end
114+
end
115+
116+
if iseven(num_dg1_z_spiders) && iseven(num_dg1_x_spiders)
117+
return true
118+
else
119+
return false
120+
end
104121
end
105122

106123

0 commit comments

Comments
 (0)