Author Topic: Question of inital state in IVCharacteristics object  (Read 248 times)

0 Members and 1 Guest are viewing this topic.

Offline rebacoo

  • New ATK user
  • *
  • Posts: 4
  • Reputation: 0
    • View Profile
Question of inital state in IVCharacteristics object
« on: October 5, 2022, 14:57 »
Dear QuantumATK staff:
      i want to calculate the IV of MoS2 FET device using IVCharacteristics object. however, the FET is hard to converge at certain gate voltage. So, i want to  use the initial state object to provide a better starting guess. For example, the FET is converged in 0.1V gate voltage, i want to use the initial state of 0.1V gate to calculate 0.5V gate voltage. However, the script doesn't seem to work.
Here is the script (the corresponding parameters are omiteed. PS:  ATK version is QuantumATK2022 ), :
**************************
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Two-probe Configuration
# -------------------------------------------------------------
# -------------------------------------------------------------
# Left Electrode
# -------------------------------------------------------------
...
# -------------------------------------------------------------
# Right Electrode
# -------------------------------------------------------------
....
# -------------------------------------------------------------
# Central Region
# -------------------------------------------------------------
....
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
.....
#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
....
#----------------------------------------
# Poisson Solver Settings
#----------------------------------------
......
#----------------------------------------
# Contour Integral Settings
#----------------------------------------
.....
#----------------------------------------
# Electrode Calculators
#----------------------------------------
......
#----------------------------------------
# Device Calculator
#----------------------------------------
......
# -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
old_calculation = nlread('Device_MoS2-gate0.1.hdf5', DeviceConfiguration)[0]

device_configuration.setCalculator(
    calculator,
    initial_state=old_calculation,
   )

# -------------------------------------------------------------
# IV Characteristics
# -------------------------------------------------------------

# Gate-source voltages
gate_source_voltages = numpy.linspace(0.5, 0.5, 1)*Volt

# Drain-source voltages
drain_source_voltages = numpy.linspace(0.65, 0.65, 1)*Volt

# File name
filename = 'Device_MoS2-gate.hdf5'

iv_characteristics = IVCharacteristics(
    configuration=device_configuration,
    filename=filename,
    object_id='Device_MoS2-gate_IV_',
    gate_regions=[0, 1],
    gate_source_voltages=gate_source_voltages,
    drain_source_voltages=drain_source_voltages,
    energies=numpy.linspace(-2, 2, 401)*eV,
    kpoints=kpoint_grid,
    self_energy_calculator=RecursionSelfEnergy(),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    log_filename_prefix='Device_MoS2-gate_IV_',
    number_of_processes_per_task=None,
    enforce_zero_transmission_in_band_gap=False,
    source_electrode=Left
)
iv_characteristics.update()
**********************************************************
Is there something wrong with this script? how to modify?  is there any other plan?  Thank you

Offline Anders Blom

  • QuantumATK Staff
  • Supreme ATK Wizard
  • *****
  • Posts: 5126
  • Country: dk
  • Reputation: 85
    • View Profile
    • QuantumATK at Synopsys
Re: Question of inital state in IVCharacteristics object
« Reply #1 on: October 19, 2022, 03:05 »
Well, you are not really looping over any parameters, so you will not get any I-V curve. These statements make no real sense, unless you really mean to only compute the structure at 1 value for Vg and Vsd.
gate_source_voltages = numpy.linspace(0.5, 0.5, 1)*Volt
drain_source_voltages = numpy.linspace(0.65, 0.65, 1)*Volt


Offline rebacoo

  • New ATK user
  • *
  • Posts: 4
  • Reputation: 0
    • View Profile
Re: Question of inital state in IVCharacteristics object
« Reply #2 on: October 21, 2022, 10:30 »
Thank you, Professor Anders Blom, but I am still confused...
If I want to use the initial state of 0.1V gate (source and drain is 0.65V) to calculate 0.5V-0.8V gate voltage (source and drain is 0.65V) using IVCharacteristics object, how to write the script? in my mind, the basis parameter can write as follows:
**************************
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Two-probe Configuration
# -------------------------------------------------------------
# -------------------------------------------------------------
# Left Electrode
# -------------------------------------------------------------
...
# -------------------------------------------------------------
# Right Electrode
# -------------------------------------------------------------
....
# -------------------------------------------------------------
# Central Region
# -------------------------------------------------------------
....
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
.....
#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
....
#----------------------------------------
# Poisson Solver Settings
#----------------------------------------
......
#----------------------------------------
# Contour Integral Settings
#----------------------------------------
.....
#----------------------------------------
# Electrode Calculators
#----------------------------------------
......
#----------------------------------------
# Device Calculator
#----------------------------------------
......
##########################
#Then read the initial state
old_calculation = nlread('Device_MoS2-gate0.1.hdf5', DeviceConfiguration)[0]

device_configuration.setCalculator(
    calculator,
    initial_state=old_calculation,
   )
##################
#At last, using IVCharacteristics object
# File name
filename = 'Device_MoS2-gate.hdf5'

iv_characteristics = IVCharacteristics(
    configuration=device_configuration,
    filename=filename,
    object_id='Device_MoS2-gate_IV_',
    gate_regions=[0, 1],
    gate_source_voltages=numpy.linspace(0.5, 0.8, 4)*Volt,
    drain_source_voltages=numpy.linspace(0.65, 0.65, 1)*Volt,
    energies=numpy.linspace(-2, 2, 401)*eV,
    kpoints=kpoint_grid,
    self_energy_calculator=RecursionSelfEnergy(),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    log_filename_prefix='Device_MoS2-gate_IV_',
    number_of_processes_per_task=None,
    enforce_zero_transmission_in_band_gap=False,
    source_electrode=Left
)
iv_characteristics.update()
######################
how to modify the script, Thank you

Offline Anders Blom

  • QuantumATK Staff
  • Supreme ATK Wizard
  • *****
  • Posts: 5126
  • Country: dk
  • Reputation: 85
    • View Profile
    • QuantumATK at Synopsys
Re: Question of inital state in IVCharacteristics object
« Reply #3 on: October 21, 2022, 20:15 »
Should work

Offline rebacoo

  • New ATK user
  • *
  • Posts: 4
  • Reputation: 0
    • View Profile
Re: Question of inital state in IVCharacteristics object
« Reply #4 on: October 26, 2022, 04:24 »
Thank you, Professor Anders Blom, the script works
      But another question  puzzles me, I'm not sure whether the inital state (0.1V gateļ¼Œsource and drain is 0.65V) is read to calculate 0.5V-0.8V gate voltage (source and drain is 0.65V) . In general, the equivalent bulk calculation will give a relatively good initial guess for the central region. if we use an specified inital state, the equivalent bulk calculation is omited. So, i can confirm the initial state is read.
but in this script, the basic procedure of output file is as following:
Device DFT Calculation Started: (1)Left Electrode Calculation... (2)Reusing Left Electrode Calculation for the Right Electrode... (3)Equivalent Bulk ...(4)Device SCF Loop Information.... Device DFT Calculation Finished. it seems that the inital state of 0.1 gate is not read.
        If we directly use  IVCharacteristics object to calculate 0-1V gate (source and drain is 0.65V),  the 0V gate calculation procedure: Device DFT Calculation Started: (1)Left Electrode Calculation... (2)Reusing Left Electrode Calculation for the Right Electrode... (3)Equivalent Bulk ...(4)Device SCF Loop Information.... Device DFT Calculation Finished. but during the 0.1V gate (source and drain is 0.65V) calculation procedure, the left electrode, right electrode and equivalent bulk calculation procedure are all skipped, means that inital state of 0V gate is read in the following calculation.
So, i'm not sure whether the inital state is  read in the script, please help me :) :)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme ATK Wizard
  • *****
  • Posts: 5126
  • Country: dk
  • Reputation: 85
    • View Profile
    • QuantumATK at Synopsys
Re: Question of inital state in IVCharacteristics object
« Reply #5 on: October 26, 2022, 06:40 »
Your observation seems to be correct, the initial state set on the configuration is ignored inside the IVCharacteristics study object (I'll ask developers if it makes sense to use it).

However, you can use the setCalculator method on the IVCharacteristics object before update (I think). This is describe in the manual https://docs.quantumatk.com/manual/Types/IVCharacteristics/IVCharacteristics.html although there it's used to restart a calculation. But if I understand it correctly, you should be able to do

iv_characteristics = IVCharacteristics(...)
iv_characteristics.setCalculator(
    0.5*V,
    0.65*V,
    calculator,
    old_calculation)
iv_characteristics.update()

At least worth a try!

Offline rebacoo

  • New ATK user
  • *
  • Posts: 4
  • Reputation: 0
    • View Profile
Re: Question of inital state in IVCharacteristics object
« Reply #6 on: October 30, 2022, 13:30 »
Thank you, Professor Anders Blom, I want to use the initial state of 0.1V gate (source and drain is 0.65V) to calculate 0.5V-0.6V gate voltage (source and drain is 0.65V)
Here is the scripts:
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Two-probe Configuration
# -------------------------------------------------------------
# -------------------------------------------------------------
# Left Electrode
# -------------------------------------------------------------
...
# -------------------------------------------------------------
# Right Electrode
# -------------------------------------------------------------
....
# -------------------------------------------------------------
# Central Region
# -------------------------------------------------------------
....
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
.....
#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
....
#----------------------------------------
# Poisson Solver Settings
#----------------------------------------
......
#----------------------------------------
# Contour Integral Settings
#----------------------------------------
.....
#----------------------------------------
# Electrode Calculators
#----------------------------------------
......
#----------------------------------------
# Device Calculator
#----------------------------------------
......
# -------------------------------------------------------------
# IV Characteristics
# -------------------------------------------------------------
# Kpoint sampling
kpoint_grid = MonkhorstPackGrid(
    na=32,
    )

iv_characteristics = IVCharacteristics(
    configuration=device_configuration,
    filename='Device_MoS2_0.5_0.6.hdf5',
    object_id='MoS2_0.5_0.6_IV_',
    gate_regions=[0, 1],
    energies=numpy.linspace(-2, 2, 401)*eV,
    kpoints=kpoint_grid,
    self_energy_calculator=RecursionSelfEnergy(),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    log_filename_prefix='MoS2_0.5_0.6_IV_',
    number_of_processes_per_task=None,
    enforce_zero_transmission_in_band_gap=False,
    source_electrode=Left
)
old_calculation = iv_characteristics.configuration(
    0.1* Volt,
    0.65* Volt)

iv_characteristics.setCalculator(
   numpy.linspace(0.5, 0.6, 2)*Volt,
   0.65*Volt,
   calculator,
   old_calculation)
iv_characteristics.update()
********************************************
the script doesn't work, the the error message is as follows:
Traceback (most recent call last):
  File "Device_MoS2_0.5_0.6.py", line 503, in <module>
    iv_characteristics.setCalculator(
  File "zipdir/NL/Study/IVCharacteristics.py", line 800, in setCalculator
NL.ComputerScienceUtilities.Exceptions.NLValueError: Gate-source voltage [0.5 0.6] V not found in IVCharacteristics.

i can't understand the error message, 0.5 and 0.6 gate-source voltage is what i want to calculate, what' mean of "not found 0.5 and 0.6V"?
please help me, thank you

Offline Anders Blom

  • QuantumATK Staff
  • Supreme ATK Wizard
  • *****
  • Posts: 5126
  • Country: dk
  • Reputation: 85
    • View Profile
    • QuantumATK at Synopsys
Re: Question of inital state in IVCharacteristics object
« Reply #7 on: November 1, 2022, 00:25 »
You still need to set the voltages on the IVChar object of course

    gate_source_voltages=numpy.linspace(0.5, 0.8, 4)*Volt,
    drain_source_voltages=numpy.linspace(0.65, 0.65, 1)*Volt,

And then see my earlier post for setCalculator, and use it as I wrote
iv_characteristics.setCalculator(
    0.5*V,
    0.65*V,
    calculator,
    old_calculation)

But here old_calculation is the object you read from the file, not something you extract from IVChar