Skip to content

Export the gauge-including and nuclear-moment integrals - #27

Merged
JorgeG94 merged 1 commit into
mainfrom
ccr-45afd402-2z2xew
Nov 21, 2026
Merged

JorgeG94 merged 1 commit into
mainfrom
ccr-45afd402-2z2xew

Conversation

@JorgeG94

Copy link
Copy Markdown
Owner

What

Eight integrals an NMR shielding over London orbitals needs are added to the public libcint_fortran module. The port has had all of them; they were just not exported.

wrapper integral components
libcint_1e_igovlp_{cart,sph} overlap through the gauge factor 3
libcint_1e_igkin_{cart,sph} kinetic, likewise 3
libcint_1e_ignuc_{cart,sph} nuclear attraction, likewise 3
libcint_1e_giao_irjxp_{cart,sph} gauge-including r x p 3
libcint_1e_giao_a11part_{cart,sph} diamagnetic nuclear-moment term 9
libcint_1e_a01gp_{cart,sph} its gauge correction 9
libcint_1e_prinvxp_{cart,sph} paramagnetic nuclear-moment operator 3
libcint_2e_ig1_{cart,sph} two-electron integral through the gauge factor of the first pair 3

Why

metalquicha's shielding code (JorgeG94/metalquicha#538) currently reaches these by using cint_gen_intor1, cint_gen_intor2 and cint_workspace directly and carrying its own workspace. It is the only place in metalquicha that goes past the public interface. With these exported, that adapter switches to them and the coupling to libfint's internals goes away.

How

  • The seven one-electron ones go through run1e like every other one-electron wrapper: seven new kinds and their component counts in NCOMP_1E.
  • The two-electron one has its own wrapper, since run2e_hess is written for nine components and this has three.

Validation

backend_check compares each against libcint through the public interface, Cartesian and spherical, over every ordered shell pair, since none of these is symmetric:

values compared      : 86419435
worst diff / block   :   0.00E+00
inexact at <=5 roots : 0
over tolerance       : 0
RESULT: PASS through libcint_fortran

Bit-identical. Only backend_check was run locally; the other checks do not touch this file's new code.

After this merges

metalquicha needs its libfint pin moved to a commit that includes this, and backends/cenzontle/integrals/mqc_czt_giao.f90 switched to the wrappers. That is a one-file change on the metalquicha side, and I'll make it once this is in.


Generated by Claude Code

A nuclear magnetic shielding over London orbitals needs eight integrals
that the port has had all along and libcint_fortran did not export: the
overlap, kinetic, nuclear-attraction and two-electron integrals
differentiated through the gauge factor (igovlp, igkin, ignuc, ig1),
the gauge-including r x p, and the three nuclear-moment operators
(giao_a11part, a01gp, prinvxp). A caller wanting them had to use the
generated modules directly and carry its own workspace, which is what
metalquicha's shielding code does today.

They go through run1e like every other one-electron wrapper, with seven
new kinds and their component counts. The two-electron one has its own
wrapper: three components, where run2e_hess is written for nine.

backend_check compares each against libcint through the public
interface, Cartesian and spherical, over every ordered shell pair since
none of them is symmetric. All bit-identical: 86,419,435 values compared,
worst difference zero.

Co-Authored-By: Claude <noreply@anthropic.com>
@JorgeG94
JorgeG94 merged commit 57fccec into main Nov 21, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants