Hello everyone.
I want to restart a calculation
I find this in quantumatk tutorial
https://docs.quantumatk.com/tutorials/restarting_calculations/restarting_calculations.htmlIt says I need to add the line
"device_configuration = nlread("checkpointfile.hdf5")[0]"
before
"device_configuration.update()"
But my script is like this:
# Set up configuration
central_region = BulkConfiguration(
bravais_lattice=central_region_lattice,
elements=central_region_elements,
cartesian_coordinates=central_region_coordinates
)
# Add metallic region
metallic_region_0 = BoxRegion(
-0.7*Volt,
xmin = 0.0*Angstrom, xmax = 0.9*Angstrom,
ymin = 0.0*Angstrom, ymax = 5.6*Angstrom,
zmin = 13.0*Angstrom, zmax = 90.0*Angstrom,
)
metallic_region_1 = BoxRegion(
-0.7*Volt,
xmin = 25.5*Angstrom, xmax = 26.31*Angstrom,
ymin = 0.0*Angstrom, ymax = 5.6*Angstrom,
zmin = 13.0*Angstrom, zmax = 90.0*Angstrom,
)
metallic_regions = [metallic_region_0, metallic_region_1]
central_region.setMetallicRegions(metallic_regions)
# Add dielectric region
dielectric_region_0 = BoxRegion(
3.9,
xmin = 0.9*Angstrom, xmax = 8.9*Angstrom,
ymin = 0.0*Angstrom, ymax = 5.6*Angstrom,
zmin = -2.5*Angstrom, zmax = 105.0*Angstrom,
)
dielectric_region_1 = BoxRegion(
3.9,
xmin = 17.5*Angstrom, xmax = 25.5*Angstrom,
ymin = 0.0*Angstrom, ymax = 5.6*Angstrom,
zmin = -2.5*Angstrom, zmax = 105.0*Angstrom,
)
dielectric_regions = [dielectric_region_0, dielectric_region_1]
central_region.setDielectricRegions(dielectric_regions)
device_0321_01 = DeviceConfiguration(
central_region,
[left_electrode, right_electrode],
equivalent_electrode_lengths=[2.584, 2.584]*Angstrom,
transverse_electrode_repetitions=[[1, 1], [1, 1]],
)
# device_0321_01 = nlread("tmp/dojo0715.hdf5")[0]
# %% Set DeviceLCAOCalculator
# %% DeviceLCAOCalculator
#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = NCLDA.PZ
k_point_sampling = KpointDensity(
density_a=1.0*Angstrom,
density_b=10.0*Angstrom,
density_c=200.0*Angstrom
)
numerical_accuracy_parameters = NumericalAccuracyParameters(
density_mesh_cutoff=80.0*Hartree,
k_point_sampling=k_point_sampling,
occupation_method=FermiDirac(
broadening=300.0*Kelvin
)
)
#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = [
BasisLDAPseudoDojo.Selenium_Medium,
BasisLDAPseudoDojo.Rhodium_Medium,
BasisLDAPseudoDojo.Tungsten_Medium,
]
iteration_control_parameters = IterationControlParameters(
max_steps=3000,
damping_factor=0.079,
non_convergence_behavior=StopCalculation()
)
device_algorithm_parameters = DeviceAlgorithmParameters(
initial_density_type=NeutralAtom(
electrode_constraint_length=10.0*Angstrom,
)
)
poisson_solver = MultigridSolver(
boundary_conditions=[
[NeumannBoundaryCondition(), NeumannBoundaryCondition()],
[PeriodicBoundaryCondition(), PeriodicBoundaryCondition()],
[DirichletBoundaryCondition(), DirichletBoundaryCondition()]
]
)
contour_parameters = ContourParameters(
equilibrium_contour = SemiCircleContour(
circle_points=40
)
)
checkpoint_handler = CheckpointHandler(
file_name='/home/weixiang/tmp/dojo0729.hdf5'
)
calculator = DeviceLCAOCalculator(
basis_set=basis_set,
exchange_correlation=exchange_correlation,
numerical_accuracy_parameters=numerical_accuracy_parameters,
iteration_control_parameters=iteration_control_parameters,
device_algorithm_parameters=device_algorithm_parameters,
poisson_solver=poisson_solver,
contour_parameters=contour_parameters,
electrode_voltages=[ 0. , -0.05]*Volt,
checkpoint_handler=checkpoint_handler
)
# %% Set Calculator
device_0321_01.setCalculator(calculator)
nlsave('0715_6w_dojo_general_0v_electrode_diele_filled_k1*10_1*100.hdf5', device_0321_01)
# %% IVCharacteristics
kpoints = MonkhorstPackGrid(
nb=100
)
iv_characteristics = IVCharacteristics(
configuration=device_0321_01,
filename='0715_6w_dojo_general_0v_electrode_diele_filled_k1*10_1*100.hdf5',
object_id='ivc',
gate_source_voltages=numpy.linspace(0.0, 0.0, 1)*Volt,
drain_source_voltages=numpy.linspace(-0.05, -0.05, 1)*Volt,
energies=numpy.linspace(-3.0, 3.0, 101)*eV,
kpoints=kpoints
)
iv_characteristics.update()
I can't find "device_configuration.update()"
So, I don't know how to insert "device_configuration = nlread("tmp/dojo0715.hdf5")[0]" in my script.
Can anyone help me?
Thanks!