fit

  • full name: tenpy.tools.fit

  • parent module: tenpy.tools

  • type: module

Functions

alg_decay(x, a, b, c)

Algebraic decay function :math :a * x^{-b} + c.

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

Fit y to an algebraic decay of the form :math :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, ...])

Batched version of alg_decay().

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 y ~ a * x + b.

plot_alg_decay_fit(plot_module, x, y, fit_par)

Utility function used the plot an algebraic fit function next to the data.

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.