Skip to content

Commit 39bd42f

Browse files
committed
cleanup
1 parent f5e57d9 commit 39bd42f

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed

examples/repeatergrid/1a_async_interactive_visualization.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#using GLMakie
2-
using CairoMakie
1+
using GLMakie
32
# TODO significant code duplication with the other examples
43

54
include("setup.jl")

src/ProtocolZoo/cutoff.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ end
4545
end
4646
if now(prot.sim) - reg.tag_info[info.id][3] > prot.retention_time # TODO this should be part of the query interface, not using non-public implementation details
4747
untag!(slot, info.id)
48-
println("EntanglementDelete in CutoffProt traceout $(prot.node).$(slot.idx)")
4948
traceout!(slot)
5049
msg = Tag(EntanglementDelete, prot.node, slot.idx, info.tag[2], info.tag[3])
5150
tag!(slot, msg)

src/ProtocolZoo/swapping.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ end
9595
uptotime!((q1, q2), now(prot.sim))
9696
swapcircuit = LocalEntanglementSwap()
9797
xmeas, zmeas = swapcircuit(q1, q2)
98-
println("$(now(prot.sim)) SwapperProt on $(prot.node).$(q1.idx) and $(q2.idx) and forwarding to $(tag1[2]).$(tag1[3]) and $(tag2[2]).$(tag2[3])")
9998
# send from here to new entanglement counterpart:
10099
# tag with EntanglementUpdateX past_local_node, past_local_slot_idx past_remote_slot_idx new_remote_node, new_remote_slot, correction
101100
msg1 = Tag(EntanglementUpdateX, prot.node, q1.idx, tag1[3], tag2[2], tag2[3], Int(xmeas))

src/semaphore.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function islocked(s::AsymmetricSemaphore)
6666
end
6767

6868
function nbwaiters(s::AsymmetricSemaphore)
69-
s1, s2 = s.semaphorepair
70-
return s1.nbwaiters + s2.nbwaiters
69+
#s1, s2 = s.semaphorepair
70+
#return s1.nbwaiters + s2.nbwaiters
71+
return s.semaphorepair[s.current_semaphore].nbwaiters
7172
end

test/test_messagebuffer.jl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,35 @@ proc4 = put!(messagebuffer(net[1]), SwitchRequest(2,3))
4343
run(sim, 10)
4444
@test QuantumSavory.peektags(messagebuffer(net,1)) == [Tag(SwitchRequest(2,3)), Tag(SwitchRequest(2,3)), Tag(SwitchRequest(2,3)), Tag(SwitchRequest(2,3))]
4545
@test_throws "does not support `tag!`" tag!(messagebuffer(net, 1), EntanglementCounterpart, 1, 10)
46+
47+
##
48+
49+
reg = Register(10)
50+
net = RegisterNet([reg])
51+
sim = get_time_tracker(net)
52+
mb = messagebuffer(reg)
53+
put!(mb, Tag(:something, 1, 2))
54+
put!(mb, Tag(:something, 1, 2))
55+
put!(mb, Tag(:something, 1, 2))
56+
put!(mb, Tag(:something, 1, 2))
57+
@resumable function receiver(sim, LOG)
58+
@yield wait(mb)
59+
push!(LOG, "got result immediately")
60+
end
61+
LOG = []
62+
@process receiver(sim, LOG)
63+
put!(mb, Tag(:something, 1, 2))
64+
@process receiver(sim, LOG)
65+
@process receiver(sim, LOG)
66+
@process receiver(sim, LOG)
67+
run(sim, 1.0)
68+
@process receiver(sim, LOG)
69+
@process receiver(sim, LOG)
70+
put!(mb, Tag(:something, 1, 2))
71+
put!(mb, Tag(:something, 1, 2))
72+
@process receiver(sim, LOG)
73+
@process receiver(sim, LOG)
74+
run(sim, 2.0)
75+
@test length(LOG) == 7
76+
4677
end

test/test_protocolzoo_entanglement_tracker_grid.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ end
230230
# but also now with an unlimited number of rounds and an entanglement consumer.
231231

232232

233-
using Random; Random.seed!(12)
234-
n = 5 # the size of the square grid network (n × n)
233+
n = 6 # the size of the square grid network (n × n)
235234
regsize = 20 # the size of the quantum registers at each node
236235

237236
graph = grid([n,n])
@@ -270,8 +269,7 @@ for v in vertices(net)
270269
cutoffprot = CutoffProt(sim, net, v, retention_time=10, period=nothing)
271270
@process cutoffprot()
272271
end
273-
run(sim, 18.249)
274-
run(sim, 400)
272+
@test_broken (run(sim, 400); true)
275273

276274
for i in 1:length(consumer._log)
277275
@test consumer._log[i][2] 1.0

0 commit comments

Comments
 (0)