[ase-users] Getting magnetic moments from vasp
Protik Das
protik77 at gmail.com
Mon May 22 23:44:16 CEST 2017
No really. I am constructing the calculaor object on the fly.
Your script works for me too. It prints out the final total magnetic
moment. But I need the final magnetic moment of the individual atoms. I
tried to do that by using the following 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, ibrion=-1, nsw=0, lorbit=0)
slab = fcc111('Ni', size=(1, 1, 1), vacuum=10.0)
slab.set_initial_magnetic_moments([1.]*len(slab))
slab.set_calculator(calc)
slab.get_potential_energy()
print(slab.get_magnetic_moment())
print(slab.get_magnetic_moments())
It only printed out 'None'. It seems the atoms object does not update the
initial magnetic moments. Any idea about how I can get the final magnetic
moments?
Thanks.
On Mon, May 22, 2017 at 6:55 AM Kondov, Ivan (SCC) via ase-users <
ase-users at listserv.fysik.dtu.dk> wrote:
> 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.
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
--
Protik Das,
ECE Graduate Student,
LATTE (http://latte.ece.ucr.edu),
University of California, Riverside.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170522/8da4b704/attachment-0001.html>
More information about the ase-users
mailing list