APIs

Spin Shuttling Models

SpinShuttling.ShuttlingModel — Type

Spin 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^n
  • T::Real: Maximum time
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field
  • X::Tuple{Vararg{Function,N}}: Shuttling paths, the length of the vector must be `n
  • initialize::Bool: Initialize the random function

Fields

  • R::GaussianRandomFunction: Random function defined by the noise field and the paths

Example

model = ShuttlingModel(1, [1+0im, 0+0im], 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]), [t->t])
source
SpinShuttling.OneSpinModel — Function

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
  • initialize::Bool: Initialize the random function

Example

model = OneSpinModel(1 / √2 * [1+0im, 1+0im], 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]), t->t)
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.

Arguments

  • T::Real: Maximum time
  • L::Real: Length of the path
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field

Example

model = OneSpinModel(1.0, 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]))
source
SpinShuttling.OneSpinForthBackModel — Function

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

Example

model = OneSpinForthBackModel(1.0, 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]))
source
SpinShuttling.TwoSpinModel — Function

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

Example

model = TwoSpinModel(1 / √2 * [1+0im, 1+0im, 1+0im, 1+0im], 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]), t->t, t->t+1)
source
SpinShuttling.TwoSpinSequentialModel — Function

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.

Arguments

  • Ψ::Vector{<:Number}: Initial state of the spin system, the length of the vector must be 4, default is 1/√2(|↑↓⟩-|↓↑⟩)
  • T₀::Real: Delay time
  • T₁::Real: Shuttling time
  • L::Real: Length of the path
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field

Example

model = TwoSpinSequentialModel(1.0, 1.0, 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]))
source
SpinShuttling.TwoSpinParallelModel — Function

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.

Arguments

  • Ψ::Vector{<:Number}: Initial state of the spin system, the length of the vector must be 4, default is 1/√2(|↑↓⟩-|↓↑⟩)
  • T::Real: Total time
  • D::Real: Distance between the two qubits
  • L::Real: Length of the path
  • N::Int: Time discretization
  • B::GaussianRandomField: Noise field

Example

model = TwoSpinParallelModel(1.0, 1.0, 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]))
source
SpinShuttling.dephasingmatrix — Function

Calculate the dephasing matrix of a given spin shuttling model.

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • method::Symbol: The method to calculate the dephasing factor, :trapezoid, :simpson, :adaptive

Returns

  • W::Matrix{<:Real}: The dephasing matrix

Example

model = OneSpinModel(1.0, 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]), t->t)
W = dephasingmatrix(model)
source

Sample the dephasing matrix array for a given normal random vector.

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • randseq::Vector{<:Real}: The random sequence
  • isarray::Bool: Return the dephasing matrix array for each time step
source
SpinShuttling.dephasingfactor — Function

Calculate the dephasingfactor according to a special combinator of the noise sequence.

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • c::Vector{Int}: The combinator of the noise sequence, which should have the same length as the number of spins.
  • method::Symbol: The method to calculate the characteristic value, :trapezoid, :simpson, :adaptive

Returns

  • Real: The dephasing factor

Example

model = OneSpinModel(1.0, 1.0, 100, OrnsteinUhlenbeckField([1.0, 1.0, 1.0]), t->t)
c = [1, 1, 1]
dephasingfactor(model, c)
source

Sample the dephasing factor for a given normal random vector and a specific combinator.

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • randseq::Vector{<:Real}: The random sequence
  • c::Vector{Int}: The combinator of the noise sequence, which should have the same length as the number of spins.
  • isarray::Bool: Return the dephasing factor array for each time step
source
SpinShuttling.sequencedephasingfactor — Function

Return the dephasing factor of a single spin on a series of discrete time points.

Arguments

  • n::Int: The number of discrete time points at which to calculate the dephasing factor.
  • N::Int: Intervals between each time points.
  • model::ShuttlingModel: The shuttling model, which must represent a single spin (model.n == 1).

Returns

  • Vector{<:Real}: A vector containing the dephasing factor at each of the n discrete time points.
source
SpinShuttling.sampling — Function

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

Quantum Process

SpinShuttling.MixingUnitaryChannel — Type

MixingUnitaryChannel <: QuantumProcess A quantum process that applies a set of unitary operations with given probabilities.

Fields

  • Us::Vector{Matrix{Complex{Float64}}}: Vector of unitary matrices, each of size 2^n × 2^n for n qubits.
  • Ps::Vector{Float64}: Vector of mixing probabilities, which sum to 1
source
SpinShuttling.processtomography — Function

processtomography(krausops::Vector{<:Matrix{<:Complex}}, basis::Vector{<:Matrix{<:Complex}}; normalized::Bool=false) Compute the transfer matrix for a quantum channel defined by a set of Kraus operators.

Arguments

  • krausops::Vector{<:Matrix{<:Complex}}: Vector of Kraus operators, each of size 2^n × 2^n for n qubits.
  • basis::Vector{<:Matrix{<:Complex}}: Vector of basis matrices, each of size 2^n × 2^n for n qubits.
  • normalized::Bool=false: If true, the transfer matrix is normalized by the number of Kraus operators.

Returns

  • Matrix{Float64}: The process tomography transfer matrix of size `N × N
source
SpinShuttling.paulitransfermatrix — Function

paulitransfermatrix(krausops::Vector{<:Matrix{<:Complex}}; normalized::Bool=false) Compute the Pauli transfer matrix for a set of Kraus operators.

Arguments

  • krausops::Vector{<:Matrix{<:Complex}}: Vector of Kraus operators, each of size 2^n × 2^n for n qubits.
  • normalized::Bool=false: If true, the transfer matrix is normalized by the number of Kraus operators.

Returns

  • Matrix{Float64}: The Pauli transfer matrix of size 4^n × 4^n.
source
SpinShuttling.krausops — Function

krausops(channel::MixingUnitaryChannel)::Vector{Matrix{Complex{Float64}}} Convert a MixingUnitaryChannel to its Kraus operators.

Arguments

  • channel::MixingUnitaryChannel: The mixing unitary channel.

Returns

  • Vector{Matrix{Complex{Float64}}}: Vector of Kraus operators,
source

Quantum Measures

SpinShuttling.statefidelity — Function

Calculate the state fidelity of a spin shuttling model using numerical integration of the covariance matrix.

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • method::Symbol: The method to calculate the dephasing factor, :trapezoid, :simpson, :adaptive

Returns

  • Real: The state fidelity
source

Sample the state fidelity of a spin shuttling model using Monte-Carlo sampling.

Arguments

  • model::ShuttlingModel: The spin shuttling model
  • randseq::Vector{<:Real}: The random sequence
  • isarray::Bool: Return the dephasing matrix array for each time step
source
SpinShuttling.concurrence — Function
concurrence(ρ) -> Float64

Compute the Wootters concurrence of a two‑qubit (4×4) density matrix ρ.

Arguments

  • ρ::AbstractMatrix{<:Number}: Hermitian, positive‑semidefinite matrix with size == (4,4) and tr(ρ) ≈ 1.

Returns

  • Float64 in the closed interval [0,1].

Algorithm

  1. Build the spin‑flip operator Y ⊗ Y (Kronecker product of Pauli‑Y).
  2. Form spin-flip matrix ρ̃.
  3. Compute the eigenvalues λ_i of ρ * ρ̃, take their square‑roots, sort descending.
  4. Return max(0, λ₁ − λ₂ − λ₃ − λ₄).

Reference

W.K. Wootters, Phys. Rev. Lett. 80, 2245 (1998).

source
SpinShuttling.vonneumannentropy — Function
vonneumannentropy(ρ::AbstractMatrix{<:Number})::Float64

Compute the von Neumann entropy of a quantum state represented by a density matrix ρ.

Arguments

  • ρ::AbstractMatrix{<:Number}: Hermitian, positive-semidefinite matrix representing the quantum state.

Returns

  • Float64: The von Neumann entropy, a non-negative real number.
source
SpinShuttling.processfidelity — Function

returns the process fidelity of a quantum channel defined by a transfer matrix Λ and a target process S.

Arguments

  • Λ::Matrix{<:Number}: Transfer matrix of the quantum channel.
  • S::Matrix{<:Number}: Target process matrix.
  • d::Int=0: Dimension of the Hilbert space. If d

is 0, it is inferred from the size of Λ.

Returns

  • Float64: The process fidelity, a real number in the closed interval **[0
source

Arguments

  • krausops::Vector{Matrix{<:Number}}: Vector of Kraus operators, each of size 2^n × 2^n for n qubits.
  • U::Matrix{<:Number}: The target unitary matrix.
  • d::Int=0: Dimension of the Hilbert space. If d

is 0, it is inferred from the size of U.

Returns

  • Float64: The process fidelity, a real number in the closed interval **[0
source

processfidelity(E::MixingUnitaryChannel, S::Matrix{<:Number}) Compute the process fidelity of a quantum channel defined by a MixingUnitaryChannel and a target process S.

Arguments

  • E::MixingUnitaryChannel: The mixing unitary channel.
  • U::Matrix{<:Number}: The target unitary matrix.
  • d::Int=0: Dimension of the Hilbert space. If d is 0, it is inferred from the size of E.

Returns

  • Float64: The process fidelity, a real number in the closed interval **[0
source
SpinShuttling.averagegatefidelity — Function

[1] L. H. Pedersen, K. Molmer, and N. M. Moller, Fidelity of quantum operations, Physics Letters A 367, 47 (2007).

Calculate the average gate fidelity between two unitary operations.

Arguments

  • U0::Matrix{<:Number}: The first unitary operation, represented as a matrix of size 2^n × 2^n for n qubits.
  • U1::Matrix{<:Number}: The second unitary operation, represented as a matrix of size 2^n × 2^n for n qubits.

Returns

  • Real: The average gate fidelity between the two unitary operations.
source

Calculate the average gate fidelity between a quantum channel defined by Kraus operators and a unitary operation.

Arguments

  • krausops::Vector{<:Matrix{<:Number}}: Vector of Kraus operators, each of size 2^n × 2^n for n qubits.
  • U::Matrix{<:Number}: The unitary operation, represented as a matrix of size 2^n × 2^n for n qubits.

Returns

  • Real: The average gate fidelity between the quantum channel and the unitary operation.
source
SpinShuttling.W — Function

Analytical dephasing factor of a one-spin shuttling model.

Arguments

  • T::Real: Total time
  • L::Real: Length of the path
  • B<:GaussianRandomField: Noise field, Ornstein-Uhlenbeck or Pink-Lorentzian
  • path::Symbol: Path of the shuttling model, :straight or :forthback
source

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

source

Stochastics

SpinShuttling.OrnsteinUhlenbeckField — Type

Ornstein-Uhlenbeck field, the correlation function of which is σ^2/(4*κₜ *κₓ) * exp(-|t₁ - t₂|*κₜ) * exp(-|x₁-x₂|*κₓ) where t is time and x is position.

source
SpinShuttling.PinkLorentzianField — Type

Pink-Lorentzian 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.PinkGaussianField — Type

Pink-Gaussian Field, the correlation function of which is σ^2 * (expinti(-γ[2]abs(t₁ - t₂)) - expinti(-γ[1]abs(t₁ - t₂)))/log(γ[2]/γ[1]) * exp(-|x₁-x₂|^2/(2κ^2)) where expinti is the exponential integral function.

source
SpinShuttling.PinkPiField — Type

Pink-HeavisidePi Field, the correlation function of which is σ^2 * (expinti(-γ[2]abs(t₁ - t₂)) - expinti(-γ[1]abs(t₁ - t₂)))/log(γ[2]/γ[1]) * sinc(-κ|x₁-x₂|) where expinti is the exponential integral function.

source
SpinShuttling.PinkWhiteField — Type

Pink-Delta Field, the correlation function of which is σ^2 * (expinti(-γ[2]abs(t₁ - t₂)) - expinti(-γ[1]abs(t₁ - t₂)))/log(γ[2]/γ[1]) * δ(x₁-x₂) where expinti is the exponential integral function. δ is the Dirac delta function.

source
SpinShuttling.CompositeGaussianRandomFunction — Function

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.

Arguments

  • R::GaussianRandomFunction: a direct sum of random processes R₁⊕ R₂⊕ ... ⊕ Rₙ
  • c::Vector{Int}: a vector of coefficients
  • initialize::Bool=true: whether to initialize the Cholesky decomposition of the covariance matrix

Returns

  • GaussianRandomFunction: a new random function composed by a linear combination of random processes
source
SpinShuttling.restriction — Function

Restrict the random field along a parameteized curve.

Arguments

  • X::Tuple: a vector of functions [x₁(t), x₂(t), ...]
  • t::AbstractArray: time array
  • B::GaussianRandomField: a Gaussian random field
  • initialize::Bool: initialize the random function

Returns

  • GaussianRandomFunction: a new random function restricted along the curve
source
SpinShuttling.characteristicvalue — Function

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.covariancematrix — Function

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₁::Vector{<:Point}: time-position array
  • P₂::Vector{<:Point}: time-position array
  • GRF::GaussianRandomField: a Gaussian random field
source

Auto-Covariance matrix of a Gaussian random field.

Arguments

  • P::Vector{<:Point}: time-position array
  • GRF::GaussianRandomField: a Gaussian random field

Returns

  • Symmetric{Real}: auto-covariance matrix
source
SpinShuttling.covariance — Function

Covariance function of Gaussian random field.

Arguments

  • p₁::Point: time-position array
  • p₂::Point: time-position array
  • GRF<:GaussianRandomField: a Gaussian random field, e.g. OrnsteinUhlenbeckField or PinkLorentzianField
source