Author Topic: current calculation in a loop  (Read 2659 times)

0 Members and 1 Guest are viewing this topic.

Offline Sabyasachi Sen

  • Heavy QuantumATK user
  • ***
  • Posts: 52
  • Country: in
  • Reputation: 0
    • View Profile
current calculation in a loop
« on: December 1, 2012, 20:13 »
I am facing problems in estimating iv curve for certain values of applied by ruining the calculation over a loop. In the script I added following lines at the end of zero bias calculation but the program does not run at a loop.

The program does not run at all kindly hep me in sorting out this problem.

The script is
# -------------------------------------------------------------
# Transmission spectrum
# -------------------------------------------------------------
def transmission(configuration):
    # Calculate the transmission spectrum and save it in a file
    transmission_spectrum = TransmissionSpectrum(
        configuration=device_configuration,
        energies=numpy.linspace(-3,3,50)*eV,
    )
    nlsave('/home/swapanchem/Desktop/lih2-loop/li-h2_iv.nc', transmission_spectrum)

# Read in the converged zero-bias calculation
device_configuration = nlread('/home/swapanchem/Desktop/lih2-loop/lih2-loop1.nc', device_configuration)[0]
calculator = device_configuration.calculator()
   
# Calculate and save the transmission spectrum for zero bias
transmission(device_configuration)

# Define the bias voltages for the I-V curve
voltage_list=[0.5,1.0]*Volt

# Loop over the bias voltages
for voltage in voltage_list:
    # Set electrode voltages and use the self-consistent state
    # of the previous calculation as starting guess
    device_configuration.setCalculator(
          calculator(electrode_voltages=(voltage, 0.0)),
          initial_state=device_configuration)

    # Calculate and save the transmission spectrum for each bias
    transmission(device_configuration)


.   

Offline kstokbro

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 392
  • Reputation: 13
    • View Profile
    • QuantumWise
Re: current calculation in a loop
« Reply #1 on: December 2, 2012, 21:43 »
you must specify the electrode voltages with a unit, i.e
electrode_voltages = (voltage, 0*Volt),

You will get an error message detailing this when you run your script,
the error message is sent to stderr, make sure that you read these messages