diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 17fed9b..f8a1a93 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2024-04-16T10:03:19","documenter_version":"1.3.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2024-04-16T17:54:29","documenter_version":"1.3.0"}} \ No newline at end of file diff --git a/dev/guide/index.html b/dev/guide/index.html index a6894f0..dca6965 100644 --- a/dev/guide/index.html +++ b/dev/guide/index.html @@ -1,5 +1,5 @@ -Quick Start · SpinShuttling.jl

Quick Start

Generating a noise series from a stochastic process

Construct time-position array and define a Gaussian random field

P=hcat(t, v.*t) 
+Quick Start · SpinShuttling.jl

Quick Start

Generating a noise series from a stochastic process

Construct time-position array and define a Gaussian random field

P=hcat(t, v.*t) 
 B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ) 

Define a Gaussian random process (random function) by projecting the Gaussian random field along the time-space array P. Then we can use R() to invoke the process and generating a random time series.

R=RandomFunction(P, B) 
 plot(R()) 

Shuttling of a single spin

Define premeters

σ = sqrt(2) / 20; # variance of the process
 κₜ=1/20; # temporal correlation
@@ -12,4 +12,4 @@
 @assert isapprox(f2, f3, rtol=1e-2) 
 println("NI:", f1)
 println("MC:", f2)
-println("TH:", f3)

Shuttling of entangled spin pairs.

+println("TH:", f3)

Shuttling of entangled spin pairs.

diff --git a/dev/index.html b/dev/index.html index f680354..c76875c 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,3 +1,2 @@ -Home · SpinShuttling.jl

SpinShuttling.jl

Simulate the multiple-spin shuttling problem under correlated stochastic noise.

Installation

SpinShuttling can be installed using the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run

pkg> add SpinShuttling

APIs

Spin Shuttling Models

SpinShuttling.OneSpinModelFunction

General 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^n
  • T::Real: Maximum time
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • x::Function: Shuttling path
source

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.

source
SpinShuttling.OneSpinForthBackModelFunction

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.

Arguments

  • T::Real: Maximum time
  • L::Real: Length of the path
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • v::Real: Velocity of the shuttling
source
SpinShuttling.TwoSpinModelFunction

General 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^n
  • T::Real: Maximum time
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • x₁::Function: Shuttling path for the first spin
  • x₂::Function: Shuttling path for the second spin
source

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.

source
SpinShuttling.TwoSpinParallelModelFunction

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.

source

Fidelity Metric

SpinShuttling.fidelityFunction

Sample 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).

source
SpinShuttling.samplingFunction

Monte-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 sampled
  • M::Int: Monte-Carlo sampling size

Returns

  • Tuple{Real,Real}: The mean and variance of the sampled function
  • Tuple{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

source

Sampling an observable that defines on a specific spin shuttling model

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • objective::Function: The objective function objective(mode::ShuttlingModel; randseq)`
  • M::Int: Monte-Carlo sampling size
source
SpinShuttling.WFunction

Analytical dephasing factor of a one-spin shuttling model.

source

Analytical dephasing factor of a sequenced two-spin EPR pair shuttling model.

source

Analytical dephasing factor of a one-spin shuttling model for a pink-brownian noise.

source

Stochastics

SpinShuttling.PinkBrownianFieldType

Pink-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.

source
SpinShuttling.RandomFunctionType

Similar 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 process
  • P::Array{<:Real}: time-position array
  • Σ::Symmetric{<:Real}: covariance matrices
  • C::Cholesky: cholesky decomposition of the covariance matrices
source
SpinShuttling.CompositeRandomFunctionFunction

Create 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.

source
SpinShuttling.characteristicvalueFunction

Compute the final phase of the characteristic functional of the process from the numerical quadrature of the covariance matrix. Using Simpson's rule by default.

source
SpinShuttling.covariancematrixFunction

Covariance 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₁::Matrix{<:Real}: time-position array
  • P₂::Matrix{<:Real}: time-position array
  • process::GaussianRandomField: a Gaussian random field
source

Auto-Covariance matrix of a Gaussian random process.

source
+Home · SpinShuttling.jl

SpinShuttling.jl

Simulate the multiple-spin shuttling problem under correlated stochastic noise.

Installation

SpinShuttling can be installed using the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run

pkg> add SpinShuttling
diff --git a/dev/manual/index.html b/dev/manual/index.html new file mode 100644 index 0000000..4f7a564 --- /dev/null +++ b/dev/manual/index.html @@ -0,0 +1,3 @@ + +Manual · SpinShuttling.jl

APIs

Spin Shuttling Models

SpinShuttling.OneSpinModelFunction

General 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^n
  • T::Real: Maximum time
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • x::Function: Shuttling path
source

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.

source
SpinShuttling.OneSpinForthBackModelFunction

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.

Arguments

  • T::Real: Maximum time
  • L::Real: Length of the path
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • v::Real: Velocity of the shuttling
source
SpinShuttling.TwoSpinModelFunction

General 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^n
  • T::Real: Maximum time
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • x₁::Function: Shuttling path for the first spin
  • x₂::Function: Shuttling path for the second spin
source

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.

source
SpinShuttling.TwoSpinParallelModelFunction

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.

source

Fidelity Metric

SpinShuttling.fidelityFunction

Sample 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).

source
SpinShuttling.samplingFunction

Monte-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 sampled
  • M::Int: Monte-Carlo sampling size

Returns

  • Tuple{Real,Real}: The mean and variance of the sampled function
  • Tuple{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

source

Sampling an observable that defines on a specific spin shuttling model

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • objective::Function: The objective function objective(mode::ShuttlingModel; randseq)`
  • M::Int: Monte-Carlo sampling size
source
SpinShuttling.WFunction

Analytical dephasing factor of a one-spin shuttling model.

source

Analytical dephasing factor of a sequenced two-spin EPR pair shuttling model.

source

Analytical dephasing factor of a one-spin shuttling model for a pink-brownian noise.

source

Stochastics

SpinShuttling.PinkBrownianFieldType

Pink-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.

source
SpinShuttling.RandomFunctionType

Similar 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 process
  • P::Array{<:Real}: time-position array
  • Σ::Symmetric{<:Real}: covariance matrices
  • C::Cholesky: cholesky decomposition of the covariance matrices
source
SpinShuttling.CompositeRandomFunctionFunction

Create 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.

source
SpinShuttling.characteristicvalueFunction

Compute the final phase of the characteristic functional of the process from the numerical quadrature of the covariance matrix. Using Simpson's rule by default.

source
SpinShuttling.covariancematrixFunction

Covariance 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₁::Matrix{<:Real}: time-position array
  • P₂::Matrix{<:Real}: time-position array
  • process::GaussianRandomField: a Gaussian random field
source

Auto-Covariance matrix of a Gaussian random process.

source
diff --git a/dev/objects.inv b/dev/objects.inv index ec07284..b19a452 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/search_index.js b/dev/search_index.js index 30f1996..f0aa78b 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"guide/#Quick-Start","page":"Quick Start","title":"Quick Start","text":"","category":"section"},{"location":"guide/#Generating-a-noise-series-from-a-stochastic-process","page":"Quick Start","title":"Generating a noise series from a stochastic process","text":"","category":"section"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"Construct time-position array and define a Gaussian random field","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"P=hcat(t, v.*t) \nB=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ) ","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"Define a Gaussian random process (random function) by projecting the Gaussian random field along the time-space array P. Then we can use R() to invoke the process and generating a random time series.","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"R=RandomFunction(P, B) \nplot(R()) ","category":"page"},{"location":"guide/#Shuttling-of-a-single-spin","page":"Quick Start","title":"Shuttling of a single spin","text":"","category":"section"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"Define premeters","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"σ = sqrt(2) / 20; # variance of the process\nκₜ=1/20; # temporal correlation\nκₓ=1/0.1; # spatial correlation","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"Create an Ornstein-Uhlenbeck Process","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ)","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"Consider the shuttling of a single spin at constant velocity v. We need to specify the initial state, travelling time T and length L=v*T, and the stochastic noise expreienced by the spin qubit.","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"T=400; # total time\nL=10; # shuttling length\nv=L/T;","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"The package provided a simple encapsulation for the single spin shuttling, namely by OneSpinModel. We need to specify the discretization size and monte-carlo size to create a model.","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"M = 10000; # monte carlo sampling size\nN=301; # discretization size\nmodel=OneSpinModel(T,L,N,B)\nprintln(model)","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"The fidelity of the spin state after shuttling can be calculated using numerical integration of the covariance matrix. ","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"f1=averagefidelity(model)","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"The fidelity can also be obtained from Monte-Carlo sampling.","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"f2, f2_err=sampling(model, fidelity, M)","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"For the single spin shuttling at constant velocity, analytical solution is also available. ","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"f3=1/2*(1+W(T,L,B))","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"We can compare the results form the three methods.","category":"page"},{"location":"guide/","page":"Quick Start","title":"Quick Start","text":"@assert isapprox(f1, f3,rtol=1e-2)\n@assert isapprox(f2, f3, rtol=1e-2) \nprintln(\"NI:\", f1)\nprintln(\"MC:\", f2)\nprintln(\"TH:\", f3)","category":"page"},{"location":"guide/#Shuttling-of-entangled-spin-pairs.","page":"Quick Start","title":"Shuttling of entangled spin pairs.","text":"","category":"section"},{"location":"#SpinShuttling.jl","page":"Home","title":"SpinShuttling.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Simulate the multiple-spin shuttling problem under correlated stochastic noise.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"SpinShuttling can be installed using the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run","category":"page"},{"location":"","page":"Home","title":"Home","text":"pkg> add SpinShuttling","category":"page"},{"location":"#APIs","page":"Home","title":"APIs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"CurrentModule = SpinShuttling","category":"page"},{"location":"#Spin-Shuttling-Models","page":"Home","title":"Spin Shuttling Models","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"OneSpinModel","category":"page"},{"location":"#SpinShuttling.OneSpinModel","page":"Home","title":"SpinShuttling.OneSpinModel","text":"General one spin shuttling model initialized at initial state |Ψ₀⟩, with arbitrary shuttling path x(t). \n\nArguments\n\nΨ::Vector{<:Number}: Initial state of the spin system, the length of the vector must be `2^n\nT::Real: Maximum time\nN::Int: Time discretization\nB::GaussianRandomField: Noise field\nx::Function: Shuttling path\n\n\n\n\n\nOne 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.\n\n\n\n\n\n","category":"function"},{"location":"","page":"Home","title":"Home","text":"OneSpinForthBackModel","category":"page"},{"location":"#SpinShuttling.OneSpinForthBackModel","page":"Home","title":"SpinShuttling.OneSpinForthBackModel","text":"One spin shuttling model initialzied at |Ψ₀⟩=|+⟩. The qubit is shuttled at constant velocity along a forth-back path x(t, T, L) = t add SpinShuttling","category":"page"}] }