X

Search Results

Searching....

4.6 Large Molecules and Linear Scaling Methods

4.6.9 Seminumerical Exchange (SNK) Matrix Evaluation

(July 4, 2026)

Seminumerical exchange (SNK) is an alternative method for evaluation of the exchange matrix. SNK is particularly efficient for large systems and basis sets due to its formal 𝒪(N3) scaling with system size and 𝒪(Nbasis2) scaling with basis set size. In addition, asymptotic linear scaling is possible for sparse systems. In SNK, the two-electron integrals are decomposed by means of numerical quadrature; one integration is performed on a grid:

(μσ|νλ)=gwgχμ(𝐫g)(νλ|g)χσ(𝐫g) (4.59)

while the second integration

(νλ|g)=𝑑𝐫χν(𝐫)χλ(𝐫)|𝐫-𝐫g| (4.60)

is evaluated analytically (3c-1e). The exchange matrix is computed in three steps:

Fλg = σPλσχσ(𝐫g) (4.61)
Gνg = λFλg(νλ|g) (4.62)
Kμν = gχμ(𝐫g)Gνg (4.63)

With integral screening, the number of required 3c-1e integrals can be dramatically reduced. Q-Chem performs this screening based on contributions of a given shellpair on a given batch of grid points to both the exchange energy and the exchange matrix, defining two thresholds θE and θK. 769 Laqua H. et al.
J. Chem. Theory Comput.
(2020), 16, pp. 1456.
Link
, 984 Neese F. et al.
Chem. Phys.
(2009), 356, pp. 98.
Link
Further speedups are attained by evaluating those integrals which are less significant but non-negligible in single precision (fp32), 768 Laqua H., Kussmann J., Ochsenfeld C.
J. Chem. Phys.
(2021), 154, pp. 214116.
Link
defining a second set of thresholds θEfp32 and θKfp32. These thresholds are related to θE and θK by a multiplier θifp32=Mfp32θi. Additionally, basis functions which are not significant for a given batch of grid points may also be screened by a threshold θB.

SNK is particularly efficient on hardware supporting OpenMP parallelism and single-instruction-multiple-data vector instructions.

SNK is currently available for HF exchange, global hybrids, and range-separated hybrids. SNK may be invoked by setting SNK to be 1. The grid and thresholds may also be set via the rem variables discussed below.

SNK

SNK
       Controls the use of seminumerical exchange in the construction of the exchange matrix.
TYPE:
       INTEGER
DEFAULT:
       0 Do not use SNK.
OPTIONS:
       n>0 Use SNK.
RECOMMENDATION:
       Use for large systems/basis sets.

SNK_GRID

SNK_GRID
       Specifies the type of grid to use for SNK.
TYPE:
       INTEGER
DEFAULT:
       Use SG-1; Use DFT grid (XC_GRID) if given.
OPTIONS:
       0 Use SG-0 for H, C, N, and O; SG-1 for all other atoms. n Use SG-n for all atoms, n=1,2, or 3 XY A string of two six-digit integers X and Y, where X is the number of radial points and Y is the number of angular points, where possible numbers of Lebedev angular points must be allowed values from Table 5.2 in Section 5.5.
RECOMMENDATION:
       Use the default unless numerical integration problems arise or grid errors become unacceptable. Note that Gauss-Legendre grids (-XY) are not available for SNK.

SNK_BATCH_SIZE

SNK_BATCH_SIZE
       Specifies the target grid batch size to use for SNK.
TYPE:
       INTEGER
DEFAULT:
       128 Use grid batch sizes of 128 grid points.
OPTIONS:
       n Use grid batch sizes of n grid points.
RECOMMENDATION:
       Use the default. Larger batch sizes may lead to poorer screening.

SNK_THRESH_B

SNK_THRESH_B
       Cutoff for neglect of basis functions on a given grid batch, defined via a threshold of 10-SNK_THRESH_B.
TYPE:
       INTEGER
DEFAULT:
       14
OPTIONS:
       n for a threshold of 10-n.
RECOMMENDATION:
       Use the default unless higher accuracy (increase) or better performance (decrease) is desired.

SNK_THRESH_E

SNK_THRESH_E
       Cutoff for neglect of integral contributions to the exchange energy, defined via a threshold of 10-SNK_THRESH_E.
TYPE:
       INTEGER
DEFAULT:
       10
OPTIONS:
       n for a threshold of 10-n.
RECOMMENDATION:
       Use the default unless higher accuracy (increase) or better performance (decrease) is desired.

SNK_THRESH_K

SNK_THRESH_K
       Cutoff for neglect of integral contributions to the exchange matrix, defined via a threshold of 10-SNK_THRESH_K.
TYPE:
       INTEGER
DEFAULT:
       8
OPTIONS:
       n for a threshold of 10-n.
RECOMMENDATION:
       Use the default unless higher accuracy (increase) or better performance (decrease) is desired.

SNK_THRESH_FP32_M

SNK_THRESH_FP32_M
       Multiplies SNK_THRESH_E and SNK_THRESH_K to determine cutoffs for evaluating integrals in single precision (fp32), defined via a factor of 10SNK_THRESH_FP32_M.
TYPE:
       INTEGER
DEFAULT:
       5 for a factor of 105.
OPTIONS:
       n for a factor of 10n.
RECOMMENDATION:
       For most systems, the default gives appreciable speedups with insignificant losses to accuracy. In some rare cases, the use of mixed precision may result in infs/nans due to fp32 overflow. In this case, mixed precision integrals may be disabled with SNK_THRESH_FP32_M=0. Note that if an inf/nan is detected in the SNK exchange energy, the SCF will proceed with mixed precision disabled.

SNK_PRINT_TIMING

SNK_PRINT_TIMING
       Print the time required for one SNK exchange build for each SCF cycle.
TYPE:
       INTEGER
DEFAULT:
       0 Do not print timing information.
OPTIONS:
       n>0 Print timing information.
RECOMMENDATION:
       No recommendation.

Example 4.22  Q-Chem input for an energy calculation with ωB97M-V/SNK.

$molecule
0 1
O 0.0000000000  0.0000000000  0.21981483259
H 0.0000000000  1.4194772274 -0.87926122007
H 0.0000000000 -1.4194772274 -0.87926122007
$end

$rem
input_bohr = true
jobtype = sp
method = wB97M-V
basis = cc-pvtz
scf_convergence = 8

snk 1
snk_batch_size 256
snk_thresh_b 12
snk_thresh_e 10
snk_thresh_k 7
snk_thresh_fp32_m 5

$end