Author Topic: The iv curve calculation did not converge to the requested tolerance!  (Read 7423 times)

0 Members and 1 Guest are viewing this topic.

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
when i  set max_steps=250 and i alse get the Warning
################################################################################
#                                                                              #
# Warning: The calculation did not converge to the requested tolerance!        #
#                                                                              #
################################################################################

now what can i do ?and i also want to know the maximum of  max_steps can be set

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
You can certainly use more but it is definitely not recommended.
There is probably something else you can do to reach convergence. Hard to say something without more details about your job.

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
desire for your advise to converge at high bias
and another question,is the ivcurve() the same as my code
Thank you!

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
1- First of all when you define the doping from the doping density (e/cm^-3) you consider th volume of the whole right electrode.
This is obviously wrong since you include all the vacuum region in this definition.
The procedure you used is correct for bulk systems where the atoms occupy the entire volume of the cell.

You should have a different definition of doping density,. For example you can define a deoping density per area, e/cm^-2,  since your structure is pure 2D.
In this case you can use the area of your electrode to calculate the charge per atom.

Otherwise, if you want to keep a volume density you have to define a volume  occupied by the MoS2 atoms.
For example you can take the one from a bulk structure (normalized by the number of atoms).

Which method you choose really depends on you and your input data.
I hope the description above is clear. We will add a tutorial for 2D/1D doping following these lines soon.

2- Use Neumann boundary conditions along B direction since you have the gate. You may also want to make the gate shorter or increase the central region.

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
Thank you very much!i will try first method,but i don't know how to use the second method.i am looking forward to the tutorial for 2D/1D doping. i have some other questions 1.when i pasted my input.py into ATK's Editor and i sent it to Builder ,then i sent to Editor again.The code changed.the codes are attached below.what is the difference between doping code and external_potential = AtomicCompensationCharge() 2.There are two ways to calculate ivcurve.i want to know the differences between iv_curve = IVCurve() and the code below
Code
def transmission(device_configuration):
    # Calculate the transmission spectrum and save it in a file
    transmission_spectrum = TransmissionSpectrum(
        configuration=device_configuration,
        energies=numpy.linspace(-2,2,101)*eV,
        kpoints=MonkhorstPackGrid(7,1),
        energy_zero_parameter=AverageFermiLevel,
        infinitesimal=1e-06*eV,
        self_energy_calculator=RecursionSelfEnergy(),
        )
    nlsave('s2.5_iv.nc', transmission_spectrum)
# Read in the converged zero-bias calculation
##device_configuration = nlread("li-h2.nc",DeviceConfiguration)[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.25, 0.5, 0.75, 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/2, -voltage/2)), 
          initial_state=device_configuration)
    device_configuration.update()
    nlsave('s2.5device_configuration.nc', device_configuration)
    # Calculate and save the transmission spectrum for each bias
    transmission(device_configuration)
Thank you very much!

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Quote
1.when i pasted my input.py into ATK's Editor and i sent it to Builder ,then i sent to Editor again.The code changed.the codes are attached below.what is the difference between doping code and external_potential = AtomicCompensationCharge()
This is because all the code you use in the original script is meant to create the code in the final script. Which is to calculate, from the doping density, the number of electrons per atom to add in AtomicCompensationCharge. You can check that doping in the first script is (+/-) 0.0121961666667 by adding
Code: python
print doping
at the end of the first script.

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
thank you!
and i changed my input.py according to your comments, but the iv curve calculation did not also converge to the requested tolerance!
so what can i do?

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
I see you are running the finite bias calculation at  2Volt from scratch.
Better to start from a previously converged state at lower bias.
Did you manage to converge your states up to 2 V?

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
I see you are running the finite bias calculation at  2Volt from scratch.
Better to start from a previously converged state at lower bias.
Did you manage to converge your states up to 2 V?
i do it following your advise.
i use the ivcurve(),bias= [0.000000, 0.100000, 0.200000, 0.300000, 0.400000, 0.500000, 0.600000, 0.700000, 0.800000, 0.900000, 1.000000, 1.100000, 1.200000, 1.300000, 1.400000, 1.500000, 1.600000, 1.700000, 1.800000, 1.900000, 2.000000]*Volt
after 1.3V, all calculations do not converge to the requested tolerance

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Good.
Well, 1.3 to 2 V are indeed pretty high voltages.
If you really want to perform these calculations I suggest you to proceed with smaller steps from that points. Something about 0.02 V.

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
Good.
Well, 1.3 to 2 V are indeed pretty high voltages.
If you really want to perform these calculations I suggest you to proceed with smaller steps from that points. Something about 0.02 V.
thank you very much
can a job stop when the log file appears 'The calculation did not converge to the requested tolerance! '?
what code should be add to the input.py?

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
Good.
Well, 1.3 to 2 V are indeed pretty high voltages.
If you really want to perform these calculations I suggest you to proceed with smaller steps from that points. Something about 0.02 V.
i want to know how to proceed with smaller steps from that points in details.
ivcurve_selfconsistent_configuration at 0 and 1.2V bias are the same.
i use the ivcurve_selfconsistent_configuration at 1.2V as device configuration ,and calculate the ivcurve using electrode_voltages=( 0.6*Volt, -0.6*Volt),but it doesn't converge!
desired for your help!
thank you!

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Quote
i want to know how to proceed with smaller steps from that points in details. ivcurve_selfconsistent_configuration at 0 and 1.2V bias are the same. i use the ivcurve_selfconsistent_configuration at 1.2V as device configuration ,and calculate the ivcurve using electrode_voltages=( 0.6*Volt, -0.6*Volt),but it doesn't converge!
how exactly did you do it? (script) You are saying that you run a calculation at 1.2V starting from the same state at 1.2 V  ?!? If you start from 1.2 V, which is good, you then need to specify a bias range from 1.25 V to 2.0 V with steps of 0.05 V. Since there are many calculations involved I suggest you to split this calculation into smaller part, e.g. from 1.25 to 1.5 V first.
Code: python
device_configuration=nlread('filename.nc', DeviceConfiguration)[-1]  #configuration at 1.2 V


# Set bias list
bias_list = [1.25, .........]*Volt

# Get the calculator
calculator = device_configuration.calculator()

for bias in bias_list:
    # Set the source-drain voltage of the calculator
    calculator=calculator(
            electrode_voltages=(bias/2, -bias/2))

    # Set new calculator with modified electrode voltages on the configuration
    # use the self consistent state of the old calculation as starting input.
    device_configuration.setCalculator(
          calculator(),
          initial_state=device_configuration)
    device_configuration.update()
    nlsave('ivcurve_selfconsistent_configurations.nc', device_configuration)
And monitor how the calculation proceed.

Offline 395235863

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: cn
  • Reputation: 0
    • View Profile
thank you very much!

and can a job stop when the log file appears 'The calculation did not converge to the requested tolerance! '? so i don't need always to monitor how the calculation proceed.

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
No, the calculation will always proceed even though the SCF loop did not fully converge. We believe that in most cases this is more of an advantage than a disadvantage.