R-matrix solver

High-level R-matrix solver built on a Lagrange mesh.

class jitr.rmatrix.rmatrix.Solver(nbasis, basis='Legendre', **args)[source]

Bases: object

Solve coupled-channel Schrödinger equations with the R-matrix method.

Parameters:
  • nbasis (int)

  • basis (str)

  • args (Any)

radial_grid(a, k0)[source]

Return the physical quadrature grid for a dimensionless radius a.

Return type:

ndarray[tuple[Any, ...], dtype[double]]

Parameters:
nonlocal_radial_grids(a, k0)[source]

Return the physical tensor-product quadrature grids for a.

Return type:

tuple[ndarray[tuple[Any, ...], dtype[double]], ndarray[tuple[Any, ...], dtype[double]]]

Parameters:
precompute_boundaries(a)[source]

Precompute basis-function values at the channel radius a.

Return type:

ndarray[tuple[Any, ...], dtype[cdouble]]

Parameters:

a (float)

get_channel_block(matrix, i, j=None)[source]

Extract a channel block from a full block-structured matrix.

Return type:

ndarray[tuple[Any, ...], dtype[cdouble]]

Parameters:
  • matrix (ArrayLike)

  • i (int)

  • j (int | None)

free_matrix(a, l, E=None, mu=None, coupled=True)[source]

Precompute the free Hamiltonian matrix.

With coupled=True return the full block-diagonal matrix over every channel in l. With coupled=False the channels are independent, so return one nbasis x nbasis block per channel instead; each block owns its memory rather than viewing into the (nbasis * n_channels)**2 coupled matrix.

Return type:

ndarray[tuple[Any, ...], dtype[cdouble]] | list[ndarray[tuple[Any, ...], dtype[cdouble]]]

Parameters:
  • a (float)

  • l (ArrayLike)

  • E (ArrayLike | None)

  • mu (ArrayLike | None)

  • coupled (bool)

interaction_matrix(k0, E0, a, nch, local_potential=None, nonlocal_potential=None)[source]

Build the interaction matrix from pre-evaluated potential arrays.

Return type:

ndarray[tuple[Any, ...], dtype[cdouble]]

Parameters:
  • k0 (float)

  • E0 (float)

  • a (float)

  • nch (int)

  • local_potential (ArrayLike | None)

  • nonlocal_potential (ArrayLike | None)

solve(channels, asymptotics, local_potential=None, nonlocal_potential=None, interaction_matrix=None, free_matrix=None, basis_boundary=None, weights=None, wavefunction=False)[source]

Solve the scattering problem for one coupled set of channels.

Channels may differ in wavenumber k_i, reduced mass mu_i and Sommerfeld parameter; they share one physical channel radius, and the interior problem is solved on the grid s = k_0 r of channel 0. The asymptotics must be evaluated at each channel’s own rho_i = k_i a (as ProjectileTargetSystem.get_partial_wave_channels() does), with derivatives with respect to rho_i.

Parameters:
  • channels (Channels) – Channel data for one partial wave.

  • asymptotics (Asymptotics) – Coulomb-Hankel functions at each channel’s radius.

  • local_potential (TypeAliasType | None) – Local potential in MeV on the quadrature grid, shape (nbasis,) or (nch, nch, nbasis).

  • nonlocal_potential (TypeAliasType | None) – Nonlocal potential in MeV fm^-1 on the quadrature grid.

  • interaction_matrix (ndarray[tuple[Any, ...], dtype[cdouble]] | None) – Precomputed interaction matrix; overrides the potentials.

  • free_matrix (ndarray[tuple[Any, ...], dtype[cdouble]] | None) – Precomputed free matrix.

  • basis_boundary (ndarray[tuple[Any, ...], dtype[cdouble]] | None) – Precomputed basis functions at the channel radius.

  • weights (ndarray[tuple[Any, ...], dtype[double]] | None) – Amplitude of the incoming wave in each channel; defaults to channel 0 only.

  • wavefunction (bool) – If True, also return the interior expansion coefficients.

Return type:

tuple[ndarray, ...]

Returns:

(R, S, uext_prime_boundary), or (R, S, coeffs, uext_prime_boundary) if wavefunction. S is the flux-normalized (unitary for real potentials) S-matrix, S[i, j] the amplitude for outgoing channel i given incoming channel j. R satisfies u_i(a) = sum_j R[i, j] rho_j du_j/drho_j at the channel radius. uext_prime_boundary is the Bloch-surface source in the solver’s units. For a single channel, or channels with equal k and mu, these reduce to the usual single-grid quantities. The coeffs correspond to raw (not flux-normalized) incoming amplitudes weights.