rapidity.models module

Physical models for the rapidity package.

This module defines the Model protocol, which specifies the interface that all integrable models must implement, and concrete implementations of specific models.

Currently implemented:

  • LiebLiniger — the Lieb-Liniger model of bosons with delta interaction

To implement a new model, create a dataclass that satisfies the Model protocol by implementing all required methods.

class rapidity.models.LiebLiniger(c, rapidity_label='theta')

Bases: object

The Lieb-Liniger model of bosons with repulsive delta interaction.

The model is parameterized by the coupling constant c only. The thermodynamic state is encoded separately in TBAState. The scattering kernel includes the 1/(2π) factor by convention, so the TBA equation reads:

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

c (float) – Coupling constant. Must be positive for repulsive interactions.

Examples

>>> model = LiebLiniger(c=1.0)
>>> grid = Grid1D.gauss_hermite(200, "theta")
>>> kernel = model.kernel(grid)
bare_state_density(grid)

Bare density of states: a(theta) = 1/(2pi).

Return type:

Field

c: float
charge(order, grid)

Single-particle eigenvalue of the conserved charge of given order.

\[q_s(\theta) = \theta^s\]
Parameters:
  • order (int) – Order of the charge.

  • grid (Grid1D) – The rapidity grid.

Returns:

The charge eigenvalue as a 1D Field.

Return type:

Field

driving(grid, betas)

Driving term as a linear combination of charge eigenvalues.

\[\epsilon_0(\theta) = \sum_s \beta_s \theta^s\]
Parameters:
  • grid (Grid1D) – The rapidity grid.

  • betas (dict[int, float]) – Chemical potentials keyed by charge order. For example {2: 1/T, 0: -mu/T} gives a thermal state at temperature T with chemical potential mu.

Returns:

The driving term as a 1D Field.

Return type:

Field

kernel(grid)

Lieb-Liniger scattering kernel including the 1/(2π) factor.

\[K(\theta) = \frac{c}{\pi(c^2 + \theta^2)}\]
Parameters:

grid (Grid1D) – The rapidity grid.

Returns:

The scattering kernel as a 2D Field.

Return type:

Field

rapidity_label: str = 'theta'
class rapidity.models.Model(*args, **kwargs)

Bases: Protocol

Protocol for integrable models.

Any class implementing these methods can be used as a model in TBAState.

bare_state_density(grid)

Bare density of states a(theta).

Return type:

Field

charge(order, grid)

Single-particle eigenvalue of the conserved charge of given order.

Return type:

Field

driving(grid, betas)

Driving term as a linear combination of charge eigenvalues.

Return type:

Field

kernel(grid)

Scattering kernel including the 1/(2π) factor.

Return type:

Field

rapidity_label: str
class rapidity.models.QHR(a, rapidity_label='theta')

Bases: object

The Quantum hard rods model.

The model is parameterized by the rod length a only. The thermodynamic state is encoded separately in TBAState. The scattering kernel includes the 1/(2π) factor by convention, so the TBA equation reads:

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

a (float) – Rod length. Must be positive.

Examples

>>> model = QHR(a=1.0)
>>> grid = Grid1D.gauss_hermite(200, "theta")
>>> kernel = model.kernel(grid)
a: float
bare_state_density(grid)

Bare density of states: a(theta) = 1/(2pi).

Return type:

Field

charge(order, grid)

Single-particle eigenvalue of the conserved charge of given order.

\[q_s(\theta) = \theta^s\]
Parameters:
  • order (int) – Order of the charge.

  • grid (Grid1D) – The rapidity grid.

Returns:

The charge eigenvalue as a 1D Field.

Return type:

Field

driving(grid, betas)

Driving term as a linear combination of charge eigenvalues.

\[\epsilon_0(\theta) = \sum_s \beta_s \theta^s\]
Parameters:
  • grid (Grid1D) – The rapidity grid.

  • betas (dict[int, float]) – Chemical potentials keyed by charge order. For example {2: 1/T, 0: -mu/T} gives a thermal state at temperature T with chemical potential mu.

Returns:

The driving term as a 1D Field.

Return type:

Field

kernel(grid)

QHR scattering kernel including the 1/(2π) factor.

\[K(\theta) = -a\]
Parameters:

grid (Grid1D) – The rapidity grid.

Returns:

The scattering kernel as a 2D Field.

Return type:

Field

rapidity_label: str = 'theta'