Skip to content

Commit

Permalink
Add new visualizations and edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ba2tro committed Jul 11, 2024
1 parent 46eb0a4 commit 8d0f1e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
23 changes: 19 additions & 4 deletions examples/repeatergrid/1a_async_interactive_visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include("setup.jl")

sim, net, graph, consumer, params... = prepare_simulation()

fig = Figure(;size=(1200, 850))
fig = Figure(;size=(1200, 1100))

# the network part of the visualization
layout = SquareGrid(cols=:auto, dx=30.0, dy=-30.0)(graph) # provided by NetworkLayout, meant to simplify plotting of graphs in 2D
Expand All @@ -19,13 +19,24 @@ txxs = @lift [Point2f(e[1],e[3]) for e in $entlog]
Δts = @lift length($ts)>1 ? $ts[2:end] .- $ts[1:end-1] : [0.0]
entlogaxis = Axis(fig[1,2], xlabel="Time", ylabel="Entanglement", title="Entanglement Successes")
ylims!(entlogaxis, (-1.04,1.04))
stem!(entlogaxis, tzzs)
stem!(entlogaxis, txxs)
histaxis = Axis(fig[2,2], xlabel="ΔTime", title="Histogram of Time to Successes")
hist!(histaxis, Δts)

avg_fids = @lift cumsum([e[3] for e in $entlog])./($ts) #avg fidelity per unit time
fid_info = @lift [Point2f(t,f) for (t,f) in zip($ts, $avg_fids)]
fid_axis = Axis(fig[3,1], xlabel="Time", ylabel="Avg. Fidelity", title="Time evolution of Average Fidelity")
lines!(fid_axis, fid_info)

num_epr = @lift cumsum(ones(length($entlog)))./($ts) #avg number of pairs per unit time
num_epr_info = @lift [Point2f(t,n) for (t,n) in zip($ts, $num_epr)]
num_epr_axis = Axis(fig[3,2], xlabel="Time", title="Avg. Number of Entangled Pairs between Alice and Bob")
lines!(num_epr_axis, num_epr_info)


# sliders
sg = SliderGrid( # TODO significant code duplication with the other examples
fig[3,1],
fig[4,1],
(label="Probability of success of Entanglement generation at each attempt",
range=0.001:0.05:1.0, format="{:.3f}", startvalue=0.001),
(label="Local busy time for swapper",
Expand Down Expand Up @@ -57,8 +68,12 @@ step_ts = range(0, 1000, step=0.1)
record(fig, "grid_sim6x6hv.mp4", step_ts; framerate=10, visible=true) do t
run(sim, t)
notify.((obs,entlog))
notify.(params)
notify.(params)
ylims!(entlogaxis, (-1.04,1.04))
xlims!(entlogaxis, max(0,t-50), 1+t)
ylims!(fid_axis, (0, 1.04))
xlims!(fid_axis, max(0, t-50), 1+t)
autolimits!(histaxis)
ylims!(num_epr_axis, (0, 4))
xlims!(num_epr_axis, max(0, t-50), 1+t)
end
5 changes: 5 additions & 0 deletions examples/repeatergrid/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This example visualizes a quantum network attempting to distribute between the Alice and Bob user pair located on the diagonal of a grid topology where asynchronous messaging and queries are used for classical communication of entanglement information between modes using protocols like [`EntanglementTracker`](@ref) and [`SwapperProt`](@ref). Link-level-entanglement is generated between all the horizontal and vertical neighbors using an entanglement generation protocol called [`EntanglerProt`](@ref). As an entanglement link is established between the end users, it is consumed by a protocol named [`EntanglementConsumer`](@ref) which records the fidelity and time of consumption of the pair. Also, the qubits that remain unused beyond their `retention_time` are discarded by the [`CutoffProt`](@ref) This module provides two ways of running the simulation using:

- [`SwapperProt`](@ref) and [`CutoffProt`](@ref) in an asynchrnous manner where they run independently and all the classical information about the quantum states is reconciled using asynchronous messages sent to the tracker.

Check warning on line 3 in examples/repeatergrid/Readme.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"asynchrnous" should be "asynchronous".

- [`SwapperProt`](@ref) does not use qubits that are to be thrown away by the [`CutoffProt`](@ref) by checking their `agelimit` parameter passed to it during initializaton. Here, there are no outgoing messages from the [`CutoffProt`](@ref) and everything is handled by being synchronous.

Check warning on line 5 in examples/repeatergrid/Readme.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"initializaton" should be "initialization".

0 comments on commit 8d0f1e4

Please sign in to comment.