This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

vp.special.boys

The Boys functions F_0(T) .. F_nmax(T), as an array of nmax + 1 values, with F_n(T) = int_0^1 t^(2n) exp(-T t^2) dt. Orders 0 to 16, T >= 0.

Part of the distribution vipyr; it runs from a checkout of the repository. Planned on PyPI as pip install vipyr.

Signature

vp.special.boys(n_max, T)

Parameters

n_max : int, required
Range: >= 0, <= 16.
T : float, required
Range: >= 0.

Returns

A frozen BoysResult. Iterating it gives the fields below in order; it also has params, tests, log and check().

F : ndarray[float64]
Shape n_max + 1.

Raises

vipyr.ParameterError
A ValueError: an argument outside its range, choices, rank or shape, or one of a group given without the rest; its .param names the argument.
TypeError
An argument of the wrong type, or an unknown keyword.
vipyr.VivBuildError
An ImportError: no C compiler, or the program's C does not build.

Examples

import vipyr as vp
r = vp.special.boys(n_max=8, T=2.5)
print(r.F)
assert r.check()
[0.54629197 0.09284139 0.03928784 0.02287084 0.01560217 0.01166691
 0.0092502  0.00763353 0.00648359]

Each example ran as written when these pages were generated, and the output shown is what it printed.

Checked against

Reference
mpmath at 50 digits: F_n(T) = T^-(n+1/2) gammainc(n+1/2, 0, T) / 2, and F_n(0) = 1/(2n+1)
Compared by
relative error, worst over every order
Tolerance
rel 5 × 10−15
Why that tolerance
lib/hf/boys measures 1.7 × 10−15 against its own mpmath table on [0, 200]; 5 × 10−15 allows for arguments off that table

Credits

  • Checked against PySCF 2.5.0 (Apache-2.0), which runs as an external oracle; no PySCF code is copied. The Gaussian basis sets come from the Basis Set Exchange.

Source