Choose Electron-Repulsion Integral Builder

Goal

Select and configure the electron-repulsion integral (ERI) method (standard 4-center or Resolution of the Identity).

Why This Matters

Two-electron ERIs come in a number of different flavours that differ in storage and computational cost. You can choose:

  • Standard: exact 4-center ERIs.

  • Resolution of the Identity (RI): introduces an auxiliary basis and factorizes ERIs into cheaper 3-center forms

Both are widely used in practice. RI is in many cases much faster, with a significant memory reduction.

Steps

  1. Open the integral picker

Several builders support choosing the integral strategy. Here we use the standard ground state problem builder as an example.

import qrunch as qc

problem_builder = (
    qc.problem_builder_creator()
    .ground_state()
    .standard()
    .choose_repulsion_integral_builder()
    # .<pick-one-integral-builder>(...)
    .create()
)
  1. Option A — Use standard 4-center ERIs (exact)

    import qrunch as qc
    
    problem_builder = (
        qc.problem_builder_creator()
        .ground_state()
        .standard()
        .choose_repulsion_integral_builder()
        .standard()                         # exact 4-center two-electron integrals
        .create()
    )
    

    Use this when you want the reference “exact” integral evaluation.

  2. Option B — Use Resolution of the Identity (RI) with an auxiliary basis

    RI replaces 4-center integrals by products of 3-center terms using an auxiliary basis.

    import qrunch as qc
    
    problem_builder = (
        qc.problem_builder_creator()
        .ground_state()
        .standard()
        .choose_repulsion_integral_builder()
        .resolution_of_the_identity(auxiliary_basis="weigend")
        .create()
    )
    

    Notes:

    • auxiliary_basis accepts common RI auxiliary families (e.g., "weigend"). Use the same quality as your orbital basis.

Combining RI Integrals, Active Space, and Dense Integral Transformation

You can combine resolution-of-the-identity integrals with active space selection and a final dense integral transformation. This workflow is useful when you want to:

  • Evaluate the inactive electron energy using RI integrals for efficiency;

  • Restrict the problem to an Active Space;

  • Transform the active-space Molecular Orbital integrals into a fully dense \(N^4\) tensor format, where \(N\) is the number of active molecular orbitals.

Example:

from qrunch import problem_builder_creator

problem_builder = (
    problem_builder_creator()
    .ground_state()
    .standard()
    .choose_repulsion_integral_builder()
    .resolution_of_the_identity()
    .add_problem_modifier()
    .active_space(
        number_of_active_spatial_orbitals=8,
        number_of_active_alpha_electrons=6
    )
    .add_problem_modifier()
    .to_dense_integrals()
    .create()
)

How it works:

  1. RI Integrals are used in Active Space Restriction: the inactive electron energy is computed using resolution-of-the-identity integrals. This can be significantly faster and less memory-intensive than standard four-center integrals.

  2. Dense Integral Transformation: after restricting to the active space, the much smaller active-space MO integrals are transformed into a dense \(N^4\) array - as if exact ERIs were used. This format can be advantageous when running adaptive VQEs.

Note that the order of modifiers matters: the active space modifier must come before the dense integral modifier. Otherwise, the dense transformation would be applied to the full set of orbitals, which is very memory-intensive and potentially not feasible.

Troubleshooting

  • Unknown auxiliary basis name: check spelling.

  • Large discrepancy vs Standard: ensure the orbital basis and auxiliary basis are compatible in quality.

See Also