qimpy.math

Math functions extending the core torch set.

Functions

prime_factorization

Get list of prime factors of N in ascending order

fft_suitable

Check whether N has only small prime factors.

ceildiv

Compute ceil(num/den) with purely integer operations

cis

Compute complex exponential exp(i x).

abs_squared

Compute absolute value squared of complex or real tensor.

dagger

Conjugate transpose of a batch of matrices.

accum_norm_

Accumulate \(f |x|^2\) to out in-place.

accum_prod_

Accumulate \(f x y\) to out in-place.

ortho_matrix

Return orthonormalization matrix of a basis.

eighg

Solve Hermitian generalized eigenvalue problem.

Classes

RadialFunction

Set of radial functions in real and reciprocal space.

Modules

spherical_harmonics

Calculate spherical harmonics and their product expansions.

spherical_bessel

Calculate spherical Bessel functions.

quintic_spline

Generate and evaluate quintic (fifth-order) splines.