fit

  • full name: tenpy.tools.fit

  • parent module: tenpy.tools

  • type: module

Functions

alg_decay(x, a, b, c)

define the algebraic decay.

alg_decay_fit(x, y[, npts, power_range, …])

Fit y to the form a*x**(-b) + c.

alg_decay_fit_res(log_b, x, y)

Returns the residue of an algebraic decay fit of the form x**(-np.exp(log_b)).

alg_decay_fits(x, ys[, npts, power_range, …])

Fit arrays of y’s to the form a * x**(-b) + c.

central_charge_from_S_profile(psi[, exclude])

Fit the entanglement entropy of a finite MPS to the expected profile for critical models.

entropy_profile_from_CFT(size_A, L, …)

Expected profile for the entanglement entropy at a critical point.

fit_with_sum_of_exp(f, n[, N])

Approximate a decaying function f with a sum of exponentials.

lin_fit_res(x, y)

Returns the least-square residue of a linear fit y vs x.

linear_fit(x, y)

Perform a linear fit of y to ax + b.

plot_alg_decay_fit(plot_module, x, y, fit_par)

Given x, y, and fit_par (output from alg_decay_fit), produces a plot of the algebraic decay fit.

sum_of_exp(lambdas, prefactors, x)

Evaluate sum_i prefactor[i] * lambda[i]**x for different x.

Module description

tools to fit to an algebraic decay.