Output Molden normal modes file in Jupyter Notebook


I’m trying to compute and output the normal modes for methanol to the Molden normal modes, but I’m either misunderstanding the instructions or they aren’t working.

I run:

import psi4
psi4.core.set_output_file('output.dat', False)
ch3oh = psi4.geometry("""
O  1  1.0700
H  1  1.0700  2  109.47
H  1  1.0700  2  109.47  3  240.00
H  1  1.0700  2  109.47  3  120.00
H  2  0.9700  1  109.47  3  60.00

psi4.optimize('WB97X/6-311++G(d,p)', molecule=ch3oh)
scf_e, scf_wfn = psi4.frequency('WB97X/6-311++G(d,p)', molecule=ch3oh, return_wfn=True, normal_modes_write=True)

It runs, it calculates all 21 required displacements, but no output file is generated other than the output.dat which doesn’t contain the Molden-formatted normal modes? I’m not sure what I’m doing wrong.

I’m following (I thought) the instructions here: http://www.psicode.org/psi4manual/1.3.2/psiapi.html#III.-Geometry-Optimization-and-Vibrational-Frequency-Analysis

In future, please use triple backticks rather than > to format code.

I think the problem is with how you’re sending the argument. Does it work if you use set normal_modes_write true rather than sending it as an argument to the frequency function?

Why Psi4 wants you to do one rather than the other is a question I can get into, if that is indeed the issue.

That particular input throws a syntax error for me:

set normal_modes_write true

  File "<ipython-input-28-ce4355111289>", line 1
    set normal_modes_write true
SyntaxError: invalid syntax

Oh, the PsiAPI equivalent is psi4.set_options({"normal_modes_write": True}).

Ah! This worked perfectly - thanks!