diff --git a/dev/couplingfunctions/index.html b/dev/couplingfunctions/index.html index 0c97c03..3e6c906 100644 --- a/dev/couplingfunctions/index.html +++ b/dev/couplingfunctions/index.html @@ -11,7 +11,7 @@ 0.0 2.0 0.0 2.0 2.0 0.0 2.0 0.0 0.0 2.0 0.0 2.0 - 2.0 0.0 2.0 0.0source
SpiDy.NNlatticeFunction
NNlattice(N, Jh, Jv; boundary=nothing)

Create the spin-spin coupling matrix of a NxN 2D lattice with nearest-neighbour interactions and specified horizontal and vertical coupling strengths, Jh and Jv respectively.

Arguments

  • N: The size of the lattice (N x N).
  • Jh: The horizontal nearest-neighbour coupling strength.
  • Jv: The vertical nearest-neighbour coupling strength.
  • boundary=nothing: (Optional) Specifies the boundary condition of the lattice. Default is nothing which corresponds to open edges. Use :periodic for periodic boundary condition.

Returns

An N^2×N^2 array representing the coupling matrix of the lattice.

Examples

julia> J = NNlattice(3, 2.0, 1.0)
+ 2.0  0.0  2.0  0.0
source
SpiDy.NNlatticeFunction
NNlattice(N, Jh, Jv; boundary=nothing)

Create the spin-spin coupling matrix of a NxN 2D lattice with nearest-neighbour interactions and specified horizontal and vertical coupling strengths, Jh and Jv respectively.

Arguments

  • N: The size of the lattice (N x N).
  • Jh: The horizontal nearest-neighbour coupling strength.
  • Jv: The vertical nearest-neighbour coupling strength.
  • boundary=nothing: (Optional) Specifies the boundary condition of the lattice. Default is nothing which corresponds to open edges. Use :periodic for periodic boundary condition.

Returns

An N^2×N^2 array representing the coupling matrix of the lattice.

Examples

julia> J = NNlattice(3, 2.0, 1.0)
 9×9 LinearAlgebra.Symmetric{Float64, Matrix{Float64}}:
  0.0  2.0  0.0  1.0  0.0  0.0  0.0  0.0  0.0
  2.0  0.0  2.0  0.0  1.0  0.0  0.0  0.0  0.0
@@ -33,4 +33,4 @@
  0.0  0.0  1.0  2.0  2.0  0.0  0.0  0.0  1.0
  1.0  0.0  0.0  1.0  0.0  0.0  0.0  2.0  2.0
  0.0  1.0  0.0  0.0  1.0  0.0  2.0  0.0  2.0
- 0.0  0.0  1.0  0.0  0.0  1.0  2.0  2.0  0.0
source
+ 0.0 0.0 1.0 0.0 0.0 1.0 2.0 2.0 0.0source diff --git a/dev/couplingtensor/index.html b/dev/couplingtensor/index.html index f5f22a6..2e74251 100644 --- a/dev/couplingtensor/index.html +++ b/dev/couplingtensor/index.html @@ -1,5 +1,5 @@ -Spin-environment coupling tensor · SpiDy.jl

Environment coupling tensor

SpiDy.CouplingType
abstract type Coupling

Abstract type used to represent different forms of the environment coupling tensor.

source
SpiDy.AnisoCouplingType
struct AnisoCoupling{TT<:AbstractMatrix{T} where {T<:Real}} <: Coupling

A subtype of Coupling used to represent generic anisotropic coupling between the spin and environment.

Fields

  • C::TT: The coupling matrix, which must be a 3x3 matrix (of type Matrix{<:Real}).

Examples

For a system with environment coupling where the y coupling is twice as large as the x, and the z three times as large, one can do:

julia> C = [1.0 0.0 0.0; 0.0 2.0 0.0; 0.0 0.0 3.0]
+Spin-environment coupling tensor · SpiDy.jl

Environment coupling tensor

SpiDy.CouplingType
abstract type Coupling

Abstract type used to represent different forms of the environment coupling tensor.

source
SpiDy.AnisoCouplingType
struct AnisoCoupling{TT<:AbstractMatrix{T} where {T<:Real}} <: Coupling

A subtype of Coupling used to represent generic anisotropic coupling between the spin and environment.

Fields

  • C::TT: The coupling matrix, which must be a 3x3 matrix (of type Matrix{<:Real}).

Examples

For a system with environment coupling where the y coupling is twice as large as the x, and the z three times as large, one can do:

julia> C = [1.0 0.0 0.0; 0.0 2.0 0.0; 0.0 0.0 3.0]
 3×3 Matrix{Float64}:
  1.0  0.0  0.0
  0.0  2.0  0.0
@@ -13,5 +13,5 @@
  0.0 0.0 0.0
 
 julia> coupling_2d = AnisoCoupling(C)
-AnisoCoupling{Matrix{Float64}}([1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 0.0])

Similarly, one can define effective 1D couplings by setting two of the components to zero.

source
SpiDy.IsoCouplingType
struct IsoCoupling{TT<:Real} <: Coupling

A subtype of Coupling used to represent isotropic coupling between spin and environment.

Fields

  • C::Real: The coupling strength.

Examples

julia> coupling = IsoCoupling(2.5)
-IsoCoupling{Float64}(2.5)
source
+AnisoCoupling{Matrix{Float64}}([1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 0.0])

Similarly, one can define effective 1D couplings by setting two of the components to zero.

source
SpiDy.IsoCouplingType
struct IsoCoupling{TT<:Real} <: Coupling

A subtype of Coupling used to represent isotropic coupling between spin and environment.

Fields

  • C::Real: The coupling strength.

Examples

julia> coupling = IsoCoupling(2.5)
+IsoCoupling{Float64}(2.5)
source
diff --git a/dev/dynamics/index.html b/dev/dynamics/index.html index e24c48e..a47cd54 100644 --- a/dev/dynamics/index.html +++ b/dev/dynamics/index.html @@ -1,2 +1,2 @@ -Dynamics · SpiDy.jl

Dynamics

SpiDy.diffeqsolverFunction
function diffeqsolver(s0, tspan, J::LorentzianSD, Jshared::LorentzianSD, bfields, bfieldshared, matrix::Coupling; JH=zero(I), S0=1/2, Bext=[0, 0, 1], saveat=[], save_fields=false, projection=true, alg=Tsit5(), atol=1e-3, rtol=1e-3)

Solves the dynamics of a system of ineracting spins under the influence of both local (unique to each spin) and global (shared by all spins) stochastic noise from the environment.

Arguments

  • s0: Array of length 3N specifying the initial conditions of the N spins. The order the initial consitions is first the Sx,Sy,Sz for the first spin, then for the second, and so on.
  • tspan: The time span to solve the equations over, specified as a tuple (tstart, tend).
  • Jlist::Vector{LorentzianSD}: The list of spectral densities of the environment(s).
  • bfield: An array of tuples of functions Array{Tuple{Function, Function, Function}} representing the time series of the noise for each environment.
  • bcoupling::Vector{Vector{T}} T <: Real: A vector (of length the number of baths) of vectors (of length the number of spins), specifying if each bath couples to each spin.
  • matrix::Vector{TT} TT <: Coupling: A vector of Coupling structs specifying the spin-environment coupling matrix for each environment.
  • JH=zero(I): (Optional) The spin-spin coupling matrix. Default is zero matrix (i.e. non-interacting spins).
  • S0=1/2: (Optional) The spin quantum number. Default is 1/2.
  • Bext=[0, 0, 1]: (Optional) The external magnetic field vector. Default is [0, 0, 1] (normalised length pointing in the z direction).
  • saveat=[]: (Optional) An array of time points where the solution should be saved. Default is empty, which saves the solution at the time steps chosen by the integration algorithm.
  • save_fields=false: (Optional) If true, also return the auxiliary fields encoding the environment memory.
  • projection=false: (Optional) Specifies whether to project the spin vectors onto the unit sphere at each time step, hence forcing the numerical conservation of the spin length. Default is false.
  • alg=Tsit5(): (Optional) The differential equation solver algorithm. Default is Tsit5(). See the DifferentialEquations.jl docs for choices.
  • atol=1e-3: (Optional) The absolute tolerance for the solver. Default is 1e-3.
  • rtol=1e-3: (Optional) The relative tolerance for the solver. Default is 1e-3.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Note: Additional keyword arguments will be passed on to the ODE solver (see the DifferentialEquations.jl docs)

Returns

An ODESolution struct from DifferentialEquations.jl containing the solution of the equations of motion.

source
function diffeqsolver(s0, tspan, J::LorentzianSD, Jshared::LorentzianSD, bfields, bfieldshared, matrix::Coupling; JH=zero(I), S0=1/2, Bext=[0, 0, 1], saveat=[], save_fields=false, projection=true, alg=Tsit5(), atol=1e-3, rtol=1e-3)

Solves the dynamics of a system of ineracting spins under the influence of either local (unique to each spin) or global (shared by all spins) stochastic noise from the environment.

Arguments

  • s0: Array of length 3N specifying the initial conditions of the N spins. The order the initial consitions is first the Sx,Sy,Sz for the first spin, then for the second, and so on.
  • tspan: The time span to solve the equations over, specified as a tuple (tstart, tend).
  • J::LorentzianSD: The spectral density of the noise acting on the spins (either local or shared depending on the value of bfields).
  • bfields: For local baths, an array of tuples of functions Array{Tuple{Function, Function, Function}} representing the time series of the local stochastic field for each spin. For a global bath, a tuple of functions Tuple{Function, Function, Function} representing the time series of the global stochastic field shared by all the spins.
  • matrix::Coupling: The spin-environment coupling matrix.
  • JH=zero(I): (Optional) The spin-spin coupling matrix. Default is zero matrix (i.e. non-interacting spins).
  • S0=1/2: (Optional) The spin quantum number. Default is 1/2.
  • Bext=[0, 0, 1]: (Optional) The external magnetic field vector. Default is [0, 0, 1] (normalised length pointing in the z direction).
  • saveat=[]: (Optional) An array of time points where the solution should be saved. Default is empty, which saves the solution at the time steps chosen by the integration algorithm.
  • save_fields=false: (Optional) If true, also return the auxiliary fields encoding the environment memory.
  • projection=false: (Optional) Specifies whether to project the spin vectors onto the unit sphere at each time step, hence forcing the numerical conservation of the spin length. Default is false.
  • alg=Tsit5(): (Optional) The differential equation solver algorithm. Default is Tsit5(). See the DifferentialEquations.jl docs for choices.
  • atol=1e-3: (Optional) The absolute tolerance for the solver. Default is 1e-3.
  • rtol=1e-3: (Optional) The relative tolerance for the solver. Default is 1e-3.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Note: Additional keyword arguments will be passed on to the ODE solver (see the DifferentialEquations.jl docs)

Returns

An ODESolution struct from DifferentialEquations.jl containing the solution of the equations of motion.

source
function diffeqsolver(x0, p0, tspan, J::LorentzianSD, bfield, matrix::Coupling; JH=zero(I), Ω=1.0, counter_term=true, saveat=[], save_fields=false, alg=Tsit5(), atol=1e-3, rtol=1e-3)

Solves the dynamics of a system of ineracting oscillators under the influence of either local (unique to each oscillator) or global (shared by all oscillators) stochastic noise from the environment.

Arguments

  • x0: Array of length N specifying the initial position of the N oscillators.
  • p0: Array of length N specifying the initial momentum of the N oscillators.
  • tspan: The time span to solve the equations over, specified as a tuple (tstart, tend).
  • J::LorentzianSD: The spectral density of the noise acting globally on the harmonic oscillators.
  • bfield: A tuple of functions Tuple{Function, Function, Function} representing the time series of the global stochastic field shared by all the harmonic oscillators.
  • matrix::Coupling: The harmonic oscillators-environment coupling matrix.
  • JH=zero(I): (Optional) The oscillator-oscillator coupling matrix. Default is zero matrix (i.e. non-interacting oscillators).
  • Ω=1.0: (Optional) The natural angular frequency of the harmonic oscillators (currently the same for all). Default is 1.
  • counter_term=true: (Optional) Whether to include the counter-term or not. Default is true.
  • saveat=[]: (Optional) An array of time points where the solution should be saved. Default is empty, which saves the solution at the time steps chosen by the integration algorithm.
  • save_fields=false: (Optional) If true, also return the auxiliary fields encoding the environment memory.
  • alg=Tsit5(): (Optional) The differential equation solver algorithm. Default is Tsit5(). See the DifferentialEquations.jl docs for choices.
  • atol=1e-3: (Optional) The absolute tolerance for the solver. Default is 1e-3.
  • rtol=1e-3: (Optional) The relative tolerance for the solver. Default is 1e-3.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Note: Additional keyword arguments will be passed on to the ODE solver (see the DifferentialEquations.jl docs)

Returns

An ODESolution struct from DifferentialEquations.jl containing the solution of the equations of motion.

source
+Dynamics · SpiDy.jl

Dynamics

SpiDy.diffeqsolverFunction
function diffeqsolver(s0, tspan, J::LorentzianSD, Jshared::LorentzianSD, bfields, bfieldshared, matrix::Coupling; JH=zero(I), S0=1/2, Bext=[0, 0, 1], saveat=[], save_fields=false, projection=true, alg=Tsit5(), atol=1e-3, rtol=1e-3)

Solves the dynamics of a system of ineracting spins under the influence of both local (unique to each spin) and global (shared by all spins) stochastic noise from the environment.

Arguments

  • s0: Array of length 3N specifying the initial conditions of the N spins. The order the initial consitions is first the Sx,Sy,Sz for the first spin, then for the second, and so on.
  • tspan: The time span to solve the equations over, specified as a tuple (tstart, tend).
  • Jlist::Vector{LorentzianSD}: The list of spectral densities of the environment(s).
  • bfield: An array of tuples of functions Array{Tuple{Function, Function, Function}} representing the time series of the noise for each environment.
  • bcoupling::Vector{Vector{T}} T <: Real: A vector (of length the number of baths) of vectors (of length the number of spins), specifying if each bath couples to each spin.
  • matrix::Vector{TT} TT <: Coupling: A vector of Coupling structs specifying the spin-environment coupling matrix for each environment.
  • JH=zero(I): (Optional) The spin-spin coupling matrix. Default is zero matrix (i.e. non-interacting spins).
  • S0=1/2: (Optional) The spin quantum number. Default is 1/2.
  • Bext=[0, 0, 1]: (Optional) The external magnetic field vector. Default is [0, 0, 1] (normalised length pointing in the z direction).
  • saveat=[]: (Optional) An array of time points where the solution should be saved. Default is empty, which saves the solution at the time steps chosen by the integration algorithm.
  • save_fields=false: (Optional) If true, also return the auxiliary fields encoding the environment memory.
  • projection=false: (Optional) Specifies whether to project the spin vectors onto the unit sphere at each time step, hence forcing the numerical conservation of the spin length. Default is false.
  • alg=Tsit5(): (Optional) The differential equation solver algorithm. Default is Tsit5(). See the DifferentialEquations.jl docs for choices.
  • atol=1e-3: (Optional) The absolute tolerance for the solver. Default is 1e-3.
  • rtol=1e-3: (Optional) The relative tolerance for the solver. Default is 1e-3.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Note: Additional keyword arguments will be passed on to the ODE solver (see the DifferentialEquations.jl docs)

Returns

An ODESolution struct from DifferentialEquations.jl containing the solution of the equations of motion.

source
function diffeqsolver(s0, tspan, J::LorentzianSD, Jshared::LorentzianSD, bfields, bfieldshared, matrix::Coupling; JH=zero(I), S0=1/2, Bext=[0, 0, 1], saveat=[], save_fields=false, projection=true, alg=Tsit5(), atol=1e-3, rtol=1e-3)

Solves the dynamics of a system of ineracting spins under the influence of either local (unique to each spin) or global (shared by all spins) stochastic noise from the environment.

Arguments

  • s0: Array of length 3N specifying the initial conditions of the N spins. The order the initial consitions is first the Sx,Sy,Sz for the first spin, then for the second, and so on.
  • tspan: The time span to solve the equations over, specified as a tuple (tstart, tend).
  • J::LorentzianSD: The spectral density of the noise acting on the spins (either local or shared depending on the value of bfields).
  • bfields: For local baths, an array of tuples of functions Array{Tuple{Function, Function, Function}} representing the time series of the local stochastic field for each spin. For a global bath, a tuple of functions Tuple{Function, Function, Function} representing the time series of the global stochastic field shared by all the spins.
  • matrix::Coupling: The spin-environment coupling matrix.
  • JH=zero(I): (Optional) The spin-spin coupling matrix. Default is zero matrix (i.e. non-interacting spins).
  • S0=1/2: (Optional) The spin quantum number. Default is 1/2.
  • Bext=[0, 0, 1]: (Optional) The external magnetic field vector. Default is [0, 0, 1] (normalised length pointing in the z direction).
  • saveat=[]: (Optional) An array of time points where the solution should be saved. Default is empty, which saves the solution at the time steps chosen by the integration algorithm.
  • save_fields=false: (Optional) If true, also return the auxiliary fields encoding the environment memory.
  • projection=false: (Optional) Specifies whether to project the spin vectors onto the unit sphere at each time step, hence forcing the numerical conservation of the spin length. Default is false.
  • alg=Tsit5(): (Optional) The differential equation solver algorithm. Default is Tsit5(). See the DifferentialEquations.jl docs for choices.
  • atol=1e-3: (Optional) The absolute tolerance for the solver. Default is 1e-3.
  • rtol=1e-3: (Optional) The relative tolerance for the solver. Default is 1e-3.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Note: Additional keyword arguments will be passed on to the ODE solver (see the DifferentialEquations.jl docs)

Returns

An ODESolution struct from DifferentialEquations.jl containing the solution of the equations of motion.

source
function diffeqsolver(x0, p0, tspan, J::LorentzianSD, bfield, matrix::Coupling; JH=zero(I), Ω=1.0, counter_term=true, saveat=[], save_fields=false, alg=Tsit5(), atol=1e-3, rtol=1e-3)

Solves the dynamics of a system of ineracting oscillators under the influence of either local (unique to each oscillator) or global (shared by all oscillators) stochastic noise from the environment.

Arguments

  • x0: Array of length N specifying the initial position of the N oscillators.
  • p0: Array of length N specifying the initial momentum of the N oscillators.
  • tspan: The time span to solve the equations over, specified as a tuple (tstart, tend).
  • J::LorentzianSD: The spectral density of the noise acting globally on the harmonic oscillators.
  • bfield: A tuple of functions Tuple{Function, Function, Function} representing the time series of the global stochastic field shared by all the harmonic oscillators.
  • matrix::Coupling: The harmonic oscillators-environment coupling matrix.
  • JH=zero(I): (Optional) The oscillator-oscillator coupling matrix. Default is zero matrix (i.e. non-interacting oscillators).
  • Ω=1.0: (Optional) The natural angular frequency of the harmonic oscillators (currently the same for all). Default is 1.
  • counter_term=true: (Optional) Whether to include the counter-term or not. Default is true.
  • saveat=[]: (Optional) An array of time points where the solution should be saved. Default is empty, which saves the solution at the time steps chosen by the integration algorithm.
  • save_fields=false: (Optional) If true, also return the auxiliary fields encoding the environment memory.
  • alg=Tsit5(): (Optional) The differential equation solver algorithm. Default is Tsit5(). See the DifferentialEquations.jl docs for choices.
  • atol=1e-3: (Optional) The absolute tolerance for the solver. Default is 1e-3.
  • rtol=1e-3: (Optional) The relative tolerance for the solver. Default is 1e-3.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Note: Additional keyword arguments will be passed on to the ODE solver (see the DifferentialEquations.jl docs)

Returns

An ODESolution struct from DifferentialEquations.jl containing the solution of the equations of motion.

source
diff --git a/dev/index.html b/dev/index.html index f4beca3..edf5c25 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,3 +1,3 @@ Start with SpiDy.jl · SpiDy.jl

SpiDy.jl documentation

Start with SpiDy.jl

SpiDy.jl is a Spin-Dynamics Julia package. The code is a generalization of the results obtained in the paper "Quantum Brownian motion for magnets" to account for arbitrary dimensional system-bath coupling. The system considered is a quantized three-dimensional spin + environment Hamiltonian. The code solves a set of differential equations for the spin vector where the damping accounts for memory, arbitrary noise and arbitrary statistics.

The classical simulations in anisotropic coupling found in the pre-print "Quantum-classical correspondence in spin-boson equilibrium states at arbitrary coupling" have been generated using a very-early-version of this code.

Install Julia

If you are new to Julia, here is how to install it.

If you are a Windows/Mac user, download Julia here and run the installer. On Mac, drag-and-drop the app to the Applications.

If you are a Linux user, just open a terminal and use your package manager, e.g. on Debian-based distros run "sudo apt-get install julia", on RedHat-based distros run "sudo dnf install julia".

Install SpiDy.jl

Following the Julia General Registry guidelines, the package can be installed as follows. (NB: the entire installation of SpiDy and its dependencies takes about 5 minutes on a bare-bones Julia environment.)

Start Julia and enter in Pkg REPL mode by pressing ] then run the following,

add https://github.com/quantum-exeter/SpiDy.jl

or alternatively run the following lines in your code,

using Pkg;
-Pkg.add(url="https://github.com/quantum-exeter/SpiDy.jl")

Run SpiDy.jl

To run the code,

  • save run_dynamics.jl and run_steadystate.jl in your preferred location (right click -> save as... should work to save the file)
  • open the terminal or command line
  • run the following command,
julia "path-to-your-file"/run_dynamics.jl

where "path-to-your-file" is the one where you saved your file. Replace run_dynamics.jl with run_steadystate.jl to run the one of your choice.

NB: the code can exploit parallel computation. To do this, run your files as

julia -t 6 "path-to-your-file"/run_dynamics.jl

where you want to replace "6" with the number of threads that you wish to use. As a general idea, you do not want to use more than 80% of the number of threads you have available in your machine, e.g. if you have a 4-core CPU, you are likely to have 8 threads and you may want to run the parallelization as indicated above.

Units and choosing parameters

See the section "Units and choosing parameters" for a discussion on the choice of units implemented in SpiDy.jl and how to choose these parameters given a concrete real problem.

Index

+Pkg.add(url="https://github.com/quantum-exeter/SpiDy.jl")

Run SpiDy.jl

To run the code,

julia "path-to-your-file"/run_dynamics.jl

where "path-to-your-file" is the one where you saved your file. Replace run_dynamics.jl with run_steadystate.jl to run the one of your choice.

NB: the code can exploit parallel computation. To do this, run your files as

julia -t 6 "path-to-your-file"/run_dynamics.jl

where you want to replace "6" with the number of threads that you wish to use. As a general idea, you do not want to use more than 80% of the number of threads you have available in your machine, e.g. if you have a 4-core CPU, you are likely to have 8 threads and you may want to run the parallelization as indicated above.

Units and choosing parameters

See the section "Units and choosing parameters" for a discussion on the choice of units implemented in SpiDy.jl and how to choose these parameters given a concrete real problem.

Index

diff --git a/dev/noise/index.html b/dev/noise/index.html index e147a01..cb59b68 100644 --- a/dev/noise/index.html +++ b/dev/noise/index.html @@ -1,2 +1,2 @@ -Noise · SpiDy.jl

Noise

SpiDy.NoiseType
abstract type Noise

An abstract type used to represent different kinds of environment noise.

Any user-defined subtype of Noise should implement a method spectrum(::NoiseSubType, ω) which returns the spectrum of the noise at the given frequency ω.

source
SpiDy.ClassicalNoiseType
struct ClassicalNoise{TT<:Real} <: Noise

A subtype of Noise used to represent classical noise, with spectrum

\[\mathcal{S}(\omega) = \frac{2k_\mathrm{B}T}{\hbar\omega}\]

Fields

  • T::TT: The temperature of the environment associated with the noise.
source
SpiDy.QuantumNoiseType
struct QuantumNoise{TT<:Real} <: Noise

A subtype of Noise used to represent quantum noise, with spectrum

\[\mathcal{S}(\omega) = \coth\left(\frac{\hbar\omega}{2k_\mathrm{B}T}\right)\]

Fields

  • T::TT: The temperature of the environment associated with the noise.
source
SpiDy.NoZeroQuantumNoiseType
struct NoZeroQuantumNoise{TT<:Real} <: Noise

A subtype of Noise used to represent quantum noise with zero-point-fluctuations removed, that is with spectrum

\[\mathcal{S}(\omega) = \coth\left(\frac{\hbar\omega}{2k_\mathrm{B}T}\right) - 1\]

Fields

  • T::TT: The temperature of the environment associated with the noise.
source
SpiDy.spectrumFunction
spectrum(::Noise)

Return the spectrum of the given noise as a function of frequency.

Arguments

  • n::Noise: The noise type.

Returns

A function that takes a frequency ω and returns the corresponding spectrum value.

source
SpiDy.psdFunction
function psd(J::AbstractSD, noise::Noise)

Calculate the Power Spectral Density (PSD) for a given environment spectral density J and noise model noise.

Arguments

  • J::AbstractSD: The environment spectral density.
  • noise::Noise: The noise model for the environment.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Returns

A function psd(ω) that calculates the PSD at a given frequency ω.

source
+Noise · SpiDy.jl

Noise

SpiDy.NoiseType
abstract type Noise

An abstract type used to represent different kinds of environment noise.

Any user-defined subtype of Noise should implement a method spectrum(::NoiseSubType, ω) which returns the spectrum of the noise at the given frequency ω.

source
SpiDy.ClassicalNoiseType
struct ClassicalNoise{TT<:Real} <: Noise

A subtype of Noise used to represent classical noise, with spectrum

\[\mathcal{S}(\omega) = \frac{2k_\mathrm{B}T}{\hbar\omega}\]

Fields

  • T::TT: The temperature of the environment associated with the noise.
source
SpiDy.QuantumNoiseType
struct QuantumNoise{TT<:Real} <: Noise

A subtype of Noise used to represent quantum noise, with spectrum

\[\mathcal{S}(\omega) = \coth\left(\frac{\hbar\omega}{2k_\mathrm{B}T}\right)\]

Fields

  • T::TT: The temperature of the environment associated with the noise.
source
SpiDy.NoZeroQuantumNoiseType
struct NoZeroQuantumNoise{TT<:Real} <: Noise

A subtype of Noise used to represent quantum noise with zero-point-fluctuations removed, that is with spectrum

\[\mathcal{S}(\omega) = \coth\left(\frac{\hbar\omega}{2k_\mathrm{B}T}\right) - 1\]

Fields

  • T::TT: The temperature of the environment associated with the noise.
source
SpiDy.spectrumFunction
spectrum(::Noise)

Return the spectrum of the given noise as a function of frequency.

Arguments

  • n::Noise: The noise type.

Returns

A function that takes a frequency ω and returns the corresponding spectrum value.

source
SpiDy.psdFunction
function psd(J::AbstractSD, noise::Noise)

Calculate the Power Spectral Density (PSD) for a given environment spectral density J and noise model noise.

Arguments

  • J::AbstractSD: The environment spectral density.
  • noise::Noise: The noise model for the environment.

Note: The LorentzianSD type is provided by the SpectralDensities.jl package.

Returns

A function psd(ω) that calculates the PSD at a given frequency ω.

source
diff --git a/dev/search/index.html b/dev/search/index.html index 3788f4d..fa592dc 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · SpiDy.jl

Loading search...

    +Search · SpiDy.jl

    Loading search...

      diff --git a/dev/spectraldensity/index.html b/dev/spectraldensity/index.html index 3ce489c..389ab80 100644 --- a/dev/spectraldensity/index.html +++ b/dev/spectraldensity/index.html @@ -1,2 +1,2 @@ -Spectral density · SpiDy.jl

      Spectral density

      Spectral densities are implemented using the SpectralDensities.jl package. Please refer to its documentation for details of how to use it. For SpiDy.jl, the key type is LorentzianSD, which is here used to characterise the spectral density of the environment.

      +Spectral density · SpiDy.jl

      Spectral density

      Spectral densities are implemented using the SpectralDensities.jl package. Please refer to its documentation for details of how to use it. For SpiDy.jl, the key type is LorentzianSD, which is here used to characterise the spectral density of the environment.

      diff --git a/dev/stochasticfield/index.html b/dev/stochasticfield/index.html index d96c3e9..8a76fe8 100644 --- a/dev/stochasticfield/index.html +++ b/dev/stochasticfield/index.html @@ -1,2 +1,2 @@ -Stochastic field · SpiDy.jl

      Stochastic field

      SpiDy.bfieldFunction
      bfield(N, Δt, J::AbstractSD, noise::Noise; distro=Normal(0., 1/sqrt(Δt)), interpolation=true)

      Generate a stochastic field realisation time series (of length N and spacing Δt) based on the given noise model noise and spectral density J.

      Arguments

      • N: The number of time steps.
      • Δt: The time step size.
      • J::AbstractSD: The environment spectral density.
      • noise::Noise: The noise model for the environment.
      • distro=Normal(0., 1/sqrt(Δt)): (Optional) The distribution of noise samples. Default is a normal distribution with mean 0 and standard deviation 1/sqrt(Δt).
      • interpolation=true: (Optional) Specifies whether to use linear interpolation for the stochastic field time series. Default is true.

      Note: The AbstractSD type is provided by the SpectralDensities.jl package.

      Returns

      A time series of the stochastic field values.

      source
      +Stochastic field · SpiDy.jl

      Stochastic field

      SpiDy.bfieldFunction
      bfield(N, Δt, J::AbstractSD, noise::Noise; distro=Normal(0., 1/sqrt(Δt)), interpolation=true)

      Generate a stochastic field realisation time series (of length N and spacing Δt) based on the given noise model noise and spectral density J.

      Arguments

      • N: The number of time steps.
      • Δt: The time step size.
      • J::AbstractSD: The environment spectral density.
      • noise::Noise: The noise model for the environment.
      • distro=Normal(0., 1/sqrt(Δt)): (Optional) The distribution of noise samples. Default is a normal distribution with mean 0 and standard deviation 1/sqrt(Δt).
      • interpolation=true: (Optional) Specifies whether to use linear interpolation for the stochastic field time series. Default is true.

      Note: The AbstractSD type is provided by the SpectralDensities.jl package.

      Returns

      A time series of the stochastic field values.

      source
      diff --git a/dev/units/index.html b/dev/units/index.html index 70b5def..0460260 100644 --- a/dev/units/index.html +++ b/dev/units/index.html @@ -20,4 +20,4 @@ \bar{\mathbf{S}}\times\left(\bar{\mathbf{B}}_\mathrm{ext} + \frac{1}{\sqrt{S_0}}\bar{\mathbf{b}} + \bar{\mathbf{V}}\right), \\ \frac{\mathrm{d}\bar{\mathbf{V}}}{\mathrm{d}\bar{t}} &= \bar{\mathbf{W}}, \\ \frac{\mathrm{d}\bar{\mathbf{W}}}{\mathrm{d}\bar{t}} &= \bar{\alpha}\bar{\mathbf{S}} - \bar{\omega}_0^2\bar{\mathbf{V}} - \bar{\Gamma}\bar{\mathbf{W}}, -\end{align}\]

      with environment Lorentzian spectral density

      \[\bar{J}(\bar{\omega}) = \frac{\bar{\alpha}\bar{\Gamma}}{\pi} \frac{\bar{\omega}}{(\bar{\omega}_0^2 - \bar{\omega}^2)^2 + \bar{\omega}^2\bar{\Gamma}^2},\]

      and thermal stochastic noise $\bar{\mathbf{b}}$ with power spectral density

      \[\bar{P}(\bar{\omega}) = \pi \bar{J}(\bar{\omega})\bar{N}(\bar{\omega}).\]

      For the "quantum" noise, the noise term is given by

      \[\bar{N}_\mathrm{qu}(\bar{\omega}) = \coth\left(\frac{\bar{\omega}}{2\bar{T}}\right),\]

      while for "classical" noise we have

      \[\bar{N}_\mathrm{cl}(\bar{\omega}) = \frac{2\bar{T}}{\bar{\omega}}.\]

      Finally, note that with these definitions above, the unit-free Gilbert damping is given by (see NJP 24 033020 (2022))

      \[\eta = \frac{\bar{\alpha}\bar{\Gamma}}{\bar{\omega}_0^4}.\]

      Units convention in old versions of SpiDy.jl

      Note that the unit conversion just explained, in line with NJP 24 033020 (2022), is correct for SpiDy.jl versions 1.2.0 and later.

      Older version of SpiDy.jl used a different convention, which unfortunately meant that a change of spin length $S_0$ implied a change in temperature and time-scale, therefore requiring redefining the temperature, the paramerts of the Loretnzian, evolution time, etc.

      The change in units convetion means that versions of SpiDy.jl before and after 1.2.0 will produce different results. This breaking change was made to bring the code into consistency with the article NJP 24 033020 (2022) and to make the mapping of parameters used in SpiDy.jl to real units much easier and more straightforward (see also next section).

      Finally, it is worth noting that the behaviour of SpiDy.jl in older versions can be exactly recovered by passing the option $S_0 = 1$ to the integrator, since in that case both units conventions agree.

      Extracting Lorentzian units from experimental data

      To be written. See also EPL 139 36002 (2022).

      +\end{align}\]

      with environment Lorentzian spectral density

      \[\bar{J}(\bar{\omega}) = \frac{\bar{\alpha}\bar{\Gamma}}{\pi} \frac{\bar{\omega}}{(\bar{\omega}_0^2 - \bar{\omega}^2)^2 + \bar{\omega}^2\bar{\Gamma}^2},\]

      and thermal stochastic noise $\bar{\mathbf{b}}$ with power spectral density

      \[\bar{P}(\bar{\omega}) = \pi \bar{J}(\bar{\omega})\bar{N}(\bar{\omega}).\]

      For the "quantum" noise, the noise term is given by

      \[\bar{N}_\mathrm{qu}(\bar{\omega}) = \coth\left(\frac{\bar{\omega}}{2\bar{T}}\right),\]

      while for "classical" noise we have

      \[\bar{N}_\mathrm{cl}(\bar{\omega}) = \frac{2\bar{T}}{\bar{\omega}}.\]

      Finally, note that with these definitions above, the unit-free Gilbert damping is given by (see NJP 24 033020 (2022))

      \[\eta = \frac{\bar{\alpha}\bar{\Gamma}}{\bar{\omega}_0^4}.\]

      Units convention in old versions of SpiDy.jl

      Note that the unit conversion just explained, in line with NJP 24 033020 (2022), is correct for SpiDy.jl versions 1.2.0 and later.

      Older version of SpiDy.jl used a different convention, which unfortunately meant that a change of spin length $S_0$ implied a change in temperature and time-scale, therefore requiring redefining the temperature, the paramerts of the Loretnzian, evolution time, etc.

      The change in units convetion means that versions of SpiDy.jl before and after 1.2.0 will produce different results. This breaking change was made to bring the code into consistency with the article NJP 24 033020 (2022) and to make the mapping of parameters used in SpiDy.jl to real units much easier and more straightforward (see also next section).

      Finally, it is worth noting that the behaviour of SpiDy.jl in older versions can be exactly recovered by passing the option $S_0 = 1$ to the integrator, since in that case both units conventions agree.

      Extracting Lorentzian units from experimental data

      To be written. See also EPL 139 36002 (2022).