QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: yogita taluja on October 1, 2015, 11:18

Title: magnetic moment
Post by: yogita taluja on October 1, 2015, 11:18
hello.. i m tried to find out magnetic moment of my defective graphene sheet but can't  due to error

"""  Traceback (most recent call last):
  File "c:\users\combo\appdata\local\temp\3484328881580631.py", line 20, in <module>
    density_up = electron_density.spinProjection(Spin.Up)
AttributeError: 'ElectronDensity' object has no attribute 'spinProjection'  "
 Kindly suggest me a way to tackle this problem. 


 
Title: Re: magnetic moment
Post by: Jess Wellendorff on October 1, 2015, 13:26
Looks curious. Which version of ATK are you running? Can you upload the python script?
Title: Re: magnetic moment
Post by: yogita taluja on October 1, 2015, 17:32
Jess Wellendorff sir , This is my  python script.
Title: Re: magnetic moment
Post by: zh on October 2, 2015, 01:36
The script you have uploaded is insufficient.  The script used for the calculation of electron density (i.e., the generation of 'nickellsda.nc' file) is also needed.

In my test run for your script and a test calculation ( Atomistix ToolKit 2014.3) of LSDA, your script can extract the magnetic moment smoothly. 
Title: Re: magnetic moment
Post by: yogita taluja on October 2, 2015, 17:59
sir,  my python file as per said....
Title: Re: magnetic moment
Post by: zh on October 3, 2015, 09:48
Your second python file isn't useful for debugging your problem because it only gives the information of bulk configuration. Please upload your whole script files. The important is the setup of calculations method. What kind of exchange_correlation has been defined in the python script for the generation of  'nickellsda.nc' file?
Title: Re: magnetic moment
Post by: yogita taluja on October 3, 2015, 13:39
sir , when i save my file in py format only new calculator setting saved .
i also done some changes  like  optical spectrum  k point sampling to 1*5*5 and   dos  k point 1*5*5.
plz tell me if any other information  require.
Title: Re: magnetic moment
Post by: zh on October 5, 2015, 11:26
The problem comes from the 124th line in your "nickellsda.py" file.  Your should comment or remove it.  Otherwise, it will not perform  the calculation of electron density for your system and save it. 
....
122 electron_density = ElectronDensity(
123     configuration=bulk_configuration,
124     spin=Spin.Sum,
125     )
.......
Title: Re: magnetic moment
Post by: Anders Blom on October 5, 2015, 11:42
Well spotted, zh!

To be precise, with line 124 included, ATK will perform and save the density, but only the sum, thus you cannot later ask for the spin components.