diff --git a/dev/couplingfunctions/index.html b/dev/couplingfunctions/index.html index 78d3d92..02db978 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 b68935b..0cccf82 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 fc386b3..e6ae499 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=[], 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.
  • projection=true: (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 true.
  • 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.

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=[], 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.
  • projection=true: (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 true.
  • 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.

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=[], 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

  • 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.
  • bfields: 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: (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.
  • projection=true: (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 true.
  • 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.

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=[], 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.
  • projection=true: (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 true.
  • 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.

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=[], 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.
  • projection=true: (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 true.
  • 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.

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=[], 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

  • 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.
  • bfields: 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: (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.
  • projection=true: (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 true.
  • 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.

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 ffbc40f..86ea677 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.

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.

Index

diff --git a/dev/noise/index.html b/dev/noise/index.html index 9577afd..49cf034 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 noise(::NoiseSubType) which should return a function that represent the spectrum of the noise.

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(n::ClassicalNoise)

Construct the spectrum of ClassicalNoise at a given frequency.

Arguments

  • n::ClassicalNoise: The classical noise.

Returns

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

source
spectrum(n::QuantumNoise)

Construct the spectrum of QuantumNoise at a given frequency.

Arguments

  • n::QuantumNoise: The quantum noise.

Returns

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

source
spectrum(n::NoZeroQuantumNoise)

Construct the spectrum of NoZeroQuantumNoise at a given frequency.

Arguments

  • n::NoZeroQuantumNoise: The no-zero-point-fluctuations quantum noise.

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 noise(::NoiseSubType) which should return a function that represent the spectrum of the noise.

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(n::ClassicalNoise)

Construct the spectrum of ClassicalNoise at a given frequency.

Arguments

  • n::ClassicalNoise: The classical noise.

Returns

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

source
spectrum(n::QuantumNoise)

Construct the spectrum of QuantumNoise at a given frequency.

Arguments

  • n::QuantumNoise: The quantum noise.

Returns

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

source
spectrum(n::NoZeroQuantumNoise)

Construct the spectrum of NoZeroQuantumNoise at a given frequency.

Arguments

  • n::NoZeroQuantumNoise: The no-zero-point-fluctuations quantum noise.

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 a4cbcdb..42c9562 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 2d9a23a..89fcb49 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 0c3136e..96c2788 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