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
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
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.