Skip to content

Commit

Permalink
update sequential model name
Browse files Browse the repository at this point in the history
  • Loading branch information
EigenSolver committed Aug 7, 2024
1 parent 4d7e5f5 commit 9656159
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down
4 changes: 4 additions & 0 deletions docs/src/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ OneSpinForthBackModel
TwoSpinModel
```

```@docs
TwoSpinSequentialModel
```

```@docs
TwoSpinParallelModel
```
Expand Down
6 changes: 4 additions & 2 deletions src/SpinShuttling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions test/testdephasingfactor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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

2 changes: 1 addition & 1 deletion test/testfidelity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9656159

Please sign in to comment.