Author Topic: Single electron transistor - No module named readTotalEnergy  (Read 4364 times)

0 Members and 1 Guest are viewing this topic.

Offline Rajib

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Country: gb
  • Reputation: 0
    • View Profile
    • Rajib Chowdhury
Dear ATK experts,

I was trying to some analysis as Single electron transistor. I followed the procedure step-by-step addressed in the tutorial (Benzene single electron transistor).

I am facing some problem in step: Total Energy as function of the gate potential. I am using the python scripts: readTotalEnergy.py and total_energy.py attached in the tutorial.

When I am running the total_energy.py, following errors are appeared:

+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 10.8.0                                                     |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "c:\users\rajib\appdata\local\temp\6386975997080308.py", line 3, in <module>
    from readTotalEnergy import readTotalEnergy
ImportError: No module named readTotalEnergy
NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+

Please anyone help me how to solve this issue.

Sincere regards,

Rajib

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Single electron transistor - No module named readTotalEnergy
« Reply #1 on: September 1, 2010, 16:35 »
This is a common mistake when running things via the Job Manager. The problem is that the Job Manager will execute the script in a temporary directory, but the script you are trying to import resides in some user directory. The simplest solution is to not use the Job Manager, but save the script you want to run in the same directory as where you have saved readTotalEnergy.py and run the job from the command line instead, by opening a terminal (easiest via the Start Menu>Programs>QuantumWise>Atomistix ToolKit 10.8.0>NLPython), "cd" into your script directory and run
Code
atkpython total_energy.py
Alternatively, you can add the path to the module in the script. If you open total_energy.py in an editor, and add the lines
Code
import sys
sys.path.append("c:/users/rajib/...")
then you can use the Job Manager. Here the "..." means you should put in the proper location of readTotalEnergy.py (the directory where it is saved). Note that Python needs "/" to separate directory, not "\" as usual on Windows. Another rather useful option is to place readTotalEnergy.py in a directory which is globally included in the Python path, namely the directory C:\Program Files (x86)\QuantumWise\atk-10.8.0\atkpython\lib\site-packages (or similar, depending on your precise installation directory).
« Last Edit: September 1, 2010, 16:37 by Anders Blom »

Offline Rajib

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Country: gb
  • Reputation: 0
    • View Profile
    • Rajib Chowdhury
Re: Single electron transistor - No module named readTotalEnergy
« Reply #2 on: September 1, 2010, 21:45 »
Dear Dr. Anders,

Many thanks for getting solved this issue. However, in the original script (readTotalEnergy.py) one line seems to be added: from NanoLanguage import* .

Rajib

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Single electron transistor - No module named readTotalEnergy
« Reply #3 on: September 1, 2010, 23:18 »
That line needs to be there, yes.