1#!/usr/bin/env python
2#
3# Author: Oliver J. Backhouse <olbackhouse@gmail.com>
4#         George H. Booth <george.booth@kcl.ac.uk>
5#
6
7'''
8An example of generating Dyson orbitals from an AGF2 calculation.
9
10Default AGF2 corresponds to the AGF2(1,0) method outlined in the papers:
11  - O. J. Backhouse, M. Nusspickel and G. H. Booth, J. Chem. Theory Comput., 16, 1090 (2020).
12  - O. J. Backhouse and G. H. Booth, J. Chem. Theory Comput., 16, 6294 (2020).
13'''
14
15from pyscf import gto, scf, agf2
16
17mol = gto.M(atom='O 0 0 0; H 0 0 1; H 0 1 0', basis='cc-pvdz')
18
19mf = scf.RHF(mol)
20mf.conv_tol = 1e-12
21mf.run()
22
23# Run an AGF2 calculation
24gf2 = agf2.AGF2(mf)
25gf2.conv_tol = 1e-7
26gf2.run(verbose=4)
27
28# Access the Dyson orbitals (vectors in AO basis):
29dyson_orbitals = gf2.qmo_coeff
30
31# Find the Dyson orbital corresponding to the HOMO and LUMO:
32dyson_homo = gf2.qmo_coeff[:,gf2.qmo_occ > 0][:,-1]
33dyson_lumo = gf2.qmo_coeff[:,gf2.qmo_occ == 0][:,0]
34