Skip to content

Implement superposition of atomic potentials.#564

Merged
sunqm merged 1 commit intopyscf:masterfrom
susilehtola:sap
Apr 15, 2020
Merged

Implement superposition of atomic potentials.#564
sunqm merged 1 commit intopyscf:masterfrom
susilehtola:sap

Conversation

@susilehtola
Copy link
Contributor

This PR implements the superposition of atomic potentials initial guess I described in

S. Lehtola, Assessment of initial guesses for self-consistent field calculations. Superposition of Atomic Potentials: simple yet efficient, J. Chem. Theory Comput. 15, 1593 (2019). DOI: 10.1021/acs.jctc.8b01089. arXiv:1810.11659.

I've strapped the guess onto the DFT routines, but I'm not sure how to make this generally available, as the initial guesses are inherited from HF/UHF where the DFT grids are not available.

Here's an example for using the guess

#!/usr/bin/python3                                                                                                                                                                            

from pyscf import gto
from pyscf import dft
import numpy
from functools import reduce

mol = gto.M(
    verbose = 4,
    symmetry= 0,
    spin = 0,
    atom = '''                                                                                                                                                                                
Ne 0 0 0                                                                                                                                                                                      
    ''',
    basis = 'unc-cc-pVQZ'
)

method = dft.RKS(mol)
method.grids.atom_grid = (75, 302)
method.xc = 'lda_x'

# Form SAP guess                                                                                                                                                                              
vsap = method.get_vsap()
t = mol.intor_symmetric('int1e_kin')
s = method.get_ovlp(mol)
hsap = t + vsap
# Form guess orbitals                                                                                                                                                                         
mo_energy, mo_coeff = method.eig(hsap, s)
print('mo energies\n{}'.format(mo_energy))
# and guess density                                                                                                                                                                           
mo_occ = method.get_occ(mo_energy, mo_coeff)
dm0 = method.make_rdm1(mo_coeff, mo_occ)

method.kernel(dm0=dm0)

@codecov-io
Copy link

codecov-io commented Mar 23, 2020

Codecov Report

Merging #564 into master will decrease coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #564      +/-   ##
==========================================
- Coverage   82.29%   82.28%   -0.01%     
==========================================
  Files         574      576       +2     
  Lines      110093   110107      +14     
==========================================
+ Hits        90598    90603       +5     
- Misses      19495    19504       +9     
Impacted Files Coverage Δ
pyscf/dft/sap_data.py 100.00% <ø> (ø)
pyscf/dft/sap.py 25.00% <25.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8015c2d...01dc1b9. Read the comment docs.

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.

3 participants