Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
/ DAMP Public archive

Diagrammatic Arbitrary-order Moller-Plesset

Notifications You must be signed in to change notification settings

pwborthwick/DAMP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAMP - Diagrammatic Arbitrary-order Moller-Plesset

Description   The HUGENHOLTZ class allows the enumeration of all Hugenholtz diagrams of a specified order. The class will generate the connection properties of each valid diagram and use these together with an established set of rules to generate the algebraic expressions of the Moller-Plesset theory at that order. Latex files can be produced and Python code generated which can be used with avalable quantum chemistry programs.

Installation   The repository can be simply copied to the local machine. Dependencies are Python 3, numpy, math and datetime. To run the pySCF example that program will need to be installed. The root folder contains a script.py file which is an annotated example of how to run the program. The sub-folder source contains the hugenholtz module which itself holds the HUGENHOLTZ class. The sub-folder outputs has a .tex, .pdf and a .py file for Moller-Plesset theory at levels 2, 3 and 4. The tests sub-folder has a .npz file containing molecular spin orbital energies and 2-electron repulsion integrals for $H2 O$ in a STO-3G basis using a geometry defined here. A file harpy.py in the tests sub-folder uses the .npz data to evaluate the mp2, mp3 and mp4 correction energies using code generated by the HUGENHOLTZ class and compares the results with the Hirata benchmarks from the previous link. A file pyscf.py in the test sub-folder is an example of using HUGENHOLTZ class produced code with pySCF and the results are compared. Additionally if diagrams are to be plotted via the DISPLAY class then matplotlib must be installed.

Running   The program is run simply as

from source.hugenholt\ import HUGENHOLTZ
order = 3
h = HUGENHOLTZ(order)

To produce a latex file run (default filename is 'mpn.tex' to working directory)

h.generate_file('latex', file='outputs/mp3.tex')

To produce a Python file containing a function to evaluate Moller-Plesset correction energy run

h,generate_file('python', file='outputs/mp3.py')

The subroutine is defined as damp(eps, g, nocc) where eps are the orbital energies in a molecular spin basis, g are the 2-electron repulsion integrals in the molecular spin basis and nocc are the number of singly occupied spin-orbitals. The description of a particular diagram can be obtained from the .debug(diagram_number) method. The diagram number is the number it appears in the printed list of a tex-file for that order of diagram. This number can be obtained for a diagram from it's unique identifier tuple.

Diagrams can be plotted individually or as a group of the whole order (group is only available for order 4 and below).

from source.display import DISPLAY
DISPLAY(h, diagram=3, ident=True, file='outputs/diagram_33.png')

will display and save the diagram number 3 to the file 'outputs/diagram_33.png'. Having ident=True will print the up and down arrow schemes (this is only available for orders 2 and 3). An example of the group display is given for order 4 in the file 'outputs/mp4.png'.

The file script.py in root folder has a fully commented explaination of using the HUGENHOLTZ and DISPLAY classes.

Identifying Diagrams   A diagram of order n will have n nodes. The nodes are numbered from the bottom up - the lowest node will be 0 and the highest n-1. Connections occur between pairs of node, there will be $\frac{n(n-1)}{2}$ pairs of nodes. The pairs of nodes are generated in the order {(0,1), (0,2), ... ,(0,n-1), (1,2), (1,3), ... , (1,n-1), ...,(n-3,n-2) (n-3, n-1), (n-2,n-1)}. A diagram can then be specified uniquely by the number of up connections (particles) and the number of down (holes) between the node pairs. For the following diagram we have for up connections (0, 2, 0) and for down connection (2, 0, 2).

image

The number of the diagram in the order produced by HUGENHOLTZ is given by

n = h.ordinal([0,2,0], [2,0,2]))

and the details of the diagram are then found with

h,debug(n)

Acknowledgement The idea to do this and the basis of the main algorithm came from the paper 'AUTOMATIC GENERATION OF VACUUM AMPLITUDE MANY-BODY PERTURBATION SERIES' by P D Stevenson.

About

Diagrammatic Arbitrary-order Moller-Plesset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published