`Vibrations` module should respect `FixAtoms`
Checklist
-
The issue remains in the development version of ASE. -
An minimal example is provided to reproduce the issue.
Summary
The Vibrations
module should, by default, respect constraints on the Atoms
object. Specifically, if there are FixAtoms
constraints applied on certain atoms, they should not be vibrated in the Vibrations
run (unless specified by indices
). Currently, they are all vibrated regardless. It becomes a bit hairy though if we want to think about other constraints that fix atoms with respect to one another...
If we don't want the proposed behavior, then we should at the very least raise a warning to the user.
from ase import Atoms
from ase.calculators.emt import EMT
from ase.optimize import BFGS
from ase.vibrations import Vibrations
from ase.constraints import FixAtoms
n2 = Atoms("N2", [(0, 0, 0), (0, 0, 1.1)], calculator=EMT())
n2.set_constraint(FixAtoms(indices=[0,1]))
vib = Vibrations(n2)
vib.run()
vib.summary()
Currently prints:
---------------------
# meV cm^-1
---------------------
0 0.0 0.0
1 0.0 0.0
2 0.0 0.0
3 1.4 11.5
4 1.4 11.5
5 152.7 1231.3
---------------------
Zero-point energy: 0.078 eV
Edited by Andrew Rosen