[ase-users] [EXTERNAL] Constraints using Espresso

Hermes, Eric ehermes at sandia.gov
Wed Feb 19 17:04:23 CET 2020


On Tuesday, February 18, 2020 6:37:35 PM PST Christoph Wolf via ase-users 
wrote:
> Dear all,
> 
> I wonder if there is an easy way to get constraints in ASE using the
> Espresso calculator (ase.calculators.espresso import Espresso)?
> 
> I have a atoms object called RC that contains 3 silver atoms which I want
> to freeze.
> 
> constraints = FixAtoms(indices=[atom.index for atom in RC if atom.symbol ==
> 'Ag'])
> print("found %s instances to freeze" %(np.array2string(constraints.index)))
> 
> tells me that
> 
> found [0 1 2] instances to freeze
> 
> indeed all 3 atoms are frozen but writing the PWSCF input does not append
> the "0 0 0" to the atomic coordinates necessary
> 
> Ag 1.0000000000 7.5000000000 7.5000000000
> Ag 3.0000000000 7.5000000000 7.5000000000
> Ag 5.0000000000 7.5000000000 7.5000000000
> 
> (Quantum Espresso defaults to "1 1 1", i.e. all atoms movable).
> 
> ase --version
> ase-3.19.0
> 
> Best,
> Chris

Chris,

Can you share a minimal script that reproduces this issue? I believe the 
Espresso calculator should correctly translate FixAtoms Constraints on the 
Atoms object to the QE input file. (There is also a potentially better approach 
to what you are trying which involves SocketIOCalculator, but let's see the 
script first.)

Regards,
-- 
Eric Hermes
Postdoctoral Researcher
Sandia National Laboratories


More information about the ase-users mailing list