rapidity.tba module

Thermodynamic Bethe Ansatz solver.

This module provides the TBAState class representing the thermodynamic state of an integrable model, and the tools to compute thermodynamic quantities from it.

The TBA equation for a single-species model reads:

\[\epsilon(\theta) = \epsilon_0(\theta) - \int d\theta'\, K(\theta - \theta') \log(1 + e^{-\epsilon(\theta')})\]

where \(\epsilon_0\) is the driving term, \(K\) is the scattering kernel, and the filling function is:

\[n(\theta) = \frac{1}{1 + e^{\epsilon(\theta)}}\]

The state can be constructed from chemical potentials, a filling function, or a particle density.

class rapidity.tba.TBAState(model, grid, filling)

Bases: object

Thermodynamic state of an integrable model.

The state is characterized by the filling function n(theta), which encodes the occupation of rapidity modes. It always carries the model and grid alongside the filling function.

Parameters:
  • model (Model) – The integrable model.

  • grid (Grid1D) – The rapidity grid.

  • filling (Field) – The filling function n(theta).

Examples

>>> from rapidity.models import LiebLiniger
>>> from rapidity.core import Grid1D
>>> model = LiebLiniger(c=1.0)
>>> grid = Grid1D.gauss_hermite(200, "theta")
>>> state = TBAState.from_betas(model, grid, betas={2: 1.0, 0: -0.5})
bare_state_density()

Bare density of states a(theta).

Delegates to the model’s implementation of bare_state_density, which satisfies:

\[a(\theta) = \frac{1}{2\pi} \partial_\theta q_1(\theta)\]
Returns:

The bare density of states as a 1D Field.

Return type:

Field

dress(h)

Compute the dressed quantity h^dr via the dressing equation.

\[h^{dr}(\theta) = h(\theta) + \int d\theta'\, K(\theta - \theta') n(\theta') h^{dr}(\theta')\]
Parameters:

h (Field) – The bare quantity to dress.

Returns:

The dressed quantity.

Return type:

Field

filling: Field
free_energy()

Compute the free energy density.

\[f = -\int \frac{d\theta}{2\pi} \log(1 + e^{-\epsilon(\theta)})\]
Returns:

The free energy density.

Return type:

float

classmethod from_betas(model, grid, betas, tol=1e-10, max_iter=1000)

Construct state by solving the TBA equation from chemical potentials.

Parameters:
  • model (Model) – The integrable model.

  • grid (Grid1D) – The rapidity grid.

  • betas (dict[int, float]) – Chemical potentials keyed by charge order.

  • tol (float) – Convergence tolerance for the TBA iteration. Default is 1e-10.

  • max_iter (int) – Maximum number of iterations. Default is 1000.

Returns:

The thermodynamic state.

Return type:

TBAState

classmethod from_density(model, grid, rho_p)

Construct state from particle density rho_p(theta).

Parameters:
  • model (Model) – The integrable model.

  • grid (Grid1D) – The rapidity grid.

  • rho_p (Field) – The particle density.

Returns:

The thermodynamic state.

Return type:

TBAState

classmethod from_filling(model, grid, filling)

Construct state directly from a filling function.

Parameters:
  • model (Model) – The integrable model.

  • grid (Grid1D) – The rapidity grid.

  • filling (Field) – The filling function n(theta).

Returns:

The thermodynamic state.

Return type:

TBAState

grid: Grid1D
model: Model
rho_p()

Compute the particle density rho_p(theta).

\[\rho_p(\theta) = n(\theta) \rho_s(\theta)\]
Returns:

The particle density as a 1D Field.

Return type:

Field

rho_s()

Compute the density of states rho_s(theta).

\[\rho_s(\theta) = a^{dr}(\theta)\]

where \(a(\theta)\) is the bare state density.

Returns:

The density of states as a 1D Field.

Return type:

Field

v_eff()

Compute the effective velocity v^eff(theta).

\[v^{eff}(\theta) = \frac{(\partial_\theta q_2)^{dr}} {(\partial_\theta q_1)^{dr}}\]

where \(q_1\) and \(q_2\) are the momentum and energy charges respectively.

Returns:

The effective velocity as a 1D Field.

Return type:

Field

classmethod zero_temperature(model, theta_f, n_points=200)

Construct zero temperature ground state.

At zero temperature all states within the Fermi sea are filled. The particle density satisfies the linear integral equation:

\[\rho_p(\theta) = a(\theta) + \int_{-\theta_F}^{\theta_F} K(\theta - \theta') \rho_p(\theta') d\theta'\]

which is equivalent to dressing with uniform filling n=1.

Parameters:
  • model (Model) – The integrable model.

  • theta_f (float) – The Fermi rapidity.

  • n_points (int) – Number of Gauss-Legendre quadrature points. Default is 200.

Returns:

The zero temperature ground state with filling n=1 everywhere.

Return type:

TBAState