QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: wot19920302 on October 10, 2016, 11:49

Title: does initial_spin work in scf loop?
Post by: wot19920302 on October 10, 2016, 11:49
Dear QuantumWise Staffs:
       For this scipt:
       
Code
  # -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
initial_spin = InitialSpin(scaled_spins=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])

device_configuration.setCalculator(
            calculator(),
            initial_spin=initial_spin,
            )
device_configuration.update()

Voltage = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0]*Volt

for bias in Voltage:
    calculator=calculator(
            checkpoint_handler= CheckpointHandler('checkpoint-%.1f.nc' % bias.inUnitsOf(Volt), 30*Minute),
            electrode_voltages=(bias/2, -bias/2))

    device_configuration.setCalculator(
            calculator()
            initial_state=device_configuration
            )
    device_configuration.update()
    nlsave('%.1f.nc' % bias.inUnitsOf(Volt), device_configuration)
      As we know, when we perform first scf calculator, device_configuration will be calculated using inistial_spin, if we perform 2nd scf(use electron configuration within 0V to calculate electron configuration  within 0.2V ), does initial_spin will still work? or is just  recovered by initial_state? 
Title: Re: does initial_spin work in scf loop?
Post by: Jess Wellendorff on October 10, 2016, 12:58
With initial_state, the initial guess for the electron density in e.g the 0.2 V calculation is the self-consistent state from the previous calculation (at 0.0 V). On the contrary, initial_spin is here used to set up the initial guess for the electron density in the very first SCF (where no previous state is available). Hope this makes sense.