SpectralDensity#
The SpectralDensity class represents the spectral density of a bath coupled to a quantum system. It is closely related to CorrelationFunction — the two are related by a Fourier transform.
Quantarhei package (http://www.github.com/quantarhei)
spectraldensities module
- class quantarhei.qm.corfunctions.spectraldensities.SpectralDensity(axis: Any = None, params: Any = None, values: Any = None)[source]#
Bases:
DFunction,UnitsManagedSpectral density of a system-bath coupling.
Stores the bath spectral density \(J(\omega)\) as a discrete function on a frequency grid. Can be constructed from the same parameter dictionaries as
CorrelationFunction.- Parameters:
axis (TimeAxis or FrequencyAxis) – Frequency grid on which the spectral density is defined, either directly as a
FrequencyAxisor derived from aTimeAxisvia FFT.params (dict or list of dict) – Parameter dictionary (or list of dictionaries for composite spectral densities). Each dictionary must contain at least
'ftype'and'reorg'.values (numpy.ndarray, optional) – If provided, use these pre-computed values instead of evaluating the analytical form.
Examples
SpectralDensity object can be ctreated with the same parameters as CorrelationFunction. The temperature can be set, but it is not a compulsory parameter.
>>> from quantarhei import TimeAxis >>> params = dict(ftype="OverdampedBrownian", cortime=100, reorg=20, T=300) >>> time = TimeAxis(0.0,1000,1.0) >>> with energy_units("1/cm"): sd = SpectralDensity(time, params)
>>> cf = sd.get_CorrelationFunction()
>>> print(sd.get_temperature()) 300
If we create the same without temperature
>>> parwoT = dict(ftype="OverdampedBrownian", cortime=100, reorg=20) >>> with energy_units("1/cm"): sdwoT = SpectralDensity(time, parwoT)
everything is alright. CorrelationFunction, however, cannot be created as above, because temperature must be known. Attempt to create CorrelationFunction as above would lead to an exception. We have to specify temperature as a parameter to the get_CorrelationFunction method.
>>> cf = sdwoT.get_CorrelationFunction(temperature=300)
Reorganization of the spectral density is an input parameter which can be obtained by calling the corresponding method
>>> with energy_units("1/cm"): ... print(sdwoT.get_reorganization_energy()) 20.0
At the same time, reorganization energy can be calculated from the shape of the spectral density by integrating over it. The accuracy of such estimation depends on numerics, hence the relative tolerance of only 1.0e-2 below
>>> lamb_definition = sd.get_reorganization_energy() >>> lamb_measured = sd.measure_reorganization_energy() >>> print(numpy.allclose(lamb_definition, lamb_measured, rtol=1.0e-2)) True
- energy_params = ('reorg', 'omega', 'freq', 'fcp', 'g_FWHM', 'l_FWHM', 'freq1', 'freq2', 'gamma')#
- analytical_types = 'OverdampedBrownian'#
- axis: FrequencyAxis#
- add_to_data(other: SpectralDensity) None[source]#
Addition of data from a specified CorrelationFunction to this object
- add_to_data2(other: SpectralDensity) None[source]#
Addition of data from a specified SpectralDensity to this object
- is_analytical() bool[source]#
Returns True if analytical
Returns True if the CorrelationFunction object is constructed by analytical formula. Returns False if the object was constructed by numerical transformation from spectral density.
- get_reorganization_energy() float | ndarray[source]#
Returns the reorganization energy of the cspectral density
- measure_reorganization_energy() float[source]#
Calculates the reorganization energy of the spectral density
Calculates the reorganization energy of the spectral density by integrating over frequency.
- copy() SpectralDensity[source]#
Creates a copy of the current correlation function
- get_CorrelationFunction(temperature: float | None = None, ta: Any = None) CorrelationFunction[source]#
Returns correlation function corresponding to the spectral density. If a TimeAxis object is included, the CorrelationFunction object will be returned with that TimeAxis instance as its time axis.
- get_FTCorrelationFunction(temperature: float | None = None) FTCorrelationFunction[source]#
Returns Fourier transformed correlation function
Fourier transformed correlation function is calculated from the analytical formula connecting spectral density and FT correlation function.
- Parameters:
temperature (optional) – Temperature which can be missing among the spectral density parameters