device_configuration.setCalculator(
calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
initial_state=old_calculation
)
and then also do, in each step
old_calculation = device_configuration
So:
# -------------------------------------------------------------
# Initial State
# -------------------------------------------------------------
initial_spin = InitialSpin(scaled_spins=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
old_calculation = nlread('C:/Users/Alexander/Documents/VNL_tmp/CoFe-MgO-CoFe_para.nc', DeviceConfiguration)[0]
device_configuration.setCalculator(calculator, initial_spin=initial_spin, initial_state=old_calculation)
for bias in [0., 0.1, 0.3, 0.5, 0.7, 1.0, 1.3, 1.5]*Volt:
device_configuration.setCalculator(
calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
initial_state=old_configuration
)
device_configuration.update()
nlsave('C:/Users/Alexander/Documents/VNL_tmp/CoFe-MgO-CoFe_para_I-V.nc', device_configuration)
old_configuration = device_configuration