Work has officially begun on CDA. I've started by creating the
FragmentAnalysis class, which converts the mocoeffs of a molecule
from the atomic orbital basis to a fragment molecular orbital basis.
This is the first step in the CDA methodology.
Currently, my implementation is as follows:
The FragmentAnalysis class takes the parser of the entire molecule
(as well as the usual optional stuff). It implements that calculate()
function, which expects a list of parsers corresponding to the
fragments which are being analyzed. In both __init__() and calculate
(), the parsers are supposed to have already called parsed() although
this requirement can be removed with some simple checking. After
calculate() finishes, there is an mocoeffs attribute which follows
the same format as the parsers ([spin][mo index][basis index]).
Additionally, various other attributes are created from the molecular
parser so that the c-squared population analysis method can be used.
For example:
----
mol = ccopen(filename)
mol.parse()
frag1 = ccopen(filename2)
frag1.parse()
frag2 = ccopen(filename3)
frag2.parse()
fraganalysis = FragmentAnalysis(mol)
fraganalysis.calculate([frag1,frag2])
cspa = CSPA(fraganalysis)
cspa.calculate()
---
Finally, the fonames is created during FragmentAnalysis.calculate()
function based on a name (if available, created by frag1.names =
"Fragment 1") and the fragment molecular orbital index.
There's also no reason it can't use more than two fragments, but I
haven't tested it. I also haven't tested more than (BH3)(CO).
Things to finish:
Convert aooverlaps to the molecular basis
Implement the actual CDA electron counting stuff
Handle unrestricted molecules with restricted fragments
Insert progress info and try to optimize code if necessary
I'm going home for the holidays tomorrow, but I'll try to get to this
stuff in the coming weeks.
Adam
|