Author Topic: single electron transistor: setting an array element with a sequenc  (Read 6830 times)

0 Members and 1 Guest are viewing this topic.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
The error is to be expected (sort of), it's just because we return something wrong. The important thing is the output from the print statement. I had hoped to see it for all 5 NC files, however, and because of the error we only got it for the first one.

That's partly enough, however, because we can clearly see some problem here, I think. This file (presumably benzene_set-2.nc) contains only 3 TotalEnergy objects, instead of one for each gate voltage as it should. And the object_id is also wrong for 2 of them; only the -8 is correct. There are however potentials for all gate voltages...

Somehow the script gatescan0.py (or similar for -2 charge state etc) have not been run correctly. If you attach gatescan-2.py perhaps I can spot the error.

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
here is the copy of gatescan-2.py

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Exactly as I suspected - the indentation is wrong. This is not the file you get if you download gatescan0.py from the tutorial HTML pages (and then change to -2 for the charge state). The difference is the last 5 lines should be indented one step (by 4 spaces). Without that indentation, those lines are only executed once, when the for-loop has finished (i.e. for the last gate voltage only, -8 V).

« Last Edit: July 13, 2012, 19:11 by Anders Blom »

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
ok. I will rerun all the scripts from gatescan0.py onwards by providing the 4 spaces to last 5 lines. I will report if any problem.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
You need to remove those special lines in readTotalEnergy.py which we inserted ;)

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
Anders sir,
yes it worked for the total energy vs gate voltage script. i got the plot.
But in charge stability diagram script the same previous error is coming."ValueError: setting an array element with a sequence."

please suggest me...


+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
[array([-8., -6., -4., -2.,  0.,  0.,  2.,  4.,  6.,  8.]), array([-8., -6., -4., -2.,  0.,  0.,  0.,  2.,  4.,  6.,  8.]), array([-8., -6., -4., -2.,  0.,  2.,  4.,  6.,  8.]), array([-8., -6., -4., -2.,  0.,  0.,  2.,  4.,  6.,  8.]), array([-8., -6., -4., -2.,  0.,  2.,  4.,  6.,  8.])]
Traceback (most recent call last):
  File "c:\users\bhushan\appdata\local\temp\4304438298526839.py", line 25, in <module>
    voltage_list = numpy.array(voltage_list)
ValueError: setting an array element with a sequence.
NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+
 

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
here is the code for charge stability diagram. this is the last script in Benzene SET manual.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
I was half expecting this... It is caused by the fact that in some of the NC files you have 1 or 2 (but different amount in the different files!) TotalEnergy objects without the proper object id. As I understand it, these are the values for zero gate voltage. It's a weakness of the scripts in the tutorial, in a sense, but basically it's just not designed to be run twice.

Since it's a bit hard to delete stuff in a NetCDF file (it's possible only by copying the file to a new one, and including only what you want), the solution will have to be to somehow ignore the extra data...

Try the attached version instead. Since I don't have test data, I can't verify it myself.

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
Yes , Anders the code you posted worked.i got the plot. manual practice is completed. now i will go onto my ideas.
Thank you very very very much.
thank you again Anders sir.

Regards..
Bhushan