A collection of utilities to manage bath correlation function and related quantities, including fitting of multi-exponential representations in time domain.
The package provides the functions:
- spectral density,
sd(w, b::AbstractBath)
- (zero temperature) bath correlation function,
bcf(t, b::AbstractBath)
for some bath b
.
ToDo: Add at some point
- effective thermal spectral density
- thermal bath correlation function
- thermal contribution of the BCF
Available baths:
- (sub- / super-) Ohmic with exponential cutoff,
OhmicExpCO(s, η, wc)
- multi exponential BCF,
MultiExpBCF(G, W)
orMultiExpBCF(u)
(see Examples)
ToDo: Use numeric integration to handle more complicated baths
A multi exponential representation $α(τ) = ∑_i exp(-u^{(i)}{12} - u^{(i)}{34} τ)$ of the BCF has turned out very useful for numerical methods solving open quantum system dynamics.
The subscript "12" and "34" indicate that BFCUtil
package allows to conveniently save the sequences of improved minima as well as the latest Sobol state.
In that way restarting the minimization with the same parameters will continue a previous search.
Parameters for the minimization are stored in
struct FitCfg
which has members
-
b::AbstractBath
, the bathb
defines the reference BCF -
tau_range::AbstractTauIter
, an iterator which yields the timest_i
at which the difference with the reference is calculated. The minimizer will then minimize the p-norm of the difference vectord_i = |bcf_ref(t_i) - bcf_apprx(t_i)|
-
num_exp_terms
, the number of exponential terms used for the multi-exp-representation -
p
of the p-norm -
u_init_min
minimum of$u$ when sampling initial condition as a four-tuple[u_1,u_2,_3,u_4]
(same limits for all$u^{(i)}$ ). Note that$u_1$ is the scale and$u_2$ the phase of the pre-factor.$u_3$ is usually positive, otherwise the there is exponential growth in time. The angular velocity$u_4$ is arbitrary, for Ohmic baths its usually positive. -
u_init_max
maximum of$u$ when sampling initial condition as a four-tuple[u_1,u_2,u_3,u_4]
. Since$u_{12}$ comes with a minus sign, large u_1 mean pre-factors with small magnitude. -
diff_kind
, so far absolute:abs_p_diff
and relative:rel_p_diff
has been implemented -
maxiters
, maximum number of allowed iterations for the minimizer
To trigger the minimization call fit(ofc::FitCfg, num_samples, path=".fit"; verbose=true)
with arguments
ofc
, an instance of the above explainedFitCfg
num_samples
, the maximum number of Sobol samples (initial conditions) to consider.path=".fit"
, the path where results are savedverbose=false
, iffalse
show only a message when a new minima outreaches previous ones, otherwise give detailed information for each sample.
ToDo: Explain
FitCfg_for_Ohmic_bath
Instantiate a bath b
with s=0.3, η=0.1 and wc = 7.
julia> using BCFUtils
julia> b = OhmicExpCO(0.3, 0.1, 7)
OhmicExpCO{Float64}(0.3, 0.1, 7.0, 0.028567379519453845)
Evaluate the spectral density and bath correlation function for the bath b
.
julia> sd(2.4, b)
0.09229164933483118
julia> bcf(3.6, b)
-0.0021995074140912564 - 0.004929562274049971im
The parameters G=[1,2]
and W=[3,4]
can be created as
b = MultiExpBCF([1,2im], [3im,4])
MultiExpBCF{Float64}([-0.0, -0.0, 0.0, 3.0, -0.6931471805599453, -1.5707963267948966, 4.0, 0.0], 2)
Note that the parameters are stored in
Alternatively the
Copyright © 2024 Richard Hartmann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.