Inverse temperature (beta) extrapolation (beta
)#
Classes:
|
Sympy function to evaluate energy fluctuations using central moments. |
|
Sympy function to evaluate energy averages using central moments. |
|
Sympy function to evaluate observable energy fluctuations using central moments. |
|
Sympy function to evaluate derivatives of observable fluctuations using central moments. |
|
Sympy function to evaluate derivatives of observable \(\langle x \rangle\) using central moments. |
|
Sympy function to evaluate derivatives of observable \(\langle x(\beta) \rangle\) using central moments. |
|
Sympy function to evaluate derivatives of energy \(\langle u \rangle\) using raw moments. |
|
Sympy function to evaluate derivatives of \(\langle x u^n \rangle\). |
|
Provide symbolic expressions for \(d^n \langle x \rangle /d\beta^n\). |
Functions:
|
Factory function to provide derivative function for expansion. |
|
Factory function to create Extrapolation model for beta expansion. |
|
Factory function to create PerturbModel for beta expansion. |
- class thermoextrap.beta.du_func(beta, n)[source]#
Bases:
SymFuncBase
Sympy function to evaluate energy fluctuations using central moments.
\(\text{du_func}(\beta, n) = \langle (u(\beta) - \langle u(\beta) \rangle)^n \rangle\)
Notes
sub in
{'beta': 'None'}
to convert to indexed objects Have to use'None'
instead ofNone
as sympy does some magic to the input arguments.Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta, n)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.u_func_central(beta)[source]#
Bases:
SymFuncBase
Sympy function to evaluate energy averages using central moments.
\(\text{u_func_central}(beta, n) = \langle u(\beta)^n \rangle\)
Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.dxdu_func_nobeta(beta, n)[source]#
Bases:
SymFuncBase
Sympy function to evaluate observable energy fluctuations using central moments.
\(\text{dxdu_func_nobeta}(\beta, n) = \langle \delta x (\delta u)^n \rangle\)
for use when x is not a function of beta.
Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta, n)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.dxdu_func_beta(beta, n, deriv)[source]#
Bases:
SymFuncBase
Sympy function to evaluate derivatives of observable fluctuations using central moments.
\(\text{dxdu_func_beta}(\beta, n, d) = \langle \delta x^{(d)}(\beta)(\delta u)^n \rangle\), where \(x^{(k)} = d^k x / d\beta^k\).
Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta, n, deriv)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.x_func_central_nobeta(beta)[source]#
Bases:
SymFuncBase
Sympy function to evaluate derivatives of observable \(\langle x \rangle\) using central moments.
Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.x_func_central_beta(beta, deriv)[source]#
Bases:
SymFuncBase
Sympy function to evaluate derivatives of observable \(\langle x(\beta) \rangle\) using central moments.
Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta, deriv)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.u_func(beta, n)[source]#
Bases:
SymFuncBase
Sympy function to evaluate derivatives of energy \(\langle u \rangle\) using raw moments.
Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta, n)Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.xu_func(beta, n, deriv=None)[source]#
Bases:
SymFuncBase
Sympy function to evaluate derivatives of \(\langle x u^n \rangle\).
If
x
is a function ofbeta
, then \(\text{xu_func}(\beta, n, d) = \langle x^{(d)} u^n \rangle\). Ifx
is not a function ofbeta
, drop argumentd
.Methods:
Symbol arguments of function.
fdiff
([argindex])Derivative of function.
eval
(beta, n[, deriv])Evaluate function.
- classmethod deriv_args()[source]#
Symbol arguments of function.
This is used by Data class to create a ‘lambdfied’ callable function.
See also
- fdiff(argindex=1)[source]#
Derivative of function. This will be used by
thermoextrap.models.SymDerivBase
.
- class thermoextrap.beta.SymDerivBeta(func, args=None, expand=True, post_func=None)[source]#
Bases:
SymDerivBase
Provide symbolic expressions for \(d^n \langle x \rangle /d\beta^n\).
- Parameters:
func (
Function
) – Function to differentiate. This should (most likely) be an instance ofthermoextrap.models.SymFuncBase
post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
Methods:
x_ave
([xalpha, central, expand, post_func])General method to find derivatives of \(\langle x \rangle\).
u_ave
([central, expand, post_func])General constructor for symbolic derivatives of \(\langle u \rangle\).
dun_ave
(n[, expand, post_func, central])Constructor for derivatives of \(\langle (\delta u)^n\rangle\).
dxdun_ave
(n[, xalpha, expand, post_func, d, ...])Constructor for derivatives of \(\langle \delta x \delta u^n\rangle\).
un_ave
(n[, expand, post_func, central])Constructor for derivatives of \(\langle u^n\rangle\).
xun_ave
(n[, d, xalpha, expand, post_func, ...])Constructor for deriatives of \(\langle x^{(d)} u^n\rangle\).
from_name
(name[, xalpha, central, expand, ...])Create a derivative expressions indexer by name.
- classmethod x_ave(xalpha=False, central=None, expand=True, post_func=None)[source]#
General method to find derivatives of \(\langle x \rangle\).
- Parameters:
xalpha (
bool
, defaultFalse
) – Flag whether u depends on variable alpha.central (
bool
) – If True, Use central moments. Otherwise, use raw moments.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
- classmethod u_ave(central=None, expand=True, post_func=None)[source]#
General constructor for symbolic derivatives of \(\langle u \rangle\).
- Parameters:
central (
bool
) – If True, Use central moments. Otherwise, use raw moments.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
- classmethod dun_ave(n, expand=True, post_func=None, central=None)[source]#
Constructor for derivatives of \(\langle (\delta u)^n\rangle\).
- Parameters:
n (
int
) – Order of moment.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
central (
bool
) – If True, Use central moments. Otherwise, use raw moments.
- classmethod dxdun_ave(n, xalpha=False, expand=True, post_func=None, d=None, central=None)[source]#
Constructor for derivatives of \(\langle \delta x \delta u^n\rangle\).
- Parameters:
n (
int
) – Order of moment.xalpha (
bool
, defaultFalse
) – Flag whether u depends on variable alpha.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
d (
int
) – Order of derivative ofx
.central (
bool
) – If True, Use central moments. Otherwise, use raw moments.
Notes
If xalpha is True, must also specify d.
- classmethod un_ave(n, expand=True, post_func=None, central=None)[source]#
Constructor for derivatives of \(\langle u^n\rangle\).
- Parameters:
n (
int
) – Order of moment.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
central (
bool
) – If True, Use central moments. Otherwise, use raw moments.
- classmethod xun_ave(n, d=None, xalpha=False, expand=True, post_func=None, central=None)[source]#
Constructor for deriatives of \(\langle x^{(d)} u^n\rangle\).
- Parameters:
n (
int
) – Order of moment.d (
int
) – Order of derivative ofx
.xalpha (
bool
, defaultFalse
) – Flag whether u depends on variable alpha.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
central (
bool
) – If True, Use central moments. Otherwise, use raw moments.
- classmethod from_name(name, xalpha=False, central=None, expand=True, post_func=None, n=None, d=None)[source]#
Create a derivative expressions indexer by name.
- Parameters:
name (
{'xave', 'uave', 'dun_ave', 'un_ave'}
)All properties use post_func and expand parameters. –
x_ave: general average of <x>(central, xalpha)
u_ave: <u>(central)
dun_ave: derivative of <(u - <u>)**n>(central, n)
dxdun_ave: derivatives of <dx^(d) * du**n>(xalpha, n, d)
un_ave: derivative of <u**n>(n)
xun_ave: derivative of <x^(d) * u**n>(xalpha, n, [d])
lnPi_correction: derivatives of <lnPi - beta * mu * N>(central)
xalpha (
bool
, defaultFalse
) – Whether property depends on alpha (beta)central (
bool
, defaultFalse
) – Whether central moments expansion should be usedexpand (
bool
, defaultTrue
) – Whether expressions should be expandedn (
int
, optional) – n parameter used for dun_ave or un_aved (
int
, optional) – d parameter for dxdun_ave
- thermoextrap.beta.factory_derivatives(name='x_ave', n=None, d=None, xalpha=False, central=None, post_func=None, expand=True)[source]#
Factory function to provide derivative function for expansion.
- Parameters:
name (
{x_ave, u_ave, dxdun_ave, dun_ave, un_ave, xun_ave}
)xalpha (
bool
, defaultFalse
) – Flag whether u depends on variable alpha.central (
bool
) – If True, Use central moments. Otherwise, use raw moments.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
- Returns:
derivatives (
thermoextrap.models.Derivatives
instance) – Object used to calculate taylor series coefficients
- thermoextrap.beta.factory_extrapmodel(beta, data, *, name='x_ave', n=None, d=None, xalpha=None, central=None, order=None, alpha_name='beta', derivatives=None, post_func=None, derivatives_kws=None)[source]#
Factory function to create Extrapolation model for beta expansion.
- Parameters:
beta (
float
) – reference value of inverse temperaturedata (
object
) – Instance of data object, e.g.thermoextrap.data.DataCentralMoments
n (
int
) – Order of moment.d (
int
) – Order of derivative ofx
.order (
int
) – maximum order of moments/expansion to calculatexalpha (
bool
, defaultFalse
) – Flag whether u depends on variable alpha.central (
bool
) – If True, Use central moments. Otherwise, use raw moments.post_func (
str
orcallable()
) – Transformation of base function. For example, post_fuc = -sympy.log is equivalent to passing minus_log=True If a string, then apply the following standard functionsminus_log : post_func = -sympy.log
pow_i : post_func = lambda f: pow(f, i). E.g., pow_2 => pow(f, 2)
alpha_name (
str
, default'beta'
) – name of expansion parameterkws (
dict
) – extra arguments to factory_data_values
- Returns:
extrapmodel (
ExtrapModel
)
Notes
Note that default values for parameters
order
,xalpha
, andcentral
are inferred from corresponding attributes ofdata
.See also
- thermoextrap.beta.factory_perturbmodel(beta, uv, xv, alpha_name='beta', **kws)[source]#
Factory function to create PerturbModel for beta expansion.
- Parameters:
beta (
float
) – reference value of inverse temperatureuv (array-like) – raw values of u (energy) if not DataArray, wrap with xrwrap_uv
xv (
xarray.DataArray
) – raw values of x (observable) if not DataArray, wrap with xrwrap_xvalpha_name (
str
, default'beta'
) – name of expansion parameterkws (
dict
) – extra arguments to data object
- Returns:
perturbmodel (
thermoextrap.models.PerturbModel
)
See also