QuantumATK Forum
QuantumATK => General Questions and Answers => Topic started by: jjhskang on May 11, 2011, 14:11
-
Hi!
I am trying to calculate Mulliken charge of each atom in bulk configuration. For that, I first made a calculation with "atk_setup.py " attached. It generates a file "mulliken.nc". Next, I tried to print the Mulliken charge of each atom by running the file "mulliken.py".
However, it gives an error message:
---------------------------------------------------
Traceback (most recent call last):
File "mulliken.py", line 6, in <module>
mulliken_up = mulliken_pop.atoms(0)
AttributeError: 'list' object has no attribute 'atoms'
Traceback (most recent call last):
File "mulliken.py", line 6, in <module>
mulliken_up = mulliken_pop.atoms(0)
AttributeError: 'list' object has no attribute 'atoms'
----------------------------------------------------------------
Can you let me know what the problem is? Why does it say that there exist no attribute 'atoms'? What's wrong with this?
I am pretty new for ATK2011.02.
-
The "mulliken_pop" defined in your script file is just a list, not a object.
mulliken_pop = nlread(
'mulliken.nc',
MullikenPopulation
)
The following modification will give a object:
mp = nlread(
'mulliken.nc',
MullikenPopulation
)
mulliken_pop=mp[0]
Please refer to the use of "nlread():
http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.nlread.html
-
Absolutely correct. I just wanted to add that nlread always returns a list, even if there is only one matching object in the NC file. This is done so that the return type of the function nlread is well-defined (always a list), and not dependent on how you call the function or what the contents of the file is.