julia> zxd = ZXDiagram(4);
julia> push_gate!(zxd, Val(:Z), 4);
julia> push_gate!(zxd, Val(:X), 4)
ZX-diagram with 10 vertices and 6 multiple edges:
(S_1{input} <-1-> S_2{output})
(S_3{input} <-1-> S_4{output})
(S_5{input} <-1-> S_6{output})
(S_7{input} <-1-> S_9{phase = 0//1⋅π})
(S_8{output} <-1-> S_10{phase = 0//1⋅π})
(S_9{phase = 0//1⋅π} <-1-> S_10{phase = 0//1⋅π})
X gate is push_gate!(zxd, Val(:X), 4, 0//1), Z gate is push_gate!(zxd, Val(:Z), 4, π)
Maybe just forbid this interface?
simplify!(Rule{:lc}(), ::ZXDiagram)should not work, but it does not give an error._ctrlinpush_ctrl_gate!looks not necessary.simplify!andreplace!are not intuitive, should be something likesimplify_recursive!andsimplify_once!?zxg |> srule!(:lc) |> srule!(:p1) |> srule_once!(:pab)phasetoe.g.getphase`, because it conflicts with the phase gate in Yao.X gate is
push_gate!(zxd, Val(:X), 4, 0//1), Z gate ispush_gate!(zxd, Val(:Z), 4, π)Maybe just forbid this interface?