Using Phonons.run after single-point calculation in Quantum Espresso - PropertyNotImplemented Error

I have performed a ‘relax’ calculation of a periodic slab model in Quantum Espresso and have imported the final structure into an ase.Atoms object with an automatically attached Espresso calculator.

I am trying to use the finite displacement method to get ZPE and entropy corrections. However, when I try to generate the phonon DOS using the Phonons module, I get this error:

“ase.calculators.calculator.PropertyNotImplementedError: The property “forces” is not available.”

Is there something I need to do to get the forces? As far as I know, the Atoms.calc generated by read_espresso_out has forces, and I get a list when I print(Atoms.calc.get_forces()). Please let me know how I can fix this issue.

You may need to explicitly tell Espresso to calculate the forces; by default it does not! Copying an Espresso example from a recent ASE tutorial:

pseudo_dir = Path.home() / 'SSSP-1.2.1_PBE_efficiency'

calc = Espresso(profile=profile,
                pseudo_dir=pseudo_dir,
                kpts=(3, 3, 3),
                input_data={'control':  {'tprnfor': True,
                                         'tstress': True},
                            'system': {'ecutwfc': 50.}},
                pseudopotentials={'Si': 'Si.pbe-n-rrkjus_psl.1.0.0.UPF'})

I think you need the “tprnfor” argument.