PAOFLOW.acbn0_native#

Optional Rust backend bridge for the ACBN0 / eACBN0 Coulomb integrals.

This package opportunistically imports the compiled paoflow_rs extension (built from rust/paoflow_rs) and exposes a small, NumPy friendly API that mirrors the per-call PAOFLOW.ACBN0._HartreeKernel.coulomb() semantics in batched form.

If the extension is not installed, available() returns False and the callers fall back to the pure-Python PAOFLOW.utils.pyints kernel, so the backend is a fully optional dependency.

The basis crosses the FFI boundary as flat CSR-style arrays:

  • origins(nbasis, 3) float64 centre coordinates.

  • prim_offsets(nbasis + 1,) int64 CSR row pointers.

  • exps/coefs/norms(nprim_total,) float64 per-primitive data.

  • powers(nprim_total, 3) int64 Cartesian angular momenta.

and the integral request as keys(nkeys, 4) int64 index tuples.

Threads: the native kernels parallelise over keys with rayon and release the GIL. Set PAOFLOW_RS_THREADS (legacy alias PAOFLOW_ACBN0_THREADS) to a positive integer to cap intra-rank threads (useful to avoid oversubscription with many MPI ranks per node); otherwise the global rayon pool is used (honours RAYON_NUM_THREADS).

Functions#

available()

Return True when the compiled Rust backend can be used.

flatten_basis(basis)

Flatten a list of contracted Gaussians into CSR-style arrays.

eri_batch(basis, keys)

Batched on-site (ab|cd) integrals over a single basis.

eri_batch_2c(basis_i, basis_j, keys)

Batched intersite (ik|jl) integrals over two bases (eACBN0).

Package Contents#

PAOFLOW.acbn0_native.available()[source]#

Return True when the compiled Rust backend can be used.

PAOFLOW.acbn0_native.flatten_basis(basis)[source]#

Flatten a list of contracted Gaussians into CSR-style arrays.

Parameters:

basis (sequence of PAOFLOW.utils.pyints.CGBF) – Contracted Gaussian basis functions. Each must expose origin (length-3), and the per-primitive lists pexps, pcoefs, pnorms and powers (each entry a length-3 tuple).

Returns:

(origins, prim_offsets, exps, coefs, norms, powers) with dtypes float64 (origins/exps/coefs/norms), int64 (prim_offsets) and int64 (powers).

Return type:

tuple of numpy.ndarray

PAOFLOW.acbn0_native.eri_batch(basis, keys)[source]#

Batched on-site (ab|cd) integrals over a single basis.

Parameters:
  • basis (sequence of CGBF) – The (active) contracted Gaussian basis.

  • keys (array_like, shape (nkeys, 4)) – Integer index tuples (a, b, c, d) into basis.

Returns:

One contracted Coulomb integral per key.

Return type:

numpy.ndarray, shape (nkeys,)

PAOFLOW.acbn0_native.eri_batch_2c(basis_i, basis_j, keys)[source]#

Batched intersite (ik|jl) integrals over two bases (eACBN0).

Parameters:
  • basis_i (sequence of CGBF) – Contracted Gaussian bases on atoms I and J respectively.

  • basis_j (sequence of CGBF) – Contracted Gaussian bases on atoms I and J respectively.

  • keys (array_like, shape (nkeys, 4)) – Integer index tuples (i, k, j, l) where i, k index basis_i and j, l index basis_j.

Returns:

One contracted Coulomb integral per key.

Return type:

numpy.ndarray, shape (nkeys,)