Author Topic: I_V curve (restore calculation)  (Read 8900 times)

0 Members and 1 Guest are viewing this topic.

Offline sunray55

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Reputation: 1
    • View Profile
I_V curve (restore calculation)
« on: June 7, 2009, 08:11 »
Hi,
based on the script of I-V curve calculations, I get the current from 0.0 to 0.3V. My question is how can I modify the script to continue the I-V curve calculation from 0.3V. That is to say, how to restore the lih2li_iv-0.3.nc as the initial input file to calculate the 0.4V and above since we do not want to recalcuate the cases of 0.0-0.3V.

many thanks

rgds,

raymond

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: I_V curve (restore calculation)
« Reply #1 on: June 7, 2009, 09:10 »
If you have a link for the script? then I am pretty sure that I am able to modified it for you :)

Offline sunray55

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Reputation: 1
    • View Profile
Re: I_V curve (restore calculation)
« Reply #2 on: June 9, 2009, 07:47 »
That's good. here is the link of I_Vcurve script (lih2hi_iv.py) wroten by Anders Blom. http://quantumwise.com/forum/index.php?topic=19.0
In his script, we calculate the I_V curve of lih2li from 0.0V to 0.3V and get four .nc file and one .vnl file.
My question is how can I continue this calculation to a high voltage (such as calculate 0.4V from restoring the 0.3V)
It is very useful since I have got lots of transmission calculations, ie, I have alreay gotten the initial charge density of 0.0 V. If I want to continue to calcuate I-V properties, I guess I'm no need to calculate the 0.0eV case again as wroten in Blom's script.
One more question, the calculation is converged in transmission spec calculations (0.0V). However, it is not converged in I-V curve calculations using the above script at 0.0V. may I know it is reasonble?

many thanks.

raymond

Offline sunray55

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Reputation: 1
    • View Profile
Re: I_V curve (restore calculation)
« Reply #3 on: June 9, 2009, 17:58 »
Dear Blom,
May I know do you have the script for calculate the GATE voltage sweep?  many thanks.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: I_V curve (restore calculation)
« Reply #4 on: June 10, 2009, 10:01 »
About the bias voltage sweep, it's really simple: just change the line
Code
voltages=[0.0,0.1,0.2,0.3]*Volt
to include the voltages you want, e.g.
Code
voltages=[0.0,0.1,0.2,0.3,0.4,0.5,0.6]*Volt
or whatever! :) The functionality delivered with the script ivcurve.py is not really intended as a full fledged one-stop solution, but rather as a template, to show how it can be done. So, for instance, if you have already converged zero bias calculations, and you want to avoid re-running the 0.0 V case and restart at 0.1 V, you should modify that script (slightly). I'm sorry, I didn't actually understand the second question in that post...

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: I_V curve (restore calculation)
« Reply #5 on: June 10, 2009, 10:50 »
Ok, I modifed the ivcurve.py script ever so slightly to add the functionality to initialize the first calculation from an existing checkpoint file. The script is attached. The only change is a new keyword to runIVcurve called initialize_from, which should be an scf object that the first calculation will be initialized from. So, if I have an existing converged zero bias calculation in a file called "zerobias.nc", I would use the NEW ivcurve.py this way:
Code
import ivcurve
    
voltages=[0.1,0.2,0.3]*Volt
zerobias_scf = restoreSelfConsistentCalculation("zerobias.nc")

ivcurve.runIVcurve (
    twoprobe_configuration, 
    two_probe_method, 
    runtime_parameters,
    voltages, 
    vnl_filename='myfile.vnl', sample_name='mysample', 
    current_k_point_sampling = (1,1),
    current_number_of_points = 100,
    initialize_from = zerobias_scf
  )

iv = ivcurve.extractIVcurveFromVNLFile('myfile.vnl','mysample')

ivcurve.plotIVCurve(iv,'iv.png')
Note that this is not a complete script; you should add it to whatever script defines the two_probe_method and twoprobe_configuration (just noticed the asymmetry of those variable names! but that's how VNL does it...). Actually, this version of the script allows for perhaps an even nicer way to take advantage of the VNL generated scripts...! Instead of the above, where you should remove the executeSelfConsistentCalculation() statement from the VNL-generated script, we can let VNL set up the zero bias calculation, and use that. So, we would keep the VNL-generated script intact (don't add any analysis options to it!), and just append these lines to the end:
Code
import ivcurve
    
voltages=[0.1,0.2,0.3]*Volt

# Insert zero-bias current into VNL file
vnl_filename='myfile.vnl'
sample_name='mysample'
if processIsMaster():
    f = VNLFile(vnl_filename)
    f.addToSample(0.*Ampere,sample_name,'Current at 0.0 V bias')

ivcurve.runIVcurve (
    twoprobe_configuration, 
    two_probe_method, 
    runtime_parameters,
    voltages, 
    vnl_filename=vnl_filename, sample_name=sample_name, 
    current_k_point_sampling = (1,1),
    current_number_of_points = 100,
    initialize_from = scf
  )

iv = ivcurve.extractIVcurveFromVNLFile('myfile.vnl','mysample')

ivcurve.plotIVCurve(iv,'iv.png')
Don't forget to change the filenames, k-points, etc to fit your specific system. Note the insertion of the zero-bias current into the VNL file, otherwise we don't get a current calculation for zero bias! There are end-less variations to scripts like this, which is the power of NanoLanguage, although it does require a bit of programming knowledge to take advantage of it.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: I_V curve (restore calculation)
« Reply #6 on: June 10, 2009, 11:06 »
Setting up the gated voltage sweep requires some careful considerations about defining the surface atoms. See the manual for more details. Once that is done, you can wrap the self-consistent calculation in a loop over voltages:
Code
surface_atoms = (0,0)
current_k_point_sampling = (4,4)
current_number_of_points = 200

print 'Gate voltage (V)\tCurrent (A)'
print '---------------------'
for voltage in [0.0,0.2,0.4]:
    gated_method = GatedTwoProbeMethod(
        two_probe_method = two_probe_method,
        gate_voltage = voltage*Volt,
        surface_atoms = surface_atoms
    )
    scf = executeSelfConsistentCalculation(
        twoprobe_configuration,
        method = gated_method
    )
    current = calculateCurrent(
        scf, 
        brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(current_k_point_sampling),
        number_of_points = current_number_of_points
    )
    print voltage,'\t\t',current.inUnitsOf(Ampere)
The two_probe_method and twoprobe_configuration should be defined earlier in the script (append the code above to your VNL-generated script and it should be fine; just remove the executeSelfConsistentCalculation() part). Don't forget to change the variables current_k_point_sampling and current_number_of_points to fit your system!

Offline sunray55

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Reputation: 1
    • View Profile
Re: I_V curve (restore calculation)
« Reply #7 on: June 11, 2009, 04:15 »
Dear Bolm, Many many thanks for your help.
May I know whether we should use the ivcurve.py (original version) for calculations of gate voltage sweep?
If yes, I think I can modify the script to do restore initial claculation of gate voltage sweep. ;D

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: I_V curve (restore calculation)
« Reply #8 on: June 11, 2009, 09:37 »
The original script works fine, it just assumes that you will also run the first bias point instead of restoring from an existing calculation. However, the new script is more general, and also allows for this case by just excluding the parameter "initialize_from" when you call runIVcurve. So, you might as well just stick to the new version.

However, you will probably not want to scan the two voltages at the same time. Better stick to a particular bias, and scan the gate, or opposite.