Skip to content

Commit

Permalink
add forth-back shuttling model and parallel shuttling model
Browse files Browse the repository at this point in the history
  • Loading branch information
EigenSolver committed Mar 4, 2024
1 parent 7b15f33 commit 34d9025
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions src/SpinShuttling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,18 @@ The qubit is shuttled at constant velocity along the path `x(t)=L/T*t`,
with total time `T` in `μs` and length `L` in `μm`.
"""
OneSpinModel(T::Real, L::Real, M::Int, N::Int, B::GaussianRandomField) =
OneSpinModel(1 / 2 * [1, 1], T, M, N, B, t -> L / T * t)
OneSpinModel(1 / 2 * [1, 1], T, M, N, B, t::Real -> L / T * t)

"""
One spin shuttling model initialzied at |Ψ₀⟩=|+⟩.
The qubit is shuttled at constant velocity along a forth-back path
`x(t, T, L) = t<T/2 ? 2L/T*t : 2L/T*(T-t)`,
with total time `T` in `μs` and length `L` in `μm`.
"""
function OneSpinForthBackModel(T::Real, L::Real, M::Int, N::Int, B::GaussianRandomField)
x(t::Real, T::Real, L::Real)::Real = t<T/2 ? 2L/T*t : 2L/T*(T-t)
return OneSpinModel(1 / 2 * [1, 1], T, M, N, B, t::Real -> x(t, T, L))
end

"""
General two spin shuttling model initialized at initial state |Ψ₀⟩,
Expand Down Expand Up @@ -138,6 +148,21 @@ function TwoSpinModel(T₀::Real, T₁::Real, L::Real, M::Int, N::Int,
return TwoSpinModel(Ψ, T, M, N, B, x₁, x₂)
end

"""
Two spin shuttling model initialized at the singlet state `|Ψ₀⟩=1/√2(|↑↓⟩-|↓↑⟩)`.
The qubits are shuttled at constant velocity along the 2D path
`x₁(t)=L/T*t, y₁(t)=0` and `x₂(t)=L/T*t, y₂(t)=D`.
The total shuttling time is `T` and the length of the path is `L` in `μm`.
"""
function TwoSpinParallelModel(T::Real, D::Real, L::Real, M::Int, N::Int,
B::GaussianRandomField)
@assert length(B.θ)>=3
x₁(t::Real)::Tuple{Real,Real} = (L / T * t, 0)
x₂(t::Real)::Tuple{Real,Real} = (L / T * t, D)
Ψ = 1 / 2 .* [0, 1, -1, 0]
return TwoSpinModel(Ψ, T, M, N, B, x₁, x₂)
end

"""
Calculate the average fidelity of a spin shuttling model using numerical integration
of the covariance matrix.
Expand Down Expand Up @@ -222,23 +247,6 @@ function fidelity(model::ShuttlingModel, randseq::Vector{<:Real}; vector::Bool=f
return (1 .+ cos.(phi)) / 2
end

# function fidelity(model::ShuttlingModel, randseq::Vector{<:Real}; vector::Bool=false)::Union{Real,Vector{<:Real}}
# N = model.N
# dt = model.T / N
# if model.n==1
# R=model.R
# elseif model.n==2
# R=CompositeRandomFunction(model.R, [1, -1])
# elseif model.n >2
# error("The number of spins is not supported")
# end
# Z = R(randseq)
# φ = (vector ? cumsum(Z) : sum(Z))* dt
# F = @. 1/2*(1 + cos(φ))
# return F
# end



"""
Theoretical fidelity of a sequenced two-spin EPR pair shuttling model.
Expand Down
Empty file modified src/analytics.jl
100755 → 100644
Empty file.

0 comments on commit 34d9025

Please sign in to comment.