AICCM2026DEV-B: a 1D, 2D, and 3D backend check¶
This tutorial exercises only the independent B stream. The A stream has its own page and example. Keeping the inputs explicit makes a head-to-head comparison possible without sharing either implementation’s core.
Build a small neutral cell¶
import numpy as np
import vibeqc as vq
def h2_cell(dim):
lattice = {
1: np.diag([8.0, 20.0, 20.0]),
2: np.diag([8.0, 8.0, 20.0]),
3: np.diag([8.0, 12.0, 12.0]),
}[dim]
system = vq.PeriodicSystem(
dim,
lattice,
[vq.Atom(1, [0, 0, 0]), vq.Atom(1, [1.4, 0, 0])],
)
basis = vq.BasisSet(system.unit_cell_molecule(), "sto-3g")
return system, basis
Lengths are in bohr. The large inactive directions in 1D and 2D are storage boxes, not additional cyclic directions.
Run RHF and Kohn–Sham DFT¶
for dim in (1, 2, 3):
system, basis = h2_cell(dim)
for backend in ("four_center", "ri", "rijcosx"):
rhf = vq.run_aiccm2026dev_b_rhf(
system, basis, lattice_extension=(2, 1, 1),
backend=backend, progress=False
)
rks = vq.run_aiccm2026dev_b_rks(
system, basis, "pbe0", lattice_extension=(2, 1, 1),
backend=backend, progress=False
)
print(dim, backend, rhf.energy, rks.energy)
rijcosx means RI-J plus COSX-K. It therefore exercises COSX in RHF and in a
hybrid such as PBE0. For a pure functional such as PBE, RI and RIJCOSX have the
same exchange content because there is no exact-exchange K term.
Inspect the invariants¶
d = rhf.aiccm2026dev_b
assert d.wigner_seitz_partition_error < 1e-12
assert d.density_idempotency_error < 1e-7
assert d.electron_count_error < 1e-7
print(d.mesh, d.backend, d.inverse_bloch_imaginary_residual)
d.mesh is retained for compatibility; d.lattice_extension is the primary
name. To ask for interactions through two primitive translations on both
sides of each atom, use wigner_seitz_shells=2. This selects the odd
extension (5, 5, 5) in 3D and derives the equivalent reciprocal character
net automatically. Do not set a separate k mesh.
Do not validate the method by convergence alone. Repeat with increasing cyclic meshes and a matched reciprocal-space reference. For 1D and 2D, do not compare the present direct four-center and RI absolute energies as if their long-range Coulomb gauges were identical; that matching is still open.
Add canonical RI-MP2 in 3D¶
system, basis = h2_cell(3)
mp2 = vq.run_aiccm2026dev_b_mp2(
system,
basis,
(2, 1, 1),
progress=False,
)
print(mp2.e_hf_per_cell)
print(mp2.e_corr_ss_per_cell, mp2.e_corr_os_per_cell)
print(mp2.e_total_per_cell)
assert mp2.momentum_conservation_error < 1e-12
assert mp2.max_energy_imaginary_residual < 1e-12
The three-center factors are expressed in the original auxiliary basis before opposite momentum transfers are contracted. This removes arbitrary eigenvector phases between the (q) and (-q) metric factorizations. MP2 is not variational; its correctness gates are the finite-group momentum rule, real energy, size normalization, and reciprocal-space KMP2 parity.
Add local-PNO MP2 and CCSD(T)¶
from vibeqc.dlpno.ccsd_local_solver import LocalCCSDOptions
from vibeqc.dlpno.mp2 import DLPNOMP2Options
local_mp2 = vq.run_aiccm2026dev_b_dlpno_mp2(
system,
basis,
(2, 1, 1),
dlpno_options=DLPNOMP2Options(
localise="wannier",
tcut_pno=0.0,
tcut_pno_weak=0.0,
tcut_mkn=0.0,
tcut_pairs=0.0,
tcut_pairs_weak=0.0,
),
progress=False,
)
local_cc = vq.run_aiccm2026dev_b_dlpno_ccsd_t(
system,
basis,
(2, 1, 1),
cc_options=LocalCCSDOptions(
localise="pipek-mezey",
tcut_pairs=0.0,
coupling_radius=0.0,
compute_triples=True,
triples_mode="t1",
),
progress=False,
)
canonical_cc = vq.run_aiccm2026dev_b_ccsd_t(
system,
basis,
lattice_extension=(2, 1, 1),
progress=False,
)
print(local_mp2.e_corr_per_cell)
print(local_mp2.raw_local_e_corr_per_cell)
print(local_mp2.complete_space_correction_per_cell)
print(local_mp2.local_correlation_space)
print(local_cc.e_corr_per_cell, local_cc.e_t_per_cell)
print(canonical_cc.e_corr_per_cell, canonical_cc.e_t_per_cell)
The real-torus transform is exact. localise="wannier" uses the B-only
finite-torus occupied gauge described in the
localization tutorial. The returned local
space reports the exact-limit PAO rank and candidate translation pair orbits.
It does not skip equivalent pairs yet. IAO pair propagation is gated because
its explicit-supercell cross overlap is not exactly translation covariant.
At complete domains and zero PNO thresholds, the MP2 wrapper independently
evaluates a full-space, rotation-invariant DF-MP2 contraction. The raw local
solver value and complete_space_correction_per_cell remain visible; the
reported total recovers the canonical finite-torus limit. Truncated PNO
calculations receive no correction. Pipek–Mezey remains available, while
molecular Boys localization is rejected.
For the exact-limit diagnostic, use localise="none", set tcut_pno and
tcut_mkn to zero, keep tcut_pairs=0 and coupling_radius=0, and select
triples_mode="exact". This is a validation calculation, not a scalable
production setting. The LiH example has a nonzero triples term and is pinned
against a separately contracted canonical finite-torus DF-CCSD(T) oracle.
The localized-gauge CC exact-limit audit is still open, so the CC example
continues to use Pipek–Mezey rather than claiming Wannier-gauge parity.
Open-shell HF, KS, and correlation¶
li = vq.PeriodicSystem(
3,
np.eye(3) * 15.0,
[vq.Atom(3, [0.0, 0.0, 0.0])],
multiplicity=2,
)
li_basis = vq.BasisSet(li.unit_cell_molecule(), "sto-3g")
uhf = vq.run_aiccm2026dev_b_uhf(
li, li_basis, lattice_extension=(1, 1, 1),
backend="ri", progress=False,
)
uks = vq.run_aiccm2026dev_b_uks(
li, li_basis, "lda", lattice_extension=(1, 1, 1),
backend="ri", progress=False,
)
ump2 = vq.run_aiccm2026dev_b_ump2(
li, li_basis, lattice_extension=(1, 1, 1), progress=False,
)
uccsdt = vq.run_aiccm2026dev_b_uccsd_t(
li, li_basis, lattice_extension=(1, 1, 1), progress=False,
)
local_uccsdt = vq.run_aiccm2026dev_b_dlpno_uccsd_t(
li, li_basis, lattice_extension=(1, 1, 1), progress=False,
)
properties = vq.derive_aiccm2026dev_b_scf_properties(uhf, li, li_basis)
print(properties.n_alpha, properties.n_beta, properties.s_squared)
print(properties.mulliken_spin_populations)
print(ump2.energy, uccsdt.energy, local_uccsdt.energy)
The one-cell Li example is a code-path check, not a converged crystal. Increase
the real-space extension and inspect the localization aliasing flags before
using local domains. Canonical UMP2 uses zero PNO truncation. Canonical UCCSD
and UCCSD(T) use the full-domain O(N^6) pilot and are deliberately capped by
max_nbf; the current local sibling is the PNO projection oracle, not yet the
representative-pair reduced-scaling production algorithm.
Run the maintained example¶
python examples/periodic/aiccm2026dev_b_demo.py --dim 3 --backend four_center
python examples/periodic/aiccm2026dev_b_demo.py --dim 2 --backend ri
python examples/periodic/aiccm2026dev_b_demo.py --dim 1 --backend rijcosx
python examples/periodic/aiccm2026dev_b_mp2.py
python examples/periodic/aiccm2026dev_b_local_correlation.py
For the measured H4 convergence comparison against the historical and A-stream
weights, run examples/regression/benchmark_aiccm2026dev_b.py.
For the full A/B/CRYSTAL fleet experiment, generate the B-owned inputs from the shared system registry:
python aiccm-2026/make_jobs_b.py --profile coverage
python aiccm-2026/make_jobs_b.py --profile coverage | sh
The coverage profile exercises all nine RHF/RKS integral combinations in 1D,
2D, and 3D, then all four implemented 3D post-HF routes. The larger scf,
posthf, paper, and full profiles are documented in
aiccm-2026/README_B.md.