Skip to content

Commit e77fd8e

Browse files
committed
update edge color assignment
1 parent 7dcde1e commit e77fd8e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

example/floquetify.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ zstab_meas_zxwd = make_meas_zxwd(Parameter, meas_mg, :Z)
5757
ZXCalculus.ZXW.plot(xstab_meas_zxwd)
5858
ZXCalculus.ZXW.plot(zstab_meas_zxwd)
5959

60-
6160
concat_zxwd = ZXW.concat!(copy(xstab_meas_zxwd), copy(zstab_meas_zxwd))
6261
res_zxwd = ZXW.concat!(copy(concat_zxwd), copy(concat_zxwd))
6362
res_zxwd = ZXW.concat!(res_zxwd, copy(concat_zxwd))
@@ -97,4 +96,7 @@ function extract_k_qubit_circuit(zxwd::ZXWDiagram{T,P}) where {T,P}
9796
# Req4: topology of the finished diagram will be nice, i.e planar
9897
# Isn't this just extracting circuit from ZX-Diagram? It is proven to be #P-Complete. Need to search
9998

100-
end
99+
end
100+
101+
# if need to visualize, use javascript and visualize the modified ZX-diagram
102+
# need to save etc.

ext/ZXWCalculusExt.jl

+10-4
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,22 @@ function ZXCalculus.ZXW.plot(zxwd::ZXWDiagram{T,P}; kwargs...) where {T,P}
2323
Input(q) => colorant"orange"
2424
Output(q) => colorant"magenta"
2525
_ => colorant"black"
26-
end for i in 1:nv(g)],kwargs...)
26+
end for i in 1:nv(g)], kwargs...)
2727

2828
hidedecorations!(ax)
2929
hidespines!(ax)
3030
deregister_interaction!(ax, :rectanglezoom)
3131

32+
tb = Textbox(f[2, 1], placeholder="Enter the color: ", width=500)
33+
34+
wanted_color = Observable(parse(Colorant, "black"))
35+
36+
on(tb.stored_string) do s
37+
wanted_color[] = parse(Colorant,tb.stored_string[])
38+
end
39+
3240
function edge_click_action(idx, args...)
33-
print("Enter the color: ")
34-
which_color = readline()
35-
p.edge_color[][idx] = parse(Colorant, which_color)
41+
p.edge_color[][idx] = wanted_color[]
3642
p.edge_color[] = p.edge_color[]
3743
end
3844

0 commit comments

Comments
 (0)