Author Topic: My confuse about the work flow of restoreSelfConsistentCalculation() and scf?  (Read 2641 times)

0 Members and 1 Guest are viewing this topic.

Offline zdhlover

  • Global Moderator
  • QuantumATK Guru
  • *****
  • Posts: 106
  • Reputation: 2
    • View Profile
Hi, I am confusing about the work flow of restoreSelfConsistentCalculation() and scf recently ,and I search the all the Forum and see the relevant topic, but found nothing, could some one tell me the correct idea about that? This is the scriptof lih2li :
Code
from ATK.TwoProbe import *
import numpy
import ATK
# Restore two-probe geometry
vnlfile = VNLFile('lih2li.vnl')
lih2li = vnlfile.readAtomicConfigurations()['lih2li']
# Use the same parameters for final bias as for zero bias
bz_int_param = brillouinZoneIntegrationParameters(
monkhorst_pack_parameters=(1,1,100)
)
electrode_params = ElectrodeParameters(
brillouin_zone_integration_parameters = bz_int_param
)
basis_set_params = basisSetParameters(
type = SingleZeta,
element = Lithium
)
iteration_control_params = iterationControlParameters(
tolerance = 1e-5
)
ATK.setVerbosityLevel(0)
# Restore initial density from old calculation
scf = restoreSelfConsistentCalculation("lih2li-scf.nc")#.............................A
print '# Bias (Volt)\tCurrent (Ampere)'
# Run bias from 0.0 and 1.0 in steps of 0.1
for voltage in numpy.arange(0.0, 1.01, 0.1):
dft_method = TwoProbeMethod(
electrode_parameters=(electrode_params,electrode_params),
basis_set_parameters = basis_set_params,
iteration_control_parameters = iteration_control_params,
electrode_voltages = (voltage/2.0, -voltage/2.0)*Volt
)
# Store each calculation in a separate NetCDF file
ATK.setCheckpointFilename ('lih2li-bias-%.1f.nc' % voltage)#........................B
scf = executeSelfConsistentCalculation(
atomic_configuration=lih2li,
method = dft_method,
initial_calculation = scf                                               #...........................C
)
current = calculateCurrent(scf)
print "%.1f\t\t%.2e" %(voltage, current.inUnitsOf(Ampere))

my confuse is: In the fist loop, at A line the .nc file is lih2li-scf.nc ,at B line we defined the .nc file as lih2li-bias-%.1f.nc ,then my question is that the .nc file I think is lih2li-bias-%.1f.nc ,is right ? and the lih2li-bias-%.1f.nc cover the lih2li-scf.nc or not? and at c line which .nc file pass to scf ?  From A to B to C ,how the change of the .nc file ?and they how to work and pass ? Thanks a lot

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5405
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Ok, so what happens is this:

  • Before this script, we have run a calculation at zero bias. The checkpoint file for this is lih2li-scf.nc.
  • At point A in the script, we restore this calculation into an object called scf, because we want to start the finite bias calculation not from "scratch", but using this converged calculation as a good starting guess. This actually happens at point C!
  • At point B we set the name of the finite bias checkpoint file. The calculation for each bias will be stored in a unique file name.

As the loop progresses, the variable scf is each time updated with the latest converged self-consistent calculation, and then used as initial guess for the next bias.

PS: Nice profile picture!
« Last Edit: June 29, 2009, 15:55 by Anders Blom »

Offline zdhlover

  • Global Moderator
  • QuantumATK Guru
  • *****
  • Posts: 106
  • Reputation: 2
    • View Profile
ok, I see .Thanks for your kindly  and enthusiastic reply . And thanks for your praise of my profile picture.

I am grateful  to you that you are so   kindly and serious answer my question.

Wish you happy  and work with pleasure! ;D ;D ;D
« Last Edit: June 29, 2009, 16:59 by zdhlover »