[ase-users] Getting magnetic moments from vasp

Kondov, Ivan (SCC) ivan.kondov at kit.edu
Mon May 22 15:52:43 CEST 2017


Hello,

I just tried to reproduce with this short script:

from ase.calculators.vasp import Vasp
from ase.build.surface import fcc111
calc = Vasp(prec='Normal', xc='PBE', lreal=False, kpts=(3,3,1), algo='Fast', 
nelm=120)
slab = fcc111('Ni', size=(1, 1, 3), vacuum=10.0)
slab.set_initial_magnetic_moments([1.]*len(slab))
slab.set_calculator(calc)
print(slab.get_magnetic_moment())

It does not complain and prints the magmom on the screen. The method 
calc.get_property('magmom', slab) also instantly updates and returns the 
magmom. Quite notable from your error output below is that you do not use an 
instance of the Vasp calculator but one derived 
from ->SinglePointCalculator->Calculator classes (in singlepoint and 
calculator modules). They are actually not used by the Vasp calculator. 
Probably your calc object was (incompletely) constructed or read from a 
database?

Best regards,
Ivan


From: ase-users-bounces at listserv.fysik.dtu.dk 
[mailto:ase-users-bounces at listserv.fysik.dtu.dk] On Behalf Of Protik Das via 
ase-users
Sent: Monday, May 22, 2017 9:10 AM
To: ase-users at listserv.fysik.dtu.dk
Subject: [ase-users] Getting magnetic moments from vasp

Hi,
I am running a spin polarized calculation using vasp as a calculator. But it 
seems the atoms object is not updated with the magnetic moments from the 
calculator when the calculation is done. I am getting the following error when 
I try to get the magnetic moments from the atoms or the calculator object.

  File 
"/home/protik/anaconda3/envs/ase/lib/python3.6/site-packages/ase/calculators/calculator.py", 
line 441, in get_magnetic_moment
    return self.get_property('magmom', atoms)
  File 
"/home/protik/anaconda3/envs/ase/lib/python3.6/site-packages/ase/calculators/singlepoint.py", 
line 34, in get_property
    'The property "{0}" is not available.'.format(name))
ase.calculators.calculator.PropertyNotImplementedError: The property "magmom" 
is not available.

Is there a way to update the magnetic moments of the elements from the 
calculation? I am using ase 3.13.0.
Thanks.
-- 
Protik Das,
ECE Graduate Student,
LATTE (http://latte.ece.ucr.edu),
University of California, Riverside.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6317 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170522/4652e5b7/attachment.p7s>


More information about the ase-users mailing list