Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spin Polarized charge densities #46

Open
prtkm opened this issue Apr 28, 2015 · 1 comment
Open

Spin Polarized charge densities #46

prtkm opened this issue Apr 28, 2015 · 1 comment

Comments

@prtkm
Copy link
Contributor

prtkm commented Apr 28, 2015

Hi John,

What is the role of spin=0 in get_charge_density? https://github.com/jkitchin/jasp/blob/master/jasp/volumetric_data.py#L45

If I call calc.get_charge_density(spin=1) for a spin polarized calculation, I get

Traceback (most recent call last):
File "", line 9, in
File "/afs/crc.nd.edu/user/p/pmehta1/jasp/jasp/volumetric_data.py", line 57, in get_charge_density
return x, y, z, data[spin]
IndexError: index 1 is out of bounds for axis 0 with size 1

I think the charge density is the spin up + spin down density (atleast according the the CHGCAR documentation).

"For spinpolarized calculations, two sets of data can be found in the CHGCAR file. The first set contains the total charge density (spin up plus spin down), the second one the magnetization density (spin up minus spin down). For non collinear calculations the CHGCAR file contains the total charge density and the magnetisation density in the x, y and z direction in this order."

There is a self.chgdiff in VaspChargeDensity, that stores the difference between spin-up and spin-down charge densities. https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/calculators/vasp.py#L1475

@jkitchin
Copy link
Owner

once upon a time in Dacapo you could get the spin up and down densities this way. I guess it doesn't work that way in VASP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants