Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
EigenSolver committed Apr 25, 2024
1 parent 3dc2b63 commit abc149d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/testfidelity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ visualize=true

##
@testset begin "test single spin shuttling fidelity"
T=400; L=10; σ = sqrt(2) / 20; M = 2000; N=601; κₜ=1/20;κₓ=1/0.1;
T=400; L=10; σ = sqrt(2) / 20; M = 5000; N=601; κₜ=1/20;κₓ=1/0.1;

B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ)
model=OneSpinModel(T,L,N,B)
Expand All @@ -13,16 +13,16 @@ visualize=true
f1=averagefidelity(model)
f2, f2_err=sampling(model, fidelity, M)
f3=1/2*(1+W(T,L,B))
@test isapprox(f1, f3,rtol=1e-2)
@test isapprox(f2, f3, rtol=1e-2)
@test isapprox(f1, f3,rtol=3e-2)
@test isapprox(f2, f3, rtol=3e-2)
println("NI:", f1)
println("MC:", f2)
println("TH:", f3)
end

#
@testset begin "test single spin forth-back shuttling fidelity"
T=200; L=10; σ = sqrt(2) / 20; M = 2000; N=501; κₜ=1/20;κₓ=10;
T=200; L=10; σ = sqrt(2) / 20; M = 5000; N=501; κₜ=1/20;κₓ=10;
# exponential should be smaller than 100
B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ)

Expand All @@ -47,16 +47,16 @@ end
f1=averagefidelity(model)
f2, f2_err=sampling(model, fidelity, M)
f3=1/2*(1+W(T, L, B, path=:forthback))
@test isapprox(f1, f3,rtol=1e-2)
@test isapprox(f2, f3, rtol=1e-2)
@test isapprox(f1, f3,rtol=3e-2)
@test isapprox(f2, f3, rtol=3e-2)
println("NI:", f1)
println("MC:", f2)
println("TH:", f3)
end

##
@testset begin "test two spin sequenced shuttling fidelity"
L=10; σ =sqrt(2)/20; M=2000; N=501; T1=200; T0=25*0.05; κₜ=1/20; κₓ=1/0.1;
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)
if visualize
Expand All @@ -65,16 +65,16 @@ end
f1=averagefidelity(model)
f2, f2_err=sampling(model, fidelity, M)
f3=1/2*(1+W(T0, T1, L,B))
@test isapprox(f1, f3,rtol=1e-2)
@test isapprox(f2, f3, rtol=1e-2)
@test isapprox(f1, f3,rtol=3e-2)
@test isapprox(f2, f3, rtol=3e-2)
println("NI:", f1)
println("MC:", f2)
println("TH:", f3)
end

#
@testset "1/f noise chacacteristics" begin
σ = sqrt(2)/20; M = 400; N=501; L=10; γ=(1e-2,1e2); # MHz
σ = sqrt(2)/20; M = 5000; N=501; L=10; γ=(1e-2,1e2); # MHz
# 0.01 ~ 100 μs
# v = 0.1 ~ 1000 m/s
v=1; T=L/v; κₓ=10;
Expand All @@ -86,8 +86,8 @@ end
f1=averagefidelity(model)
f2, f2_err=sampling(model, fidelity, M)
f3=1/2*(1+W(T,L,B))
@test isapprox(f1, f3,rtol=1e-2)
@test isapprox(f2, f3, rtol=1e-2)
@test isapprox(f1, f3,rtol=3e-2)
@test isapprox(f2, f3, rtol=3e-2)
println("NI:", f1)
println("MC:", f2)
println("TH:", f3)
Expand Down

0 comments on commit abc149d

Please sign in to comment.