Global Linear approximation of the ISA (gLISA) method

Non-linear optimization problem

Convex optimization method

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

from horton_part.glisa import GlobalLinearISAWPart

mol, grid, rho = prepare_grid_and_dens("data/h2o.fchk")


def convex_optimization_with_non_negative_params():
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "cvxopt"
    kwargs["solver_options"] = {"feastol": kwargs["threshold"]}
    part = GlobalLinearISAWPart(**kwargs)
    print(len(part._grid.points))
    print(len(part.get_grid(0).points))
    part.do_all()
    # print_results(part)


convex_optimization_with_non_negative_params()
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CVXOPT
  Basis function type              : GAUSS
  feastol                          : 1e-06

18460
8252
Load GAUSS basis functions
     pcost       dcost       gap    pres   dres
 0:  0.0000e+00 -9.7886e+00  2e+01  1e+00  1e+00
 1:  4.4445e-01 -2.7882e+00  6e+00  4e-01  4e-01
 2:  3.9147e-01 -1.4671e+00  2e+00  4e-02  2e-02
 3:  7.7533e-02 -5.1383e-01  7e-01  3e-02  1e-02
 4:  9.8506e-03 -7.4918e-02  1e-01  1e-02  1e-02
 5:  3.3587e-02  1.2570e-02  3e-02  3e-03  4e-03
 6:  3.7859e-02  3.3697e-02  7e-03  7e-04  2e-03
 7:  3.9320e-02  3.8812e-02  9e-04  1e-04  7e-04
 8:  3.9451e-02  3.9342e-02  2e-04  2e-05  3e-04
 9:  3.9492e-02  3.9474e-02  3e-05  3e-06  6e-05
10:  3.9502e-02  3.9501e-02  2e-06  2e-07  4e-06
11:  3.9503e-02  3.9503e-02  3e-08  3e-09  6e-08
Optimal solution found.
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.

If negative parameters are allowed, one should set allow_neg_pars to True.

[2]:
def convex_optimization_with_negative_params():
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "cvxopt"
    kwargs["solver_options"] = {"feastol": kwargs["threshold"], "allow_neg_pars": True}
    part = GlobalLinearISAWPart(**kwargs)
    try:
        part.do_all()
        print_results(part)
    except RuntimeError as e:
        print(e)


convex_optimization_with_negative_params()

================================================================================
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CVXOPT
  Basis function type              : GAUSS
  feastol                          : 1e-06
  allow_neg_pars                   : True

Load GAUSS basis functions
     pcost       dcost       gap    pres   dres
 0:  0.0000e+00  2.1140e-01  1e+00  1e+00  1e+00
 1: -3.1765e-01 -1.0025e-01  1e-02  2e-01  3e-01
 2: -3.0512e-01 -2.3050e-01  1e-04  6e-02  5e-01
 3: -3.1042e-01 -2.7868e-01  1e-06  3e-02  5e-01
 4: -2.9110e-01 -2.8617e-01  1e-08  4e-03  3e-01
 5: -2.9140e-01 -2.8919e-01  1e-10  2e-03  2e-01
 6: -2.9095e-01 -2.9037e-01  1e-12  5e-04  8e-02
 7: -2.9171e-01 -2.9125e-01  1e-14  4e-04  3e-02
 8: -2.9203e-01 -2.8104e-01  1e-16  9e-03  4e-01
 9: -2.8304e-01 -2.8235e-01  1e-18  6e-04  2e-01
10: -2.8420e-01 -2.8362e-01  1e-20  5e-04  1e-01
11: -2.8516e-01 -2.8463e-01  1e-22  4e-04  4e-02
12: -2.8542e-01 -2.8511e-01  1e-24  3e-04  1e-02
13: -2.8524e-01 -2.8518e-01  1e-26  5e-05  2e-03
14: -2.8518e-01 -2.8518e-01  1e-28  2e-06  4e-05
15: -2.8518e-01 -2.8518e-01  1e-30  2e-08  4e-07
Optimal solution found.
Negative pro-atom density found!
/Users/runner/work/horton-part/horton-part/src/horton_part/utils.py:486: UserWarning: WARNING: Not all pro-atom parameters are positive!
  warnings.warn(warn_info)

Trust-region method

The optimization problem is solved by using trust constraint solver and all parameters are non-negative.

[3]:
def trust_region_explicitly():
    """Global LISA by solving constraint optimization problem (using trust constraint solver."""
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "trust-region"
    kwargs["solver_options"] = {"allow_neg_pars": False}
    part = GlobalLinearISAWPart(**kwargs)
    part.do_all()
    print_results(part)


trust_region_explicitly()

================================================================================
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : TRUST-REGION
  Basis function type              : GAUSS
  allow_neg_pars                   : False

Load GAUSS basis functions
Integral of density: {pop}
| niter |f evals|CG iter|  obj func   |tr radius |   opt    |  c viol  | penalty  |barrier param|CG stop|
|-------|-------|-------|-------------|----------|----------|----------|----------|-------------|-------|
|   1   |   1   |   0   | +2.1141e-01 | 1.00e+00 | 1.20e-01 | 0.00e+00 | 1.00e+00 |  1.00e-01   |   0   |
|   2   |   2   |   1   | +1.9929e-01 | 7.00e+00 | 1.67e-01 | 0.00e+00 | 1.00e+00 |  1.00e-01   |   2   |
|   3   |   3   |   3   | +4.7679e-01 | 1.60e+01 | 8.33e-02 | 0.00e+00 | 1.00e+00 |  1.00e-01   |   4   |
|   4   |   3   |   3   | +4.7679e-01 | 8.01e+01 | 6.94e-02 | 0.00e+00 | 1.00e+00 |  2.00e-02   |   0   |
|   5   |   4   |   6   | +1.6137e-01 | 8.01e+01 | 4.16e-02 | 0.00e+00 | 1.00e+00 |  2.00e-02   |   4   |
|   6   |   5   |  11   | +9.5478e-02 | 8.01e+01 | 4.04e-02 | 0.00e+00 | 1.00e+00 |  2.00e-02   |   4   |
|   7   |   6   |  14   | +9.2717e-02 | 8.01e+01 | 3.63e-02 | 0.00e+00 | 1.00e+00 |  2.00e-02   |   4   |
|   8   |   7   |  18   | +8.1314e-02 | 8.01e+01 | 1.59e-02 | 0.00e+00 | 1.00e+00 |  2.00e-02   |   4   |
|   9   |   7   |  18   | +8.1314e-02 | 4.01e+02 | 2.38e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   0   |
|  10   |   8   |  23   | +6.2201e-02 | 4.01e+02 | 2.80e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  11   |   9   |  27   | +5.6830e-02 | 4.01e+02 | 1.98e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  12   |  10   |  34   | +4.9801e-02 | 4.01e+02 | 1.61e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  13   |  11   |  36   | +4.9485e-02 | 4.01e+02 | 1.66e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  14   |  12   |  40   | +4.8207e-02 | 4.01e+02 | 1.11e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  15   |  13   |  46   | +4.6276e-02 | 4.01e+02 | 1.29e-02 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  16   |  14   |  50   | +4.5436e-02 | 4.01e+02 | 9.98e-03 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  17   |  15   |  54   | +4.4941e-02 | 4.01e+02 | 4.90e-03 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  18   |  16   |  57   | +4.4293e-02 | 4.01e+02 | 5.40e-03 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  19   |  17   |  61   | +4.3738e-02 | 4.01e+02 | 3.90e-03 | 0.00e+00 | 1.00e+00 |  4.00e-03   |   4   |
|  20   |  17   |  61   | +4.3738e-02 | 2.00e+03 | 4.86e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   0   |
|  21   |  18   |  66   | +4.1343e-02 | 2.00e+03 | 2.45e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   4   |
|  22   |  19   |  74   | +4.1343e-02 | 2.00e+02 | 2.45e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   3   |
|  23   |  20   |  79   | +4.1050e-02 | 2.00e+02 | 3.39e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   4   |
|  24   |  21   |  81   | +4.0956e-02 | 2.00e+02 | 3.81e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   4   |
|  25   |  22   |  85   | +4.0956e-02 | 2.00e+01 | 3.81e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   3   |
|  26   |  23   |  90   | +4.0577e-02 | 2.00e+01 | 1.02e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   4   |
|  27   |  24   |  97   | +4.0091e-02 | 2.00e+01 | 2.43e-03 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   4   |
|  28   |  25   |  98   | +4.0071e-02 | 2.00e+01 | 5.01e-04 | 0.00e+00 | 1.00e+00 |  8.00e-04   |   4   |
|  29   |  25   |  98   | +4.0071e-02 | 1.00e+02 | 6.48e-04 | 0.00e+00 | 1.00e+00 |  1.60e-04   |   0   |
|  30   |  26   |  105  | +3.9820e-02 | 1.00e+02 | 3.77e-04 | 0.00e+00 | 1.00e+00 |  1.60e-04   |   4   |
|  31   |  27   |  114  | +3.9653e-02 | 1.00e+02 | 4.85e-04 | 0.00e+00 | 1.00e+00 |  1.60e-04   |   4   |
|  32   |  28   |  115  | +3.9650e-02 | 1.00e+02 | 3.61e-04 | 0.00e+00 | 1.00e+00 |  1.60e-04   |   4   |
|  33   |  29   |  120  | +3.9608e-02 | 1.00e+02 | 7.52e-05 | 0.00e+00 | 1.00e+00 |  1.60e-04   |   4   |
|  34   |  29   |  120  | +3.9608e-02 | 5.01e+02 | 1.20e-04 | 0.00e+00 | 1.00e+00 |  3.20e-05   |   0   |
|  35   |  30   |  130  | +3.9513e-02 | 5.01e+02 | 2.30e-05 | 0.00e+00 | 1.00e+00 |  3.20e-05   |   4   |
|  36   |  31   |  141  | +3.9505e-02 | 5.01e+02 | 1.16e-05 | 0.00e+00 | 1.00e+00 |  3.20e-05   |   4   |
|  37   |  31   |  141  | +3.9505e-02 | 2.50e+03 | 2.18e-05 | 0.00e+00 | 1.00e+00 |  6.40e-06   |   0   |
|  38   |  32   |  152  | +3.9501e-02 | 2.50e+03 | 1.90e-05 | 0.00e+00 | 1.00e+00 |  6.40e-06   |   4   |
|  39   |  33   |  157  | +3.9501e-02 | 2.50e+03 | 2.29e-06 | 0.00e+00 | 1.00e+00 |  6.40e-06   |   4   |
|  40   |  34   |  162  | +3.9501e-02 | 2.50e+03 | 1.05e-06 | 0.00e+00 | 1.00e+00 |  6.40e-06   |   4   |
|  41   |  34   |  162  | +3.9501e-02 | 1.25e+04 | 3.56e-06 | 0.00e+00 | 1.00e+00 |  1.28e-06   |   0   |
|  42   |  35   |  174  | +3.9500e-02 | 1.25e+04 | 3.90e-07 | 0.00e+00 | 1.00e+00 |  1.28e-06   |   4   |

`gtol` termination condition is satisfied.
Number of iterations: 42, function evaluations: 35, CG iterations: 174, optimality: 3.90e-07, constraint violation: 0.00e+00, execution time: 0.26 s.
Optimizer message: "`gtol` termination condition is satisfied."
Constraint: 1.4832739351433588e-05
Optimized parameters:
[0.198 0.633 0.984 2.939 3.294 0.833 0.071 0.35  0.13  0.008 0.071 0.35  0.13  0.008]
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.368]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.256  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]]

If negative parameters are allowed, one should set allow_neg_pars to True.

[4]:
def trust_region_implicitly():
    """Global LISA by solving constraint optimization problem (using trust constraint solver with negative parameters allowed.)"""
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "trust-region"
    kwargs["solver_options"] = {"allow_neg_pars": True}
    part = GlobalLinearISAWPart(**kwargs)
    try:
        part.do_all()
        print_results(part)
    except RuntimeError:
        print("The program is stoped because proatom density is negative somewhere!")


trust_region_implicitly()

================================================================================
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : TRUST-REGION
  Basis function type              : GAUSS
  allow_neg_pars                   : True

Load GAUSS basis functions
Integral of density: {pop}
| niter |f evals|CG iter|  obj func   |tr radius |   opt    |  c viol  | penalty  |CG stop|
|-------|-------|-------|-------------|----------|----------|----------|----------|-------|
|   1   |   1   |   0   | +2.1141e-01 | 1.00e+00 | 2.40e-01 | 1.78e-15 | 1.00e+00 |   0   |
|   2   |   2   |   1   | +1.4008e-01 | 1.00e+00 | 3.76e-01 | 0.00e+00 | 1.00e+00 |   4   |
|   3   |   3   |   3   | +1.4008e-01 | 5.01e-01 | 3.76e-01 | 0.00e+00 | 1.00e+00 |   2   |
|   4   |   4   |   6   | +8.2810e-02 | 7.15e-01 | 1.34e-01 | 0.00e+00 | 1.00e+00 |   4   |
|   5   |   5   |   7   | +6.7602e-02 | 7.15e-01 | 9.77e-02 | 0.00e+00 | 1.00e+00 |   4   |
|   6   |   6   |   9   | +4.8308e-02 | 7.15e-01 | 1.04e+00 | 1.78e-15 | 1.00e+00 |   4   |
|   7   |   8   |  11   | +4.8308e-02 | 1.72e-01 | 1.04e+00 | 1.78e-15 | 1.00e+00 |   4   |
|   8   |  10   |  12   | +4.8308e-02 | 8.62e-02 | 1.04e+00 | 1.78e-15 | 1.00e+00 |   2   |
|   9   |  12   |  13   | +4.8308e-02 | 4.31e-02 | 1.04e+00 | 1.78e-15 | 1.00e+00 |   2   |
|  10   |  13   |  15   | +4.7239e-02 | 4.31e-02 | 6.68e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  11   |  14   |  16   | +4.7239e-02 | 2.15e-02 | 6.68e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  12   |  15   |  17   | +4.7239e-02 | 1.08e-02 | 6.68e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  13   |  17   |  18   | +4.7239e-02 | 5.39e-03 | 6.68e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  14   |  18   |  20   | +4.7150e-02 | 5.39e-03 | 3.40e-01 | 0.00e+00 | 1.00e+00 |   4   |
|  15   |  19   |  21   | +4.6836e-02 | 5.39e-03 | 2.17e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  16   |  21   |  23   | +4.6836e-02 | 2.69e-03 | 2.17e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  17   |  22   |  26   | +4.6836e-02 | 1.31e-03 | 2.17e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  18   |  24   |  27   | +4.6836e-02 | 4.90e-04 | 2.17e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  19   |  25   |  29   | +4.6836e-02 | 1.07e-04 | 2.17e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  20   |  27   |  30   | +4.6836e-02 | 1.07e-05 | 2.17e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  21   |  28   |  32   | +4.6834e-02 | 7.52e-05 | 2.14e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  22   |  29   |  33   | +4.6812e-02 | 7.52e-05 | 2.03e-01 | 0.00e+00 | 1.00e+00 |   3   |
|  23   |  31   |  34   | +4.6812e-02 | 7.52e-06 | 2.03e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  24   |  32   |  35   | +4.6810e-02 | 5.26e-05 | 2.02e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  25   |  34   |  36   | +4.6810e-02 | 5.26e-06 | 2.02e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  26   |  35   |  37   | +4.6808e-02 | 3.68e-05 | 2.01e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  27   |  37   |  38   | +4.6808e-02 | 3.68e-06 | 2.01e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  28   |  39   |  39   | +4.6808e-02 | 3.68e-07 | 2.01e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  29   |  40   |  41   | +4.6808e-02 | 2.58e-06 | 2.01e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  30   |  41   |  42   | +4.6808e-02 | 2.58e-06 | 2.01e-01 | 0.00e+00 | 1.00e+00 |   3   |
|  31   |  42   |  43   | +4.6808e-02 | 2.58e-07 | 2.01e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  32   |  43   |  44   | +4.6807e-02 | 2.58e-07 | 2.01e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  33   |  44   |  45   | +4.6807e-02 | 2.58e-07 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  34   |  45   |  46   | +4.6807e-02 | 1.81e-06 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  35   |  47   |  47   | +4.6807e-02 | 1.81e-07 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  36   |  48   |  49   | +4.6807e-02 | 1.26e-06 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  37   |  50   |  50   | +4.6807e-02 | 1.26e-07 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  38   |  51   |  52   | +4.6807e-02 | 8.85e-07 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  39   |  53   |  53   | +4.6807e-02 | 8.85e-08 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  40   |  54   |  55   | +4.6807e-02 | 6.19e-07 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  41   |  56   |  56   | +4.6807e-02 | 6.19e-08 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   3   |
|  42   |  57   |  58   | +4.6807e-02 | 4.33e-07 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  43   |  59   |  59   | +4.6807e-02 | 4.33e-08 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   3   |
|  44   |  60   |  61   | +4.6807e-02 | 3.03e-07 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  45   |  62   |  62   | +4.6807e-02 | 3.03e-08 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   3   |
|  46   |  63   |  64   | +4.6807e-02 | 2.12e-07 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  47   |  65   |  65   | +4.6807e-02 | 2.12e-08 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  48   |  66   |  67   | +4.6807e-02 | 1.49e-07 | 2.00e-01 | 0.00e+00 | 1.00e+00 |   2   |
|  49   |  67   |  68   | +4.6807e-02 | 1.49e-07 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  50   |  69   |  69   | +4.6807e-02 | 1.49e-08 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  51   |  70   |  71   | +4.6807e-02 | 1.04e-07 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   2   |
|  52   |  71   |  72   | +4.6807e-02 | 1.04e-08 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  53   |  72   |  73   | +4.6807e-02 | 1.04e-08 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |
|  54   |  74   |  74   | +4.6807e-02 | 1.04e-09 | 2.00e-01 | 1.78e-15 | 1.00e+00 |   3   |

`xtol` termination condition is satisfied.
Number of iterations: 54, function evaluations: 74, CG iterations: 74, optimality: 2.00e-01, constraint violation: 1.78e-15, execution time: 0.12 s.
Optimizer message: "`xtol` termination condition is satisfied."
Constraint: -5.6070481218029045e-06
Optimized parameters:
[ 0.189  0.661  0.995  3.292  2.929  0.844  0.082  0.299  0.2   -0.044  0.085  0.295  0.215 -0.042]
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.
                Pro-atom not positive everywhere. Lost 3.8e-05 electrons
Storing proatom density spline for atom 2.
                Pro-atom not positive everywhere. Lost 3.2e-05 electrons
charges:
[-0.871  0.438  0.43 ]
cartesian multipoles:
[[-0.871  0.    -0.009  0.119 -5.413 -0.    -0.    -4.786  0.008 -5.097  0.    -0.012  0.052  0.    -0.     0.    -0.035  0.374 -0.018  0.367]
 [ 0.438 -0.     0.021  0.002 -0.26   0.     0.    -0.251 -0.004 -0.252 -0.     0.008  0.022 -0.    -0.    -0.     0.035  0.038  0.011  0.066]
 [ 0.43   0.    -0.023  0.    -0.268 -0.     0.    -0.253  0.002 -0.259  0.    -0.003  0.018 -0.     0.     0.    -0.015  0.025 -0.007  0.059]]

Non-linear equations (fixed-point equations)

Self-consistent method

An equivalent fixed-point problem is addressed by using self-consistent solver and non-negative parameters are guaranteed.

[5]:
def self_consistent_method():
    """Global LISA with self-consistent solver."""
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "sc"
    part = GlobalLinearISAWPart(**kwargs)
    part.do_all()
    print_results(part)


self_consistent_method()

================================================================================
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : SC
  Basis function type              : GAUSS

Load GAUSS basis functions
Iteration       Change      Entropy
        1   8.86627e-02   2.11396e-01
        2   5.02880e-02   1.36337e-01
        3   2.65836e-02   1.03249e-01
        4   2.18092e-02   8.45035e-02
        5   1.89757e-02   7.24856e-02
        6   1.50533e-02   6.43163e-02
        7   1.12729e-02   5.85644e-02
        8   8.31844e-03   5.44071e-02
        9   6.29139e-03   5.13377e-02
       10   5.01183e-03   4.90303e-02
       11   4.21416e-03   4.72682e-02
       12   3.67227e-03   4.59035e-02
       13   3.24950e-03   4.48326e-02
       14   2.88448e-03   4.39819e-02
       15   2.55841e-03   4.32984e-02
       16   2.27076e-03   4.27431e-02
       17   2.02611e-03   4.22876e-02
       18   1.82791e-03   4.19103e-02
       19   1.67592e-03   4.15951e-02
       20   1.56567e-03   4.13296e-02
       21   1.48939e-03   4.11045e-02
       22   1.43786e-03   4.09123e-02
       23   1.40224e-03   4.07473e-02
       24   1.37521e-03   4.06048e-02
       25   1.35147e-03   4.04812e-02
       26   1.32752e-03   4.03736e-02
       27   1.30132e-03   4.02795e-02
       28   1.27187e-03   4.01969e-02
       29   1.23890e-03   4.01242e-02
       30   1.20255e-03   4.00601e-02
       31   1.16323e-03   4.00033e-02
       32   1.12145e-03   3.99530e-02
       33   1.07780e-03   3.99083e-02
       34   1.03283e-03   3.98685e-02
       35   9.87070e-04   3.98331e-02
       36   9.41001e-04   3.98014e-02
       37   8.95035e-04   3.97730e-02
       38   8.49528e-04   3.97477e-02
       39   8.04775e-04   3.97249e-02
       40   7.61022e-04   3.97045e-02
       41   7.18463e-04   3.96861e-02
       42   6.77249e-04   3.96696e-02
       43   6.37496e-04   3.96547e-02
       44   5.99284e-04   3.96413e-02
       45   5.62668e-04   3.96292e-02
       46   5.27679e-04   3.96183e-02
       47   4.94328e-04   3.96085e-02
       48   4.62610e-04   3.95995e-02
       49   4.32506e-04   3.95915e-02
       50   4.03988e-04   3.95841e-02
       51   3.77019e-04   3.95775e-02
       52   3.51554e-04   3.95715e-02
       53   3.27545e-04   3.95660e-02
       54   3.04939e-04   3.95610e-02
       55   2.83681e-04   3.95565e-02
       56   2.63714e-04   3.95524e-02
       57   2.44980e-04   3.95487e-02
       58   2.27422e-04   3.95452e-02
       59   2.10983e-04   3.95421e-02
       60   1.95606e-04   3.95393e-02
       61   1.81236e-04   3.95367e-02
       62   1.67819e-04   3.95343e-02
       63   1.55302e-04   3.95321e-02
       64   1.43635e-04   3.95301e-02
       65   1.32770e-04   3.95283e-02
       66   1.22660e-04   3.95266e-02
       67   1.13260e-04   3.95250e-02
       68   1.04527e-04   3.95236e-02
       69   9.64218e-05   3.95223e-02
       70   8.89051e-05   3.95211e-02
       71   8.19404e-05   3.95200e-02
       72   7.54931e-05   3.95189e-02
       73   6.95305e-05   3.95180e-02
       74   6.40217e-05   3.95171e-02
       75   5.89375e-05   3.95163e-02
       76   5.42505e-05   3.95155e-02
       77   4.99350e-05   3.95148e-02
       78   4.59664e-05   3.95142e-02
       79   4.23222e-05   3.95136e-02
       80   3.89806e-05   3.95130e-02
       81   3.59216e-05   3.95125e-02
       82   3.31262e-05   3.95120e-02
       83   3.05764e-05   3.95115e-02
       84   2.82555e-05   3.95111e-02
       85   2.61474e-05   3.95107e-02
       86   2.42371e-05   3.95103e-02
       87   2.25102e-05   3.95100e-02
       88   2.09529e-05   3.95096e-02
       89   1.95521e-05   3.95093e-02
       90   1.82952e-05   3.95090e-02
       91   1.71702e-05   3.95088e-02
       92   1.61652e-05   3.95085e-02
       93   1.52692e-05   3.95083e-02
       94   1.44714e-05   3.95080e-02
       95   1.37614e-05   3.95078e-02
       96   1.31295e-05   3.95076e-02
       97   1.25667e-05   3.95074e-02
       98   1.20643e-05   3.95072e-02
       99   1.16145e-05   3.95070e-02
      100   1.12102e-05   3.95069e-02
      101   1.08449e-05   3.95067e-02
      102   1.05128e-05   3.95066e-02
      103   1.02089e-05   3.95064e-02
      104   9.92867e-06   3.95063e-02
      105   9.66837e-06   3.95062e-02
      106   9.42469e-06   3.95060e-02
      107   9.19488e-06   3.95059e-02
      108   8.97660e-06   3.95058e-02
      109   8.76791e-06   3.95057e-02
      110   8.56722e-06   3.95056e-02
      111   8.37324e-06   3.95055e-02
      112   8.18490e-06   3.95054e-02
      113   8.00136e-06   3.95053e-02
      114   7.82198e-06   3.95052e-02
      115   7.64622e-06   3.95052e-02
      116   7.47369e-06   3.95051e-02
      117   7.30411e-06   3.95050e-02
      118   7.13725e-06   3.95049e-02
      119   6.97296e-06   3.95049e-02
      120   6.81115e-06   3.95048e-02
      121   6.65177e-06   3.95047e-02
      122   6.49477e-06   3.95047e-02
      123   6.34017e-06   3.95046e-02
      124   6.18796e-06   3.95046e-02
      125   6.03818e-06   3.95045e-02
      126   5.89086e-06   3.95045e-02
      127   5.74604e-06   3.95044e-02
      128   5.60374e-06   3.95044e-02
      129   5.46402e-06   3.95043e-02
      130   5.32691e-06   3.95043e-02
      131   5.19244e-06   3.95042e-02
      132   5.06063e-06   3.95042e-02
      133   4.93152e-06   3.95041e-02
      134   4.80512e-06   3.95041e-02
      135   4.68144e-06   3.95041e-02
      136   4.56050e-06   3.95040e-02
      137   4.44229e-06   3.95040e-02
      138   4.32682e-06   3.95040e-02
      139   4.21407e-06   3.95039e-02
      140   4.10404e-06   3.95039e-02
      141   3.99670e-06   3.95039e-02
      142   3.89204e-06   3.95038e-02
      143   3.79003e-06   3.95038e-02
      144   3.69064e-06   3.95038e-02
      145   3.59384e-06   3.95038e-02
      146   3.49959e-06   3.95037e-02
      147   3.40786e-06   3.95037e-02
      148   3.31861e-06   3.95037e-02
      149   3.23178e-06   3.95037e-02
      150   3.14735e-06   3.95037e-02
      151   3.06527e-06   3.95036e-02
      152   2.98547e-06   3.95036e-02
      153   2.90793e-06   3.95036e-02
      154   2.83258e-06   3.95036e-02
      155   2.75938e-06   3.95036e-02
      156   2.68828e-06   3.95035e-02
      157   2.61923e-06   3.95035e-02
      158   2.55218e-06   3.95035e-02
      159   2.48707e-06   3.95035e-02
      160   2.42385e-06   3.95035e-02
      161   2.36248e-06   3.95035e-02
      162   2.30290e-06   3.95035e-02
      163   2.24507e-06   3.95034e-02
      164   2.18893e-06   3.95034e-02
      165   2.13444e-06   3.95034e-02
      166   2.08154e-06   3.95034e-02
      167   2.03020e-06   3.95034e-02
      168   1.98037e-06   3.95034e-02
      169   1.93199e-06   3.95034e-02
      170   1.88504e-06   3.95034e-02
      171   1.83945e-06   3.95034e-02
      172   1.79519e-06   3.95033e-02
      173   1.75223e-06   3.95033e-02
      174   1.71051e-06   3.95033e-02
      175   1.66999e-06   3.95033e-02
      176   1.63065e-06   3.95033e-02
      177   1.59245e-06   3.95033e-02
      178   1.55533e-06   3.95033e-02
      179   1.51928e-06   3.95033e-02
      180   1.48426e-06   3.95033e-02
      181   1.45023e-06   3.95033e-02
      182   1.41716e-06   3.95033e-02
      183   1.38501e-06   3.95033e-02
      184   1.35377e-06   3.95033e-02
      185   1.32340e-06   3.95032e-02
      186   1.29387e-06   3.95032e-02
      187   1.26515e-06   3.95032e-02
      188   1.23722e-06   3.95032e-02
      189   1.21006e-06   3.95032e-02
      190   1.18362e-06   3.95032e-02
      191   1.15790e-06   3.95032e-02
      192   1.13287e-06   3.95032e-02
      193   1.10851e-06   3.95032e-02
      194   1.08479e-06   3.95032e-02
      195   1.06170e-06   3.95032e-02
      196   1.03921e-06   3.95032e-02
      197   1.01730e-06   3.95032e-02
      198   9.95966e-07   3.95032e-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.801  0.    -5.094  0.    -0.     0.033  0.    -0.    -0.    -0.     0.416 -0.     0.366]
 [ 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]]

Direct Inversion of Iterative Space (DIIS)

An equivalent fixed-point problem is addressed by using self-consistent solver and non-negative parameters are guaranteed.

[6]:
def diis_method():
    """Global LISA with DIIS solver."""
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "diis"
    kwargs["solver_options"] = {"diis_size": 8, "version": "A"}
    part = GlobalLinearISAWPart(**kwargs)
    part.do_all()
    print_results(part)


# not robust
diis_method()

================================================================================
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : DIIS
  Basis function type              : GAUSS
  diis_size                        : 8
  version                          : A

Load GAUSS basis functions
            Iter.    dRMS
            -----    ------
           0       7.836145E-02
           1       8.081885E-02
           2       1.233679E-01
           3       7.717830E-02
           4       4.572785E-02
           5       5.201493E-02
           6       3.223615E-02
           7       9.394718E-03
           8       6.061731E-02
           9       9.025303E-03
           10      5.802607E-03
           11      1.029386E-02
           12      3.350408E-03
           13      3.111845E-03
           14      3.744714E-03
           15      1.318951E-03
           16      6.955798E-05
           17      6.533932E-05
           18      1.075412E-04
           19      1.383956E-04
           20      1.588891E-04
           21      7.253507E-06
           22      9.279751E-06
           23      7.070551E-06
           24      1.423479E-06
           25      3.470704E-06
           26      1.397700E-05
           27      2.355896E-06
           28      2.782012E-07
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.134 -5.381 -0.    -0.    -4.802  0.    -5.095  0.    -0.     0.034  0.    -0.     0.    -0.     0.417 -0.     0.368]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.256  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.256 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]
[7]:
def cdiis_method():
    """Global LISA with DIIS solver."""
    kwargs = prepare_argument_dict(mol, grid, rho)
    kwargs["solver"] = "cdiis"
    kwargs["solver_options"] = {"diis_size": 8, "param": 1e-5, "mode": "AD-CDIIS"}
    part = GlobalLinearISAWPart(**kwargs)
    part.do_all()
    print_results(part)


# not robust
cdiis_method()

================================================================================
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
  Using global ISA                 : True
  Maximum outer iterations         : 1000
  lmax                             : 3
  Solver                           : CDIIS
  Basis function type              : GAUSS
  diis_size                        : 8
  param                            : 1e-05
  mode                             : AD-CDIIS

Load GAUSS basis functions



-----------------------------------------
CDIIS like program
---- Mode: AD-CDIIS
---- param value: 1e-05
======================
iteration: 1
mk value: 0
||r(k)|| = 0.2717673342032897
||r_{k+1}|| = 0.1534880585967477
======================
iteration: 2
mk value: 1
||r(k)|| = 0.1534880585967477
size of Cs: (14, 1)
size of c: 2, size of gamma: (1,)
||r_{k+1}|| = 0.09696370317435712
======================
iteration: 3
mk value: 2
||r(k)|| = 0.09696370317435712
size of Cs: (14, 2)
size of c: 3, size of gamma: (2,)
||r_{k+1}|| = 0.04276151069724607
======================
iteration: 4
mk value: 3
||r(k)|| = 0.04276151069724607
size of Cs: (14, 3)
size of c: 4, size of gamma: (3,)
||r_{k+1}|| = 0.017709062241212485
======================
iteration: 5
mk value: 4
||r(k)|| = 0.017709062241212485
size of Cs: (14, 4)
size of c: 5, size of gamma: (4,)
||r_{k+1}|| = 0.01159863896353481
======================
iteration: 6
mk value: 5
||r(k)|| = 0.01159863896353481
size of Cs: (14, 5)
size of c: 6, size of gamma: (5,)
||r_{k+1}|| = 0.00743242542947635
======================
iteration: 7
mk value: 6
||r(k)|| = 0.00743242542947635
size of Cs: (14, 6)
size of c: 7, size of gamma: (6,)
||r_{k+1}|| = 0.0062053145562244606
======================
iteration: 8
mk value: 7
||r(k)|| = 0.0062053145562244606
size of Cs: (14, 7)
size of c: 8, size of gamma: (7,)
||r_{k+1}|| = 0.009267245784610878
======================
iteration: 9
mk value: 8
||r(k)|| = 0.009267245784610878
size of Cs: (14, 8)
size of c: 9, size of gamma: (8,)
||r_{k+1}|| = 0.0022213144931838994
======================
iteration: 10
mk value: 9
||r(k)|| = 0.0022213144931838994
size of Cs: (14, 9)
size of c: 10, size of gamma: (9,)
||r_{k+1}|| = 0.004576059062165896
======================
iteration: 11
mk value: 10
||r(k)|| = 0.004576059062165896
size of Cs: (14, 10)
size of c: 11, size of gamma: (10,)
||r_{k+1}|| = 0.0025100101877465583
======================
iteration: 12
mk value: 11
||r(k)|| = 0.0025100101877465583
size of Cs: (14, 11)
size of c: 12, size of gamma: (11,)
||r_{k+1}|| = 0.000669577520475538
======================
iteration: 13
mk value: 12
||r(k)|| = 0.000669577520475538
size of Cs: (14, 12)
size of c: 13, size of gamma: (12,)
||r_{k+1}|| = 0.0017232123787955737
======================
iteration: 14
mk value: 13
||r(k)|| = 0.0017232123787955737
size of Cs: (14, 13)
size of c: 14, size of gamma: (13,)
||r_{k+1}|| = 0.0009518416972980569
======================
iteration: 15
mk value: 14
||r(k)|| = 0.0009518416972980569
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.0012120049886838007
(14, 15)
(14, 14)
======================
iteration: 16
mk value: 14
||r(k)|| = 0.0012120049886838007
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.000555132306042355
(14, 15)
(14, 14)
======================
iteration: 17
mk value: 14
||r(k)|| = 0.000555132306042355
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.0007008566147911262
(14, 15)
(14, 14)
======================
iteration: 18
mk value: 14
||r(k)|| = 0.0007008566147911262
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00039854246574192354
(14, 15)
(14, 14)
======================
iteration: 19
mk value: 14
||r(k)|| = 0.00039854246574192354
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00015964995802809808
(14, 15)
(14, 14)
======================
iteration: 20
mk value: 14
||r(k)|| = 0.00015964995802809808
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00022087204337276908
(14, 15)
(14, 14)
======================
iteration: 21
mk value: 14
||r(k)|| = 0.00022087204337276908
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00019885692936689024
(14, 15)
(14, 14)
======================
iteration: 22
mk value: 14
||r(k)|| = 0.00019885692936689024
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00015562554346788628
(14, 15)
(14, 14)
======================
iteration: 23
mk value: 14
||r(k)|| = 0.00015562554346788628
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.0002874906968957706
(14, 15)
(14, 14)
======================
iteration: 24
mk value: 14
||r(k)|| = 0.0002874906968957706
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.0005200827050332446
(14, 15)
(14, 14)
======================
iteration: 25
mk value: 14
||r(k)|| = 0.0005200827050332446
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00041885629911883994
(14, 15)
(14, 14)
======================
iteration: 26
mk value: 14
||r(k)|| = 0.00041885629911883994
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00010314143289939753
(14, 15)
(14, 14)
======================
iteration: 27
mk value: 14
||r(k)|| = 0.00010314143289939753
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.000130908548803352
(14, 15)
(14, 14)
======================
iteration: 28
mk value: 14
||r(k)|| = 0.000130908548803352
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.00013201113455872752
(14, 15)
(14, 14)
======================
iteration: 29
mk value: 14
||r(k)|| = 0.00013201113455872752
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.0051906270448311385
(14, 15)
(14, 14)
======================
iteration: 30
mk value: 14
||r(k)|| = 0.0051906270448311385
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.009744491214390931
(14, 15)
(14, 14)
======================
iteration: 31
mk value: 14
||r(k)|| = 0.009744491214390931
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 0.034766785938366435
(14, 15)
(14, 14)
======================
iteration: 32
mk value: 14
||r(k)|| = 0.034766785938366435
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 1.02911825654527e-05
(14, 15)
(14, 14)
======================
iteration: 33
mk value: 14
||r(k)|| = 1.02911825654527e-05
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 1.7077821668829208e-05
(14, 15)
(14, 14)
======================
iteration: 34
mk value: 14
||r(k)|| = 1.7077821668829208e-05
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 1.9976939285988652e-05
(14, 15)
(14, 14)
======================
iteration: 35
mk value: 14
||r(k)|| = 1.9976939285988652e-05
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 7.272681088541935e-05
(14, 15)
(14, 14)
======================
iteration: 36
mk value: 14
||r(k)|| = 7.272681088541935e-05
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 4.785422478941214e-06
(14, 15)
(14, 14)
======================
iteration: 37
mk value: 14
||r(k)|| = 4.785422478941214e-06
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 2.358239768862644e-06
(14, 15)
(14, 14)
======================
iteration: 38
mk value: 14
||r(k)|| = 2.358239768862644e-06
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 3.5008244473906955e-06
(14, 15)
(14, 14)
======================
iteration: 39
mk value: 14
||r(k)|| = 3.5008244473906955e-06
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 1.0147363706601478e-06
(14, 15)
(14, 14)
======================
iteration: 40
mk value: 14
||r(k)|| = 1.0147363706601478e-06
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 1.3220791503575476e-06
(14, 15)
(14, 14)
======================
iteration: 41
mk value: 14
||r(k)|| = 1.3220791503575476e-06
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 1.2111434632636229e-06
(14, 15)
(14, 14)
======================
iteration: 42
mk value: 14
||r(k)|| = 1.2111434632636229e-06
size of Cs: (14, 14)
size of c: 15, size of gamma: (14,)
||r_{k+1}|| = 4.523096310599737e-07
(14, 15)
(14, 14)
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.134 -5.382 -0.    -0.    -4.802 -0.    -5.095  0.     0.     0.034  0.     0.     0.     0.     0.417  0.     0.368]
 [ 0.441  0.     0.022 -0.001 -0.275 -0.    -0.    -0.256  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.256 -0.002 -0.26   0.    -0.008  0.005  0.    -0.     0.    -0.024  0.009 -0.009  0.023]]
[ ]: