Author Topic: Error in Nanolanguage in writing Mulliken charge  (Read 2594 times)

0 Members and 1 Guest are viewing this topic.

Offline jjhskang

  • Heavy QuantumATK user
  • ***
  • Posts: 54
  • Reputation: 0
    • View Profile
Error in Nanolanguage in writing Mulliken charge
« 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.


Offline zh

  • QuantumATK Support
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Error in Nanolanguage in writing Mulliken charge
« Reply #1 on: May 12, 2011, 13:49 »
The "mulliken_pop" defined in your script file is just a list, not a object.
Quote
mulliken_pop = nlread(
   'mulliken.nc',
   MullikenPopulation
   )

The following modification will give a object:
Quote
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

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Error in Nanolanguage in writing Mulliken charge
« Reply #2 on: May 12, 2011, 14:21 »
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.