From 9656159c0a6bbe29a5e1e52d6d79f7bb4be0ecba Mon Sep 17 00:00:00 2001 From: Yuning Date: Wed, 7 Aug 2024 17:43:44 +0200 Subject: [PATCH] update sequential model name --- docs/src/guide.md | 2 +- docs/src/manual.md | 4 ++++ src/SpinShuttling.jl | 6 ++++-- test/testdephasingfactor.jl | 6 +----- test/testfidelity.jl | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/src/guide.md b/docs/src/guide.md index ac78ba4..a3c02c7 100644 --- a/docs/src/guide.md +++ b/docs/src/guide.md @@ -134,7 +134,7 @@ One more example is the shuttling of two spin pairs. We can define such a two-sp ```@example quickstart L=10; σ =sqrt(2)/20; M=5000; N=501; T1=100; T0=25; κₜ=1/20; κₓ=1/0.1; B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ) -model=TwoSpinModel(T0, T1, L, N, B) +model=TwoSpinSequentialModel(T0, T1, L, N, B) println(model) ``` diff --git a/docs/src/manual.md b/docs/src/manual.md index ff531f0..51ffed5 100644 --- a/docs/src/manual.md +++ b/docs/src/manual.md @@ -23,6 +23,10 @@ OneSpinForthBackModel TwoSpinModel ``` +```@docs +TwoSpinSequentialModel +``` + ```@docs TwoSpinParallelModel ``` diff --git a/src/SpinShuttling.jl b/src/SpinShuttling.jl index cc5ab7a..9703cec 100644 --- a/src/SpinShuttling.jl +++ b/src/SpinShuttling.jl @@ -13,7 +13,9 @@ include("stochastics.jl") include("sampling.jl") export ShuttlingModel, OneSpinModel, TwoSpinModel, - OneSpinForthBackModel, TwoSpinParallelModel, RandomFunction, CompositeRandomFunction, + OneSpinForthBackModel, + TwoSpinSequentialModel, TwoSpinParallelModel, + RandomFunction, CompositeRandomFunction, OrnsteinUhlenbeckField, PinkBrownianField export statefidelity, sampling, characteristicfunction, characteristicvalue export dephasingmatrix, covariance, covariancematrix @@ -141,7 +143,7 @@ The qubits are shuttled at constant velocity along the path `x₁(t)=L/T₁*t` a The delay between the them is `T₀` and the total shuttling time is `T₁+T₀`. It should be noticed that due to the exclusion of fermions, `x₁(t)` and `x₂(t)` cannot overlap. """ -function TwoSpinModel(T₀::Real, T₁::Real, L::Real, N::Int, B::GaussianRandomField) +function TwoSpinSequentialModel(T₀::Real, T₁::Real, L::Real, N::Int, B::GaussianRandomField) function x₁(t::Real)::Real if t < 0 return 0 diff --git a/test/testdephasingfactor.jl b/test/testdephasingfactor.jl index 7202e8f..bbed170 100644 --- a/test/testdephasingfactor.jl +++ b/test/testdephasingfactor.jl @@ -26,7 +26,6 @@ @test rho[1, 1] + rho[2, 2] ≈ 1 @test w == w' - println(w) f_c = (model.Ψ' * (w .* rho) * model.Ψ) f_s = (model.Ψ' * (w2 .* rho) * model.Ψ) @test f ≈ f_c @@ -45,7 +44,7 @@ end κₜ = 1 / 20 κₓ = 1 / 0.1 B = OrnsteinUhlenbeckField(0, [κₜ, κₓ], σ) - model = TwoSpinModel(T0, T1, L, N, B) + model = TwoSpinSequentialModel(T0, T1, L, N, B) println(model) f = statefidelity(model) w = dephasingmatrix(model) @@ -54,11 +53,8 @@ end @test sum([rho[i, i] for i in 1:4]) ≈ 1 @test w == w' - println(w) f_c = (model.Ψ' * (w .* rho) * model.Ψ) - println(f) - println(f_c) @test f ≈ f_c end diff --git a/test/testfidelity.jl b/test/testfidelity.jl index 208db9e..282c554 100644 --- a/test/testfidelity.jl +++ b/test/testfidelity.jl @@ -58,7 +58,7 @@ end @testset begin "test two spin sequenced shuttling fidelity" L=10; σ =sqrt(2)/20; M=5000; N=501; T1=200; T0=25*0.05; κₜ=1/20; κₓ=1/0.1; B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ) - model=TwoSpinModel(T0, T1, L, N, B) + model=TwoSpinSequentialModel(T0, T1, L, N, B) if visualize display(heatmap(collect(model.R.Σ), title="cross covariance matrix, two spin EPR")) end