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#
Return |
|
|
Flatten a list of contracted Gaussians into CSR-style arrays. |
|
Batched on-site |
|
Batched intersite |
Package Contents#
- 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 exposeorigin(length-3), and the per-primitive listspexps,pcoefs,pnormsandpowers(each entry a length-3 tuple).- Returns:
(origins, prim_offsets, exps, coefs, norms, powers)with dtypesfloat64(origins/exps/coefs/norms),int64(prim_offsets) andint64(powers).- Return type:
- 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)intobasis.
- Returns:
One contracted Coulomb integral per key.
- Return type:
numpy.ndarray, shape
(nkeys,)