New Direct Inversion in Iterative Space (DIIS)

This method has been extensively used to solve self-consistent field (SCF) problems in the fields of quantum chemistry and physics. In this tutorial, we employ this method to accelerate the solving of fixed-point problems.

It should be noted that one potential issue with this method is that non-negative parameters cannot be guaranteed during optimization in the conventional DIIS approach. Although this issue can be addressed by explicitly introducing constraints to the linear combination coefficients, key concepts in DIIS, numerical issues may still arise, such as singular matrices or convergence problems.

[1]:
from setup import prepare_argument_dict, prepare_grid_and_dens, print_results

from horton_part import (
    LinearISAWPart,
    lstsq_spsolver,
)

In DIIS method, the combination coefficients are determined by solving a least-square problem. The default method is lstsq_spsolver, which computes the inversion of the matrix directly. One can also use other least-square solver and availiable methods are lstsq_solver_dyn, lstsq_solver_with_extra_constr.

[2]:
def run_diis(diis_method):
    """Self-consistent solver."""
    mol, grid, rho = prepare_grid_and_dens("data/h2o.fchk")
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "diis"
    print("*" * 80)
    print(f"Results with {diis_method.__name__}".center(80, " "))
    print("*" * 80)
    kwargs["solver_options"] = {"diis_size": 8, "lstsq_solver": diis_method}
    part = LinearISAWPart(**kwargs)
    part.do_all()
    print_results(part)
    print()
[3]:
run_diis(lstsq_spsolver)
The number of electrons: 10.000003764139395
Coordinates of the atoms
 [[ 0.     0.     0.224]
 [-0.     1.457 -0.896]
 [-0.    -1.457 -0.896]]
Atomic numbers of the atom
 [8 1 1]
********************************************************************************
                          Results with lstsq_spsolver
********************************************************************************

================================================================================
Information of integral grids.
--------------------------------------------------------------------------------
Grid size of molecular grid: 18460
************************************ Atom 0 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
          18 18 18 18 18 18 26 26 26 26 38 38 38 38 38 50 50 50 50 50
          86 86 110 110 110 110 170 194 194 434 590 590 434 434 434 302 302 302 194 194
          170 110 110 110 110 110 110 110 110 110 110 110 86 50 50 18 18 18 18 18

************************************ Atom 1 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

************************************ Atom 2 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

--------------------------------------------------------------------------------
================================================================================

Performing a density-based AIM analysis with a wavefunction as input.
  Molecular grid    : MolGrid
  Using local grids : True
  Scheme                           : Linear Iterative Stockholder
  Outer loop convergence threshold : 1.0e-06
  Inner loop convergence threshold : 1.0e-08
  Using global ISA                 : False
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : DIIS
  Basis function type              : GAUSS
  Grid type                        : 1
  Solver options -- diis_size      : 8
  Solver options -- lstsq_solver   : <function lstsq_spsolver at 0x1162a1870>

Load GAUSS basis functions
Iteration       Change      Entropy
        1   1.22855e-01   2.11396e-01
        2   2.65514e-02   1.08102e-01
        3   1.49501e-02   7.80048e-02
        4   9.43139e-03   6.28961e-02
        5   6.28279e-03   5.43378e-02
        6   4.36240e-03   4.91980e-02
        7   3.13687e-03   4.59888e-02
        8   2.32435e-03   4.39260e-02
        9   1.76690e-03   4.25692e-02
       10   1.37224e-03   4.16592e-02
       11   1.08483e-03   4.10387e-02
       12   8.70225e-04   4.06094e-02
       13   7.06490e-04   4.03086e-02
       14   5.79247e-04   4.00953e-02
       15   4.78829e-04   3.99426e-02
       16   3.98555e-04   3.98323e-02
       17   3.33687e-04   3.97519e-02
       18   2.80792e-04   3.96929e-02
       19   2.37332e-04   3.96492e-02
       20   2.01386e-04   3.96168e-02
       21   1.71486e-04   3.95926e-02
       22   1.46496e-04   3.95743e-02
       23   1.25504e-04   3.95606e-02
       24   1.07814e-04   3.95501e-02
       25   9.28271e-05   3.95422e-02
       26   8.01196e-05   3.95361e-02
       27   6.93741e-05   3.95315e-02
       28   6.01082e-05   3.95279e-02
       29   5.21961e-05   3.95251e-02
       30   4.54061e-05   3.95230e-02
       31   3.95715e-05   3.95214e-02
       32   3.45348e-05   3.95201e-02
       33   3.01724e-05   3.95191e-02
       34   2.64375e-05   3.95183e-02
       35   2.31613e-05   3.95177e-02
       36   2.03145e-05   3.95173e-02
       37   1.78539e-05   3.95169e-02
       38   1.56953e-05   3.95166e-02
       39   1.38110e-05   3.95164e-02
       40   1.21668e-05   3.95162e-02
       41   1.07249e-05   3.95161e-02
       42   9.46136e-06   3.95160e-02
       43   8.35235e-06   3.95159e-02
       44   7.37938e-06   3.95158e-02
       45   6.51932e-06   3.95158e-02
       46   5.76641e-06   3.95158e-02
       47   5.10103e-06   3.95157e-02
       48   4.51502e-06   3.95157e-02
       49   3.99851e-06   3.95157e-02
       50   3.54139e-06   3.95157e-02
       51   3.13792e-06   3.95157e-02
       52   2.78126e-06   3.95157e-02
       53   2.46578e-06   3.95156e-02
       54   2.18679e-06   3.95156e-02
       55   1.93936e-06   3.95156e-02
       56   1.72059e-06   3.95156e-02
       57   1.52675e-06   3.95156e-02
       58   1.35470e-06   3.95156e-02
       59   1.20293e-06   3.95156e-02
       60   1.06741e-06   3.95156e-02
       61   9.48208e-07   3.95156e-02

Computing atomic populations.
Computing atomic charges.
Computing density decomposition for atom 0
Computing density decomposition for atom 1
Computing density decomposition for atom 2
Computing cartesian and pure AIM multipoles and radial AIM moments.
Storing proatom density spline for atom 0.
Storing proatom density spline for atom 1.
Storing proatom density spline for atom 2.
charges:
[-0.881  0.441  0.441]
cartesian multipoles:
[[-0.881  0.     0.     0.133 -5.381 -0.    -0.    -4.802 -0.    -5.094  0.    -0.     0.034  0.    -0.     0.     0.     0.416 -0.     0.367]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.257  0.002 -0.26   0.     0.008  0.005  0.     0.     0.     0.024  0.009  0.009  0.023]
 [ 0.441  0.    -0.022 -0.001 -0.275  0.     0.    -0.257 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]

[4]:
def run_cdiis(**solver_options):
    """Self-consistent solver."""
    mol, grid, rho = prepare_grid_and_dens("data/h2o.fchk")
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "cdiis"
    kwargs["solver_options"] = solver_options
    part = LinearISAWPart(**kwargs)
    part.do_all()
    print_results(part)
    print()
[5]:
run_cdiis(mode="R-CDIIS", param=1e-2)
The number of electrons: 10.000003764139395
Coordinates of the atoms
 [[ 0.     0.     0.224]
 [-0.     1.457 -0.896]
 [-0.    -1.457 -0.896]]
Atomic numbers of the atom
 [8 1 1]

================================================================================
Information of integral grids.
--------------------------------------------------------------------------------
Grid size of molecular grid: 18460
************************************ Atom 0 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
          18 18 18 18 18 18 26 26 26 26 38 38 38 38 38 50 50 50 50 50
          86 86 110 110 110 110 170 194 194 434 590 590 434 434 434 302 302 302 194 194
          170 110 110 110 110 110 110 110 110 110 110 110 86 50 50 18 18 18 18 18

************************************ Atom 1 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

************************************ Atom 2 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

--------------------------------------------------------------------------------
================================================================================

Performing a density-based AIM analysis with a wavefunction as input.
  Molecular grid    : MolGrid
  Using local grids : True
  Scheme                           : Linear Iterative Stockholder
  Outer loop convergence threshold : 1.0e-06
  Inner loop convergence threshold : 1.0e-08
  Using global ISA                 : False
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CDIIS
  Basis function type              : GAUSS
  Grid type                        : 1
  Solver options -- mode           : R-CDIIS
  Solver options -- param          : 0.01

Load GAUSS basis functions
Iteration       Change      Entropy
        1   1.22855e-01   2.11396e-01
        2   2.65514e-02   1.08102e-01
        3   1.49501e-02   7.80048e-02
        4   9.43136e-03   6.28961e-02
        5   6.28276e-03   5.43378e-02
        6   4.36241e-03   4.91980e-02
        7   3.13687e-03   4.59888e-02
        8   2.32437e-03   4.39260e-02
        9   1.76689e-03   4.25692e-02
       10   1.37224e-03   4.16592e-02
       11   1.08483e-03   4.10387e-02
       12   8.70229e-04   4.06094e-02
       13   7.06493e-04   4.03086e-02
       14   5.79252e-04   4.00953e-02
       15   4.78829e-04   3.99426e-02
       16   3.98556e-04   3.98323e-02
       17   3.33690e-04   3.97519e-02
       18   2.80795e-04   3.96929e-02
       19   2.37334e-04   3.96492e-02
       20   2.01387e-04   3.96168e-02
       21   1.71486e-04   3.95926e-02
       22   1.46491e-04   3.95743e-02
       23   1.25506e-04   3.95606e-02
       24   1.07815e-04   3.95501e-02
       25   9.28499e-05   3.95422e-02
       26   8.01469e-05   3.95361e-02
       27   6.93317e-05   3.95315e-02
       28   6.00976e-05   3.95279e-02
       29   5.21923e-05   3.95251e-02
       30   4.54075e-05   3.95230e-02
       31   3.95705e-05   3.95214e-02
       32   3.45377e-05   3.95201e-02
       33   3.01890e-05   3.95191e-02
       34   2.64237e-05   3.95183e-02
       35   2.31574e-05   3.95177e-02
       36   2.03188e-05   3.95173e-02
       37   1.78476e-05   3.95169e-02
       38   1.56930e-05   3.95166e-02
       39   1.37453e-05   3.95164e-02
       40   1.21736e-05   3.95162e-02
       41   1.07322e-05   3.95161e-02
       42   9.46816e-06   3.95160e-02
       43   8.35860e-06   3.95159e-02
       44   7.35066e-06   3.95158e-02
       45   6.52996e-06   3.95158e-02
       46   5.77464e-06   3.95158e-02
       47   5.10901e-06   3.95157e-02
       48   4.49844e-06   3.95157e-02
       49   4.00692e-06   3.95157e-02
       50   3.54924e-06   3.95157e-02
       51   3.14486e-06   3.95157e-02
       52   2.78737e-06   3.95157e-02
       53   2.43680e-06   3.95156e-02
       54   2.19590e-06   3.95156e-02
       55   1.91533e-06   3.95156e-02
       56   1.73241e-06   3.95156e-02
       57   1.53762e-06   3.95156e-02
       58   1.36457e-06   3.95156e-02
       59   1.21117e-06   3.95156e-02
       60   1.07517e-06   3.95156e-02
       61   9.54557e-07   3.95156e-02

Computing atomic populations.
Computing atomic charges.
Computing density decomposition for atom 0
Computing density decomposition for atom 1
Computing density decomposition for atom 2
Computing cartesian and pure AIM multipoles and radial AIM moments.
Storing proatom density spline for atom 0.
Storing proatom density spline for atom 1.
Storing proatom density spline for atom 2.
charges:
[-0.881  0.441  0.441]
cartesian multipoles:
[[-0.881  0.    -0.     0.133 -5.381 -0.    -0.    -4.802  0.    -5.094 -0.    -0.     0.034  0.     0.     0.    -0.     0.416 -0.     0.367]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.257  0.002 -0.26   0.     0.008  0.005  0.     0.     0.     0.024  0.009  0.009  0.023]
 [ 0.441  0.    -0.022 -0.001 -0.275  0.     0.    -0.257 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]

[6]:
run_cdiis(mode="FD-CDIIS", diis_size=5)
The number of electrons: 10.000003764139395
Coordinates of the atoms
 [[ 0.     0.     0.224]
 [-0.     1.457 -0.896]
 [-0.    -1.457 -0.896]]
Atomic numbers of the atom
 [8 1 1]

================================================================================
Information of integral grids.
--------------------------------------------------------------------------------
Grid size of molecular grid: 18460
************************************ Atom 0 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
          18 18 18 18 18 18 26 26 26 26 38 38 38 38 38 50 50 50 50 50
          86 86 110 110 110 110 170 194 194 434 590 590 434 434 434 302 302 302 194 194
          170 110 110 110 110 110 110 110 110 110 110 110 86 50 50 18 18 18 18 18

************************************ Atom 1 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

************************************ Atom 2 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

--------------------------------------------------------------------------------
================================================================================

Performing a density-based AIM analysis with a wavefunction as input.
  Molecular grid    : MolGrid
  Using local grids : True
  Scheme                           : Linear Iterative Stockholder
  Outer loop convergence threshold : 1.0e-06
  Inner loop convergence threshold : 1.0e-08
  Using global ISA                 : False
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CDIIS
  Basis function type              : GAUSS
  Grid type                        : 1
  Solver options -- mode           : FD-CDIIS
  Solver options -- diis_size      : 5

Load GAUSS basis functions
Iteration       Change      Entropy
        1   1.22855e-01   2.11396e-01
        2   2.65514e-02   1.08102e-01
        3   1.49501e-02   7.80048e-02
        4   9.43137e-03   6.28961e-02
        5   6.28277e-03   5.43378e-02
        6   4.36240e-03   4.91980e-02
        7   3.13687e-03   4.59888e-02
        8   2.32436e-03   4.39260e-02
        9   1.76689e-03   4.25692e-02
       10   1.37223e-03   4.16592e-02
       11   1.08483e-03   4.10387e-02
       12   8.70228e-04   4.06094e-02
       13   7.06493e-04   4.03086e-02
       14   5.79252e-04   4.00953e-02
       15   4.78831e-04   3.99426e-02
       16   3.98555e-04   3.98323e-02
       17   3.33687e-04   3.97519e-02
       18   2.80792e-04   3.96929e-02
       19   2.37331e-04   3.96492e-02
       20   2.01386e-04   3.96168e-02
       21   1.71485e-04   3.95926e-02
       22   1.46493e-04   3.95743e-02
       23   1.25506e-04   3.95606e-02
       24   1.07816e-04   3.95501e-02
       25   9.28499e-05   3.95422e-02
       26   8.01471e-05   3.95361e-02
       27   6.93322e-05   3.95315e-02
       28   6.00963e-05   3.95279e-02
       29   5.21918e-05   3.95251e-02
       30   4.54078e-05   3.95230e-02
       31   3.95721e-05   3.95214e-02
       32   3.45353e-05   3.95201e-02
       33   3.01895e-05   3.95191e-02
       34   2.64239e-05   3.95183e-02
       35   2.31571e-05   3.95177e-02
       36   2.03188e-05   3.95173e-02
       37   1.78476e-05   3.95169e-02
       38   1.56929e-05   3.95166e-02
       39   1.38116e-05   3.95164e-02
       40   1.21662e-05   3.95162e-02
       41   1.07250e-05   3.95161e-02
       42   9.46151e-06   3.95160e-02
       43   8.35955e-06   3.95159e-02
       44   7.37765e-06   3.95158e-02
       45   6.52091e-06   3.95158e-02
       46   5.76649e-06   3.95158e-02
       47   5.10178e-06   3.95157e-02
       48   4.51615e-06   3.95157e-02
       49   3.99855e-06   3.95157e-02
       50   3.54193e-06   3.95157e-02
       51   3.14025e-06   3.95157e-02
       52   2.78115e-06   3.95157e-02
       53   2.46531e-06   3.95156e-02
       54   2.18602e-06   3.95156e-02
       55   1.93889e-06   3.95156e-02
       56   1.72011e-06   3.95156e-02
       57   1.52634e-06   3.95156e-02
       58   1.35465e-06   3.95156e-02
       59   1.20248e-06   3.95156e-02
       60   1.06756e-06   3.95156e-02
       61   9.47900e-07   3.95156e-02

Computing atomic populations.
Computing atomic charges.
Computing density decomposition for atom 0
Computing density decomposition for atom 1
Computing density decomposition for atom 2
Computing cartesian and pure AIM multipoles and radial AIM moments.
Storing proatom density spline for atom 0.
Storing proatom density spline for atom 1.
Storing proatom density spline for atom 2.
charges:
[-0.881  0.441  0.441]
cartesian multipoles:
[[-0.881  0.     0.     0.133 -5.381 -0.    -0.    -4.802 -0.    -5.094  0.     0.     0.034  0.    -0.     0.     0.     0.416  0.     0.367]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.257  0.002 -0.26   0.     0.008  0.005  0.     0.     0.     0.024  0.009  0.009  0.023]
 [ 0.441  0.    -0.022 -0.001 -0.275  0.     0.    -0.257 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]

[7]:
run_cdiis(mode="AD-CDIIS", param=1e-4)
The number of electrons: 10.000003764139395
Coordinates of the atoms
 [[ 0.     0.     0.224]
 [-0.     1.457 -0.896]
 [-0.    -1.457 -0.896]]
Atomic numbers of the atom
 [8 1 1]

================================================================================
Information of integral grids.
--------------------------------------------------------------------------------
Grid size of molecular grid: 18460
************************************ Atom 0 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
          18 18 18 18 18 18 26 26 26 26 38 38 38 38 38 50 50 50 50 50
          86 86 110 110 110 110 170 194 194 434 590 590 434 434 434 302 302 302 194 194
          170 110 110 110 110 110 110 110 110 110 110 110 86 50 50 18 18 18 18 18

************************************ Atom 1 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

************************************ Atom 2 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

--------------------------------------------------------------------------------
================================================================================

Performing a density-based AIM analysis with a wavefunction as input.
  Molecular grid    : MolGrid
  Using local grids : True
  Scheme                           : Linear Iterative Stockholder
  Outer loop convergence threshold : 1.0e-06
  Inner loop convergence threshold : 1.0e-08
  Using global ISA                 : False
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CDIIS
  Basis function type              : GAUSS
  Grid type                        : 1
  Solver options -- mode           : AD-CDIIS
  Solver options -- param          : 0.0001

Load GAUSS basis functions
Iteration       Change      Entropy
        1   1.22855e-01   2.11396e-01
        2   2.65513e-02   1.08102e-01
        3   1.49501e-02   7.80048e-02
        4   9.43136e-03   6.28961e-02
        5   6.28278e-03   5.43378e-02
        6   4.36240e-03   4.91980e-02
        7   3.13687e-03   4.59888e-02
        8   2.32436e-03   4.39260e-02
        9   1.76689e-03   4.25692e-02
       10   1.37223e-03   4.16592e-02
       11   1.08483e-03   4.10387e-02
       12   8.70228e-04   4.06094e-02
       13   7.06492e-04   4.03086e-02
       14   5.79252e-04   4.00953e-02
       15   4.78830e-04   3.99426e-02
       16   3.98555e-04   3.98323e-02
       17   3.33685e-04   3.97519e-02
       18   2.80796e-04   3.96929e-02
       19   2.37333e-04   3.96492e-02
       20   2.01385e-04   3.96168e-02
       21   1.71487e-04   3.95926e-02
       22   1.46489e-04   3.95743e-02
       23   1.25510e-04   3.95606e-02
       24   1.07814e-04   3.95501e-02
       25   9.28531e-05   3.95422e-02
       26   8.01428e-05   3.95361e-02
       27   6.93323e-05   3.95315e-02
       28   6.00978e-05   3.95279e-02
       29   5.21924e-05   3.95251e-02
       30   4.54075e-05   3.95230e-02
       31   3.95686e-05   3.95214e-02
       32   3.45379e-05   3.95201e-02
       33   3.01889e-05   3.95191e-02
       34   2.64227e-05   3.95183e-02
       35   2.31640e-05   3.95177e-02
       36   2.03127e-05   3.95173e-02
       37   1.78475e-05   3.95169e-02
       38   1.56927e-05   3.95166e-02
       39   1.38130e-05   3.95164e-02
       40   1.21650e-05   3.95162e-02
       41   1.07245e-05   3.95161e-02
       42   9.46255e-06   3.95160e-02
       43   8.35990e-06   3.95159e-02
       44   7.37747e-06   3.95158e-02
       45   6.52094e-06   3.95158e-02
       46   5.76636e-06   3.95158e-02
       47   5.10187e-06   3.95157e-02
       48   4.51589e-06   3.95157e-02
       49   3.99878e-06   3.95157e-02
       50   3.54190e-06   3.95157e-02
       51   3.14019e-06   3.95157e-02
       52   2.78115e-06   3.95157e-02
       53   2.46532e-06   3.95156e-02
       54   2.18605e-06   3.95156e-02
       55   1.93892e-06   3.95156e-02
       56   1.72014e-06   3.95156e-02
       57   1.52637e-06   3.95156e-02
       58   1.35468e-06   3.95156e-02
       59   1.20251e-06   3.95156e-02
       60   1.06759e-06   3.95156e-02
       61   9.47930e-07   3.95156e-02

Computing atomic populations.
Computing atomic charges.
Computing density decomposition for atom 0
Computing density decomposition for atom 1
Computing density decomposition for atom 2
Computing cartesian and pure AIM multipoles and radial AIM moments.
Storing proatom density spline for atom 0.
Storing proatom density spline for atom 1.
Storing proatom density spline for atom 2.
charges:
[-0.881  0.441  0.441]
cartesian multipoles:
[[-0.881  0.     0.     0.133 -5.381 -0.    -0.    -4.802 -0.    -5.094  0.     0.     0.034  0.    -0.     0.     0.     0.416  0.     0.367]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.257  0.002 -0.26   0.     0.008  0.005  0.     0.     0.     0.024  0.009  0.009  0.023]
 [ 0.441  0.    -0.022 -0.001 -0.275  0.     0.    -0.257 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]

[8]:
run_cdiis(mode="Roothaan")
The number of electrons: 10.000003764139395
Coordinates of the atoms
 [[ 0.     0.     0.224]
 [-0.     1.457 -0.896]
 [-0.    -1.457 -0.896]]
Atomic numbers of the atom
 [8 1 1]

================================================================================
Information of integral grids.
--------------------------------------------------------------------------------
Grid size of molecular grid: 18460
************************************ Atom 0 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
          18 18 18 18 18 18 26 26 26 26 38 38 38 38 38 50 50 50 50 50
          86 86 110 110 110 110 170 194 194 434 590 590 434 434 434 302 302 302 194 194
          170 110 110 110 110 110 110 110 110 110 110 110 86 50 50 18 18 18 18 18

************************************ Atom 1 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

************************************ Atom 2 ************************************
   |-- Radial grid size: 120
   |-- Angular grid sizes:
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
          6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 18 18 18 18 18
          18 18 18 18 18 18 18 18 18 26 26 26 38 38 38 38 38 38 38 50
          50 50 50 50 50 86 86 86 110 110 110 170 170 170 194 194 194 194 170 170
          170 110 110 110 110 110 110 110 110 110 110 86 86 50 50 50 18 18 18 18

--------------------------------------------------------------------------------
================================================================================

Performing a density-based AIM analysis with a wavefunction as input.
  Molecular grid    : MolGrid
  Using local grids : True
  Scheme                           : Linear Iterative Stockholder
  Outer loop convergence threshold : 1.0e-06
  Inner loop convergence threshold : 1.0e-08
  Using global ISA                 : False
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CDIIS
  Basis function type              : GAUSS
  Grid type                        : 1
  Solver options -- mode           : Roothaan

Load GAUSS basis functions
Iteration       Change      Entropy
        1   1.22855e-01   2.11396e-01
        2   2.65514e-02   1.08102e-01
        3   1.49501e-02   7.80048e-02
        4   9.43137e-03   6.28961e-02
        5   6.28281e-03   5.43378e-02
        6   4.36240e-03   4.91980e-02
        7   3.13686e-03   4.59887e-02
        8   2.32436e-03   4.39260e-02
        9   1.76689e-03   4.25692e-02
       10   1.37223e-03   4.16592e-02
       11   1.08483e-03   4.10387e-02
       12   8.70227e-04   4.06094e-02
       13   7.06493e-04   4.03086e-02
       14   5.79251e-04   4.00953e-02
       15   4.78830e-04   3.99426e-02
       16   3.98557e-04   3.98323e-02
       17   3.33689e-04   3.97519e-02
       18   2.80791e-04   3.96929e-02
       19   2.37333e-04   3.96492e-02
       20   2.01387e-04   3.96168e-02
       21   1.71487e-04   3.95926e-02
       22   1.46489e-04   3.95743e-02
       23   1.25507e-04   3.95606e-02
       24   1.07816e-04   3.95501e-02
       25   9.28503e-05   3.95422e-02
       26   8.01472e-05   3.95361e-02
       27   6.93318e-05   3.95315e-02
       28   6.00975e-05   3.95279e-02
       29   5.21920e-05   3.95251e-02
       30   4.54070e-05   3.95230e-02
       31   3.95700e-05   3.95214e-02
       32   3.45371e-05   3.95201e-02
       33   3.01883e-05   3.95191e-02
       34   2.64276e-05   3.95183e-02
       35   2.31568e-05   3.95177e-02
       36   2.03181e-05   3.95173e-02
       37   1.78470e-05   3.95169e-02
       38   1.56924e-05   3.95166e-02
       39   1.38157e-05   3.95164e-02
       40   1.21655e-05   3.95162e-02
       41   1.07246e-05   3.95161e-02
       42   9.46128e-06   3.95160e-02
       43   8.35709e-06   3.95159e-02
       44   7.37815e-06   3.95158e-02
       45   6.52107e-06   3.95158e-02
       46   5.77115e-06   3.95158e-02
       47   5.10201e-06   3.95157e-02
       48   4.52004e-06   3.95157e-02
       49   3.99845e-06   3.95157e-02
       50   3.54580e-06   3.95157e-02
       51   3.13809e-06   3.95157e-02
       52   2.78526e-06   3.95157e-02
       53   2.46576e-06   3.95156e-02
       54   2.19041e-06   3.95156e-02
       55   1.94310e-06   3.95156e-02
       56   1.72051e-06   3.95156e-02
       57   1.52998e-06   3.95156e-02
       58   1.35809e-06   3.95156e-02
       59   1.20241e-06   3.95156e-02
       60   1.07050e-06   3.95156e-02
       61   9.50658e-07   3.95156e-02

Computing atomic populations.
Computing atomic charges.
Computing density decomposition for atom 0
Computing density decomposition for atom 1
Computing density decomposition for atom 2
Computing cartesian and pure AIM multipoles and radial AIM moments.
Storing proatom density spline for atom 0.
Storing proatom density spline for atom 1.
Storing proatom density spline for atom 2.
charges:
[-0.881  0.441  0.441]
cartesian multipoles:
[[-0.881 -0.    -0.     0.133 -5.381 -0.    -0.    -4.802 -0.    -5.094  0.    -0.     0.034  0.    -0.     0.    -0.     0.416 -0.     0.367]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.257  0.002 -0.26   0.     0.008  0.005  0.     0.     0.     0.024  0.009  0.009  0.023]
 [ 0.441  0.    -0.022 -0.001 -0.275  0.     0.    -0.257 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]

[ ]: