QuantumATK Forum

QuantumATK => Scripts, Tutorials and Applications => Topic started by: hasanahmad on January 8, 2012, 21:34

Title: I-V curve tutorial problem
Post by: hasanahmad on January 8, 2012, 21:34
I am using the mini-tutorial for I-V curve
http://www.quantumwise.com/publications/tutorials/mini-tutorials/98-i-v-curve-and-voltage-drop#appendix

and have downloaded the 'lih2li_iv_scf.nc' file and using the 'lih2li_iv_analysis.py' file to run it, and I am getting the error:

Traceback (most recent call last):
  File "c:\users\hasan~1\appdata\local\temp\1399686007874424.py", line 14, in <module>
    calculator = configuration.calculator() 
AttributeError: 'list' object has no attribute 'calculator'


I have even tried with the absolute path-name of the files.

What could possibly have gone wrong?
Title: Re: I-V curve tutorial problem
Post by: Anders Blom on January 9, 2012, 00:38
Apologies, a small typo in the script, which was updated recently, caused this. Try again - should be fine now.
 
When downloading the script again, make sure you don't get a local cached version. The mistake was on line 8, which should have been

Code: python
configurations = [configurations[j] for j in numpy.argsort(biases)]
Title: Re: I-V curve tutorial problem
Post by: hasanahmad on January 9, 2012, 03:08
Thank you. It solved the problem.
Title: Re: I-V curve tutorial problem
Post by: dhurba on January 9, 2012, 06:07
I am getting this Error after the above step . ...Is it not possible with EHT ?

+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.8.0 [Build 308f600]                                     |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "/tmp/1360052463028704.py", line 18, in <module>
    zero_bias_potential = EffectivePotential(configuration)
  File "./zipdir/NL/Analysis/EffectivePotential.py", line 37, in __init__
  File "./zipdir/NL/Analysis/Analysis.py", line 74, in __init__
  File "./zipdir/NL/Analysis/Analysis.py", line 66, in _supportConfigurationWithCalculator
  File "./zipdir/NL/Analysis/Analysis.py", line 52, in _supportCalculator
NL.ComputerScienceUtilities.Exceptions.NLTypeError: The DeviceHuckelCalculator does not support calculation of EffectivePotential.
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+
Title: Re: I-V curve tutorial problem
Post by: Anders Blom on January 9, 2012, 14:50
For Huckel you can use the ElectrostaticDifferencePotential instead, this is perhaps an even better choice, in fact, also for DFT (although the qualitative picture tends to be very similar for EffectivePotential).
Title: Re: I-V curve tutorial problem
Post by: dhurba on January 30, 2012, 06:30
For Huckel you can use the ElectrostaticDifferencePotential instead, this is perhaps an even better choice, in fact, also for DFT (although the qualitative picture tends to be very similar for EffectivePotential).


So i should add TransmissonSpectrum Also when adding ElectrostaticDifferencePotential in the script generator  ?

What is the meaning of the line "  calculator(electrode_voltages=(0.5*bias,-0.5*bias)), " ?

Title: Re: I-V curve tutorial problem
Post by: Anders Blom on January 30, 2012, 10:58
1) If you want to calculate it, yes.

2) This sets the bias.

Title: Re: I-V curve tutorial problem
Post by: baizq on May 7, 2012, 12:34
Apologies, a small typo in the script, which was updated recently, caused this. Try again - should be fine now.
 
When downloading the script again, make sure you don't get a local cached version. The mistake was on line 8, which should have been

Code: python
configurations = [configurations[j] for j in numpy.argsort(biases)]


Yes, I have also encountered the same error and this modification solves the problem. Why not changing the iv-curve and voltage-drop tutorial as well...

Besides...just for kidding, why my account level drops from heavy ATK user to regular ATK user...
Title: Re: I-V curve tutorial problem
Post by: Anders Blom on May 7, 2012, 15:47
Yes of course - I was certain I did already...? But now it is fixed, for sure!

Edit: Ah, I had changed it in the downloadable script, but not on the page. The danger of having the same source in two places...

Sorry for dropping your rating, we adjusted the levels a bit to better reflect the intensity with which people interact with the Forum. In the beginning we were a bit generous with how many posts you needed to get a higher status, but then we got a top-heavy distribution of profiles.
Title: Re: I-V curve tutorial problem
Post by: baizq on May 8, 2012, 04:51
And there might still be some mistakes within the script if we divided the previously converged scf run for each voltage into separate .nc files.

I have substituted the first 6 lines in the script with
Code
# Define input and output NetCDF files here   
scf_filename = "CMS-Ag-p_scf_%g.nc.nc"
analysis_filename = "CMS-Ag-p_analysis.nc"   
 
biases = [0, 0.1, 0.2, 0.3]
# Read configurations from NetCDF files
configurations = []
for bias in biases:
     configurations.append(nlread(scf_filename % bias, DeviceConfiguration)[0])

And the program still returns error message when the running nearly ends.

Code
Traceback (most recent call last):
  File "iv-voltage_drop.py", line 48, in <module>
    geometry = nlread(scf_filename, DeviceConfiguration, read_state = False)[0] 
  File "./zipdir/NL/IO/NLSaveUtilities.py", line 244, in nlread
NL.ComputerScienceUtilities.Exceptions.NLValueError: The filename, CMS-Ag-p_scf_%g.nc, was not found - please check correct path and name.

The error might comes from the fact that the nlread command has not been incorporated into the loop over %g... so it seems not sufficient to only subsitute the first six lines...then how should we modify the script...
Title: Re: I-V curve tutorial problem
Post by: Anders Blom on May 8, 2012, 05:16
Yes, I see. You should also modify line 45 in the original script to be

Code
geometry = nlread(scf_filename % 0, DeviceConfiguration, read_state = False)[0] 

(Do you mean to have .nc.nc in the scf_filename?)