Author Topic: import ATK commnad  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

Offline zzhang

  • Regular QuantumATK user
  • **
  • Posts: 11
  • Reputation: 0
    • View Profile
import ATK commnad
« on: July 25, 2011, 05:45 »
I got the following error and the first few lines of the py script is as follows. How do I define the path correctly so that atk finds the ATK module?

Thanks,
Zhiyong

import ATK
from ATK.KohnSham import *

# Define the unit cell
unit_cell = [
        [ 8.6514     ,   0.,  0.        ],
        [ 4.3257     ,   7.4922,   0.        ],
        [  0.        ,   0.        ,  59.39]
              ]*Angstrom

elementList = []
coordinatesList = []

+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.1 [Build 3053]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "xyztovnl.py", line 1, in <module>
    import ATK
ImportError: No module named ATK

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5420
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: import ATK commnad
« Reply #1 on: July 25, 2011, 11:52 »
Good news is you don't need to import any modules in ATK 11.2. Bad news is that the changes made in going from 2008.10 to 11.2 (10.8 originally) mean most old scripts will require some minor changes (in some cases major changes) in order to function with the new Python interface. Moreover, on the positive side, you can import XYZ files directly in ATK:
Code: python
config = nlread('file.xyz')[0]
will make "config" a molecule with the relevant elements and coordinates, which can then be further manipulated (you can just extract the coordinates and elements using the methods "config.cartesianCoordinates()" and "config.elements()").
« Last Edit: July 25, 2011, 11:54 by Anders Blom »