-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove isfree and add locks to each slot (#25)
- Loading branch information
Showing
21 changed files
with
221 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "QuantumSavory" | ||
uuid = "2de2e421-972c-4cb5-a0c3-999c85908079" | ||
authors = ["Stefan Krastanov <[email protected]>"] | ||
version = "0.2.1" | ||
version = "0.3.0" | ||
|
||
[deps] | ||
ConcurrentSim = "6ed1e86c-fcaf-46a9-97e0-2b26a2cdb499" | ||
|
@@ -28,7 +28,7 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" | |
QuantumSavoryMakie = "Makie" | ||
|
||
[compat] | ||
ConcurrentSim = "1" | ||
ConcurrentSim = "1.1" | ||
Graphs = "1.7.3" | ||
IterTools = "1.4.0" | ||
Makie = "0.19" | ||
|
@@ -38,7 +38,7 @@ QuantumClifford = "0.8" | |
QuantumInterface = "0.3.0" | ||
QuantumOptics = "1.0.5" | ||
QuantumOpticsBase = "0.4" | ||
QuantumSymbolics = "0.2.0" | ||
QuantumSymbolics = "0.2.3" | ||
Reexport = "1.2.2" | ||
ResumableFunctions = "0.6.1" | ||
julia = "1.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
examples/congestionchain/3_aggregate_of_multiple_simulations.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
include("setup.jl") | ||
|
||
using GLMakie # For plotting | ||
GLMakie.activate!(inline=false) | ||
|
||
## | ||
# Demo visualizations of the performance of the network | ||
## | ||
|
||
function prepare_singlerun( | ||
; | ||
len = 5, # Number of registers in the chain | ||
regsize = 2, # Number of qubits in each register | ||
T2 = 100.0, # T2 dephasing time of all qubits | ||
F = 0.97, # Fidelity of the raw Bell pairs | ||
entangler_wait_time = 0.1, # How long to wait if all qubits are busy before retring entangling | ||
entangler_busy_λ = 0.5, # How long it takes to establish a newly entangled pair (Exponential distribution parameter) | ||
swapper_wait_time = 0.1, # How long to wait if all qubits are unavailable for swapping | ||
swapper_busy_time = 0.55, # How long it takes to swap two qubits | ||
consume_wait_time = 0.1, # How long to wait if there are no qubits ready for consumption | ||
) | ||
sim, network = simulation_setup(len, regsize, T2) | ||
|
||
noisy_pair = noisy_pair_func(F) | ||
for (;src, dst) in edges(network) | ||
@process entangler(sim, network, src, dst, noisy_pair, entangler_wait_time, entangler_busy_λ) | ||
end | ||
|
||
for node in vertices(network) | ||
@process swapper(sim, network, node, swapper_wait_time, swapper_busy_time) | ||
end | ||
|
||
ts = Ref(Float64[]) | ||
fidXX = Ref(Float64[]) | ||
fidZZ = Ref(Float64[]) | ||
@process consumer(sim, network, 1, len, consume_wait_time,ts,fidXX,fidZZ) | ||
|
||
sim, network, ts, fidXX, fidZZ | ||
end | ||
|
||
## | ||
|
||
link_lengths = 3:40 # change the range of chain lengths being simulated | ||
results = Vector{Any}(undef,length(link_lengths)) | ||
|
||
Threads.@threads for i in eachindex(link_lengths) | ||
conf = Dict( # change the settings here | ||
:len => link_lengths[i], | ||
:regsize => 2, | ||
:T2 => 100.0, | ||
:F => 0.97, | ||
:entangler_busy_λ => 0.5, | ||
:swapper_busy_time => 0.5 | ||
) | ||
sim, network, ts, fidXX, fidZZ = prepare_singlerun(; conf...) | ||
run(sim, 1000) # run for 1000 time units | ||
results[i] = (ts, fidXX, fidZZ) | ||
@info "Finished run $(i) of $(length(link_lengths)) -- the chain length was $(link_lengths[i])" | ||
end | ||
|
||
## | ||
|
||
avgt = [mean(res[1][]) for res in results] | ||
avgxx = [mean(res[2][]) for res in results] | ||
avgzz = [mean(res[3][]) for res in results] | ||
|
||
F = Figure(resolution=(600,600)) | ||
ax1 = Axis(F[1,1], ylabel="avg time to connection") | ||
scatter!(ax1, link_lengths, avgt) | ||
ylims!(ax1,0,nothing) | ||
ax2 = Axis(F[2,1], ylabel="XX Stabilizer\nExpectation") | ||
scatter!(ax2, link_lengths, avgxx) | ||
ylims!(ax2,0,1) | ||
ax3 = Axis(F[3,1], ylabel="ZZ Stabilizer\nExpectation", xlabel="chain length") | ||
scatter!(ax3, link_lengths, avgzz) | ||
ylims!(ax3,0,1) | ||
save("stats_vs_chainlength.png", F) | ||
display(F) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
554db7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
554db7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/88920
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: