Representations and normalization

In the common preparation, reducing a spherically symmetric problem makes its radial equation easier to solve. When you move to FLODI, the same physical state is represented by a physical field, so the stored values and their integration measure change together. Establishing that connection before applying an operator helps you understand apparent differences in arrays or normalization without treating them as unexplained numerical factors.

From the assignment’s radial function to a physical field

The common preparation uses the reduced radial function \(u=rR\). For a spherically symmetric orbital,

\[\psi(\mathbf r)=\frac{R(r)}{\sqrt{4\pi}}, \qquad u(r)=rR(r).\]

These definitions describe the same orbital, so each representation must assign it the same physical norm. Substituting the definitions into the three-dimensional integral makes the required measures explicit:

\[\int |\psi|^2\,\mathrm d^3r =4\pi\int_0^\infty |\psi(r)|^2r^2\,\mathrm dr =\int_0^\infty |R(r)|^2r^2\,\mathrm dr =\int_0^\infty |u(r)|^2\,\mathrm dr.\]

Stored quantity

Meaning

Normalization measure

\(\psi\)

Physical spatial orbital, including its angular normalization

\(\mathrm d^3r\)

\(R\)

Radial factor with a normalized angular factor separated out

\(r^2\,\mathrm dr\)

\(u=rR\)

Reduced radial function from the common preparation

\(\mathrm dr\)

$p=

u

^2$

\(n\)

Total electron density per physical volume

\(\mathrm d^3r\), giving the electron count

FLODI’s orbital interfaces use the first of these conventions: their arguments are physical fields. On a radial grid, the shell volumes in grid.integrate(psi.conj(), psi) supply the geometric weight needed for that norm, while the Laplacian acts on \(\psi(r)\) with spherical geometry included. The simpler second derivative of \(u\) belongs to the reduced radial equation, so transferring that derivative directly to a physical field would change the operation being evaluated.

When comparing your preparation code with FLODI, compare physical quantities such as norms or expectation values. The two discretizations use different sampling points and quadrature rules, so their arrays and finite-grid errors will generally differ even when they represent the same continuous function.

Cell centres and cell faces

The preparation’s endpoint grid and FLODI’s cell-centred grid have different bookkeeping. A FLODI radial grid with n_r cells on \([0,R]\) has

\[\Delta r=\frac{R}{N_r},\qquad r_i=\left(i+\tfrac12\right)\Delta r, \quad i=0,\ldots,N_r-1.\]

Its first centre is positive, its last centre is inside the outer face, and its physical shell volumes are

\[\Delta V_i=\frac{4\pi}{3} \left(r_{i+1/2}^3-r_{i-1/2}^3\right).\]

This layout explains why FLODI distinguishes grid.r, which contains the centre coordinates, from grid.r_faces, which contains the faces. Likewise, psi.values[-1] samples the last centre inside the domain, whereas psi.boundary describes the outer face beyond it. Setting that face to zero still leaves the last centre as an unknown whose value need not vanish. The boundary-conditions guide shows how to supply face data for the operation you intend to perform.

What integration does

For physical fields, integration means

\[\texttt{grid.integrate(f, g)} =\sum_\alpha \Delta V_\alpha f_\alpha g_\alpha.\]

Each term combines the sampled integrand with the physical volume it represents, and the volume enters only once regardless of the number of arguments. Conjugation remains explicit because a general product integral need not be an inner product; for the squared norm of a complex field, write grid.integrate(f.conj(), f).

The volume weights also explain why an ordinary NumPy sum or Euclidean array norm measures something different. np.sum(f.values) adds the samples without accounting for their physical volumes, while np.linalg.norm(f.values) uses those same unweighted samples in its norm. Both can help with array debugging, but a physical field norm requires the volume-weighted integral.

Reduced measures are a separate interface

grid.integrate_reduced supports explicitly separated angular factors. On radial grids it integrates \(R\) with \(r^2\,\mathrm dr\). On prolate grids it omits the azimuthal factor \(2\pi\) for a convention in which that factor has been normalized separately. It does not implement the \(\mathrm dr\) measure for \(u\), and full spherical grids have no reduced measure.

Use ordinary integrate for the physical orbital amplitudes expected by lowest_orbital, lowest_orbitals, and closed_shell, including nonzero prolate angular sectors. Choose the convention before sampling, rather than correcting unexplained factors after a calculation.

Solver vectors carry volume weights

The eigensolver works with a vector \(y_\alpha=\sqrt{\Delta V_\alpha}\psi_\alpha\), so that

\[\sum_\alpha |y_\alpha|^2 =\sum_\alpha \Delta V_\alpha|\psi_\alpha|^2.\]

The conversion grid.to_vector implements this relation by applying the weights and flattening the field, while grid.from_vector reverses it without renormalizing. This gives the lower-level solver a Euclidean inner product that agrees with the physical one. When using the high-level eigensolvers, that conversion has already been handled and the returned fields are physically normalized; you only need to work with the weights explicitly when using the lower-level vector interface.

Electron density and source density

A Poisson source is a density per physical volume. Its interpretation comes from the equation you are implementing: it might be a one-electron density, a total density, or a signed orbital-product amplitude. FLODI applies the same linear Poisson operation to each.

To interpret a Poisson solve, first identify what its source means and what integrating that source should measure. This physical counting is a separate choice from normalizing an individual orbital. For example, an occupied-state object’s state.density includes both spin occupations, so its integral agrees with state.electron_count. Use the assignment’s model to establish the electron and pair counting before translating its equations into field operations.