APIs
Spin Shuttling Models
SpinShuttling.ShuttlingModel — TypeSpin shuttling model defined by a stochastic field, the realization of the stochastic field is specified by the paths of the shuttled spins.
Arguments
n::Int: Number of spinsΨ::Vector{<:Number}: Initial state of the spin system, the length of the vector must be `2^nT::Real: Maximum timeN::Int: Time discretizationB::GaussianRandomField: Noise fieldX::Vector{Function}: Shuttling paths, the length of the vector must be `nR::RandomFunction: Random function of the sampled noises on paths
SpinShuttling.OneSpinModel — FunctionGeneral one spin shuttling model initialized at initial state |Ψ₀⟩, with arbitrary shuttling path x(t).
Arguments
Ψ::Vector{<:Number}: Initial state of the spin system, the length of the vector must be `2^nT::Real: Maximum timeN::Int: Time discretizationB::GaussianRandomField: Noise fieldx::Function: Shuttling path
One spin shuttling model initialzied at |Ψ₀⟩=|+⟩. 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.
SpinShuttling.OneSpinForthBackModel — FunctionOne 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.
Arguments
T::Real: Maximum timeL::Real: Length of the pathN::Int: Time discretizationB::GaussianRandomField: Noise fieldv::Real: Velocity of the shuttling
SpinShuttling.TwoSpinModel — FunctionGeneral two spin shuttling model initialized at initial state |Ψ₀⟩, with arbitrary shuttling paths x₁(t), x₂(t).
Arguments
Ψ::Vector{<:Number}: Initial state of the spin system, the length of the vector must be `2^nT::Real: Maximum timeN::Int: Time discretizationB::GaussianRandomField: Noise fieldx₁::Function: Shuttling path for the first spinx₂::Function: Shuttling path for the second spin
Two spin shuttling model initialized at the singlet state |Ψ₀⟩=1/√2(|↑↓⟩-|↓↑⟩). The qubits are shuttled at constant velocity along the path x₁(t)=L/T₁*t and x₂(t)=L/T₁*(t-T₀). 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.
SpinShuttling.TwoSpinParallelModel — FunctionTwo 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.
SpinShuttling.dephasingmatrix — FunctionCalculate the dephasing matrix of a given spin shuttling model.
SpinShuttling.fidelity — FunctionSample a phase integral of the process. The integrate of a random function should be obtained from directly summation without using high-order interpolation (Simpson or trapezoid).
SpinShuttling.sampling — FunctionMonte-Carlo sampling of any objective function. The function must return Tuple{Real,Real} or Tuple{Vector{<:Real},Vector{<:Real}}
Arguments
samplingfunction::Function: The function to be sampledM::Int: Monte-Carlo sampling size
Returns
Tuple{Real,Real}: The mean and variance of the sampled functionTuple{Vector{<:Real},Vector{<:Real}}: The mean and variance of the sampled function
Example
f(x) = x^2
sampling(f, 1000)Reference
https://en.wikipedia.org/wiki/Standarddeviation#Rapidcalculation_methods
Sampling an observable that defines on a specific spin shuttling model
Arguments
model::ShuttlingModel: The spin shuttling modelobjective::Function: The objective functionobjective(mode::ShuttlingModel; randseq)`M::Int: Monte-Carlo sampling size
SpinShuttling.averagefidelity — FunctionCalculate the average fidelity of a spin shuttling model using numerical integration of the covariance matrix.
Arguments
model::ShuttlingModel: The spin shuttling model
SpinShuttling.W — FunctionAnalytical dephasing factor of a one-spin shuttling model.
Arguments
T::Real: Total timeL::Real: Length of the pathB<:GaussianRandomField: Noise field, Ornstein-Uhlenbeck or Pink-Brownianpath::Symbol: Path of the shuttling model,:straightor:forthback
Analytical dephasing factor of a sequenced two-spin EPR pair shuttling model.
Stochastics
SpinShuttling.OrnsteinUhlenbeckField — TypeOrnstein-Uhlenbeck field, the correlation function of which is σ^2 * exp(-|t₁ - t₂|/θ_t) * exp(-|x₁-x₂|/θ_x) where t is time and x is position.
SpinShuttling.PinkBrownianField — TypePink-Brownian Field, the correlation function of which is σ^2 * (expinti(-γ[2]abs(t₁ - t₂)) - expinti(-γ[1]abs(t₁ - t₂)))/log(γ[2]/γ[1]) * exp(-|x₁-x₂|/θ) where expinti is the exponential integral function.
SpinShuttling.RandomFunction — TypeSimilar type of RandomFunction in Mathematica. Can be used to generate a time series on a given time array subject to a Gaussian random process traced from a Gaussian random field.
Arguments
μ::Vector{<:Real}: mean of the processP::Vector{<:Point}: time-position arrayΣ::Symmetric{<:Real}: covariance matricesC::Cholesky: Cholesky decomposition of the covariance matrices
SpinShuttling.CompositeRandomFunction — FunctionCreate a new random function composed by a linear combination of random processes. The input random function represents the direct sum of these processes. The output random function is a tensor contraction from the input.
Arguments
R::RandomFunction: a direct sum of random processes R₁⊕ R₂⊕ ... ⊕ Rₙc::Vector{Int}: a vector of coefficients
Returns
RandomFunction: a new random function composed by a linear combination of random processes
SpinShuttling.characteristicfunction — FunctionCompute the characteristic functional of the process from the numerical quadrature of the covariance matrix. Using Simpson's rule by default.
SpinShuttling.characteristicvalue — FunctionCompute the final phase of the characteristic functional of the process from the numerical quadrature of the covariance matrix. Using Simpson's rule by default.
SpinShuttling.covariancematrix — FunctionCovariance matrix of a Gaussian random field. When P₁=P₂, it is the auto-covariance matrix of a Gaussian random process. When P₁!=P₂, it is the cross-covariance matrix between two Gaussian random processes.
Arguments
P₁::Vector{<:Point}: time-position arrayP₂::Vector{<:Point}: time-position arrayprocess::GaussianRandomField: a Gaussian random field
Auto-Covariance matrix of a Gaussian random process.
Arguments
P::Vector{<:Point}: time-position arrayprocess::GaussianRandomField: a Gaussian random field
Returns
Symmetric{Real}: auto-covariance matrix
SpinShuttling.covariance — FunctionCovariance function of Gaussian random field.
Arguments
p₁::Point: time-position arrayp₂::Point: time-position arrayprocess<:GaussianRandomField: a Gaussian random field, e.g.OrnsteinUhlenbeckFieldorPinkBrownianField