Skip to content

Commit

Permalink
tentatively think this is working
Browse files Browse the repository at this point in the history
  • Loading branch information
corinwagen committed Jul 12, 2020
1 parent db769e0 commit 0acaf5e
Show file tree
Hide file tree
Showing 6 changed files with 3,452 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cctk/parse_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def parse_modes(freq_block):

modes = list()
for f, m, k, d in zip(freqs, masses, force_ks, displacements):
k *= 143.836 # mdyne Å**-1 to kcal/mol Å**-2
modes.append(cctk.VibrationalMode(f, m, k, d))
k *= 143.9326 # mdyne Å**-1 to kcal/mol Å**-2
modes.append(cctk.VibrationalMode(frequency=f, reduced_mass=m, force_constant=k, displacements=d))

return modes
2 changes: 1 addition & 1 deletion cctk/quasiclassical.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def apply_vibration(molecule, mode, min_freq=50, temperature=298):

# here we could compute atom velocities if we wanted to! initializer lines 440-480

print(f"Mode {mode.frequency:.2f}\t QC Level {level}\t Shift {rel_shift:.2%} of a potential {max_shift:.2f} Å\tPE = {potential_energy:.2f} kcal/mol")
print(f"Mode {mode.frequency:.2f} ({mode.energy():.2f} kcal/mol)\t QC Level {level}\t Shift {rel_shift:.2%} of a potential {max_shift:.2f} Å\tPE = {potential_energy:.2f} kcal/mol\tk = {mode.force_constant:.2f} kcal/mol Å^-2")

return potential_energy, kinetic_energy

Expand Down
5 changes: 2 additions & 3 deletions cctk/vibrational_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ def quantum_distribution_value(self, x, level=0):
H = get_hermite_polynomial(n)

# following https://github.com/ekwan/Jprogdyn/blob/master/src/main/java/edu/harvard/chemistry/ekwan/Jprogdyn/HarmonicOscillatorDistribution.java, line 109

# 4 * pi * 3 * 10**10 / (1000 * 10**23 * 6.022 * 10**23 * 6.626 * 10^-34) = 9.448 * 10 ** -6, take it or leave it
omega_term = 9.448 * 10 ** -6 * self.reduced_mass * freq
# 4 * pi * 3 * 10**8 / (1000 * 10**20 * 6.022 * 10**23 * 6.626 * 10^-34) = 0.000094411, take it or leave it
omega_term = 9.4411e-5 * self.reduced_mass * freq
val = math.sqrt(omega_term) * math.exp(-1 * omega_term * math.pi * x ** 2 ) * (H(math.sqrt(omega_term * math.pi) * x) ** 2) / (2 ** n * math.factorial(n))
return val

Expand Down

0 comments on commit 0acaf5e

Please sign in to comment.