xnn.common.models.reciprocal.PhaseColumns#

class xnn.common.models.reciprocal.PhaseColumns(grid)[source]#

Bases: object

Integer reciprocal-lattice triples grouped into columns of fixed (m_1, m_2).

Parameters:

grid (Tensor) – The triples m, (G, 3), integer-valued (any dtype). The caller chooses the set (a half space, a spherical shell); the order of the values passed to scatter() follows this order.

static phases(pos, cell)[source]#

Phases theta (N, 3) with theta_ik = b_k dot r_i, in float64 (differentiable).

cell rows are the lattice vectors; b_k satisfy b_k . a_l = 2 pi delta_kl.

Parameters:
Return type:

Tensor

column_table(theta, c0, c1, cdtype)[source]#

B[c, i] = exp(i (m_1 theta_1 + m_2 theta_2)) for columns c0:c1, (c, N).

Parameters:
Return type:

Tensor

axis_table(theta, cdtype)[source]#

P[i, m] = exp(i m theta_3) for m from -M_3 to M_3, shape (N, 2 M_3 + 1).

Parameters:
Return type:

Tensor

scatter(values, c0=0, c1=-1)[source]#

Per-triple values (G,) laid out as (c, 2 M_3 + 1) for columns c0:c1 (zero where a column has no triple); differentiable in values.

Parameters:
Return type:

Tensor

blocks(n_atoms, budget)[source]#

Column ranges whose (c, N) table stays within budget entries.

Parameters:
Return type:

Iterator[Tuple[int, int]]