Skip to content

Commit

Permalink
Rename PB noise to PL noise 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
EigenSolver committed Aug 14, 2024
1 parent 5bd2470 commit fc0af56
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/src/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ OrnsteinUhlenbeckField
```

```@docs
PinkBrownianField
PinkLorentzianField
```

```@docs
Expand Down
4 changes: 2 additions & 2 deletions src/SpinShuttling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export ShuttlingModel, OneSpinModel, TwoSpinModel,
OneSpinForthBackModel,
TwoSpinSequentialModel, TwoSpinParallelModel,
RandomFunction, CompositeRandomFunction,
OrnsteinUhlenbeckField, PinkBrownianField
OrnsteinUhlenbeckField, PinkLorentzianField
export statefidelity, sampling, characteristicfunction, characteristicvalue
export dephasingmatrix, covariance, covariancematrix
export W
Expand Down Expand Up @@ -353,7 +353,7 @@ function W(T::Real, L::Real, B::OrnsteinUhlenbeckField; path=:straight)::Real
end
end

function W(T::Real, L::Real, B::PinkBrownianField)::Real
function W(T::Real, L::Real, B::PinkLorentzianField)::Real
β = T .* B.γ
γ = L * B.θ[1]
return exp(-B.σ^2 * T^2 * F3(β, γ))
Expand Down
6 changes: 3 additions & 3 deletions src/stochastics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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.
"""
struct PinkBrownianField <: GaussianRandomField
struct PinkLorentzianField <: GaussianRandomField
μ::Union{<:Real,Function} # mean
θ::Vector{<:Real}
σ::Real
Expand Down Expand Up @@ -138,13 +138,13 @@ Covariance function of Gaussian random field.
# Arguments
- `p₁::Point`: time-position array
- `p₂::Point`: time-position array
- `process<:GaussianRandomField`: a Gaussian random field, e.g. `OrnsteinUhlenbeckField` or `PinkBrownianField`
- `process<:GaussianRandomField`: a Gaussian random field, e.g. `OrnsteinUhlenbeckField` or `PinkLorentzianField`
"""
function covariance(p₁::Point, p₂::Point, process::OrnsteinUhlenbeckField)::Real
process.σ^2 / prod(2 * process.θ) * exp(-dot(process.θ, abs.(p₁ .- p₂)))
end

function covariance(p₁::Point, p₂::Point, process::PinkBrownianField)::Real
function covariance(p₁::Point, p₂::Point, process::PinkLorentzianField)::Real
t₁ = p₁[1]
t₂ = p₂[1]
x₁ = p₁[2:end]
Expand Down
4 changes: 2 additions & 2 deletions test/testfidelity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ end
v=1; T=L/v; κₓ=10;
# T=10
# 1/T=0.1 N/T=20
B=PinkBrownianField(0,[κₓ],σ, γ)
B=PinkLorentzianField(0,[κₓ],σ, γ)
model=OneSpinModel(T,L,N,B)

f1=statefidelity(model)
Expand Down Expand Up @@ -141,7 +141,7 @@ end
# T=10
# 1/T=0.1 N/T=20
D=0.3;
B=PinkBrownianField(0,[κₓ,κₓ],σ, γ)
B=PinkLorentzianField(0,[κₓ,κₓ],σ, γ)
model=TwoSpinParallelModel(T, D, L, N, B)

f1=statefidelity(model)
Expand Down
2 changes: 1 addition & 1 deletion test/testspectrum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ visualize=true
# 0.01 ~ 100 μs
# v = 0.1 ~ 1000 m/s
v=1; T=L/v;
B=PinkBrownianField(0,[κₓ],σ, γ)
B=PinkLorentzianField(0,[κₓ],σ, γ)
model=OneSpinModel(T,L,N,B)
println(model)

Expand Down
2 changes: 1 addition & 1 deletion test/teststochastics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ end
# 0.01 ~ 100 μs
# v = 0.1 ~ 1000 m/s
v=2;
B=PinkBrownianField(0,[κₓ],σ, γ)
B=PinkLorentzianField(0,[κₓ],σ, γ)
# B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ)

M=5
Expand Down

0 comments on commit fc0af56

Please sign in to comment.