Request for gaussian-out to read Hirshfeld charges
The gaussian-out format doesn't read the Hirshfeld charges obtained from the Gaussian Pop=Hirshfeld keyword.
An example from the .log file:
Hirshfeld charges, spin densities, dipoles, and CM5 charges using IRadAn= 4:
Q-H S-H Dx Dy Dz Q-CM5
1 C -0.094024 0.000000 -0.000001 0.131271 0.000000 -0.198750
2 C -0.094023 0.000000 -0.000004 -0.131257 0.000000 -0.198745
3 H 0.047022 0.000000 0.141938 0.084576 0.000000 0.099382
4 H 0.047014 0.000000 -0.141951 0.084563 0.000000 0.099381
5 H 0.047018 0.000000 -0.141936 -0.084576 0.000000 0.099378
6 H 0.047016 0.000000 0.141935 -0.084576 0.000000 0.099376
Tot 0.000022 0.000000 -0.000018 0.000002 0.000000 0.000022
Hirshfeld charges with hydrogens summed into heavy atoms:
This could be done with something like this in the gaussian-out
function:
elif line.startswith('Hirshfeld charges, spin densities'):
# header
fd.readline()
# initialize variables
charges = []
# read charges
while True:
match = re.match(' +\d +[A-Z][a-z]? +(-?\d+\.\d+)', fd.readline())
if match is None:
break
charges.append(match.group(1))
# TODO: multiply charges by unit?
charges = np.array(charges, dtype=float)
But I don't know how to add this information to the atoms object.
Edited by Oscar X Guerrero