Name

executeSelfConsistentCalculation Initiates a self-consistent calculation.

Synopsis

Namespace: ATK.KohnSham or ATK.TwoProbe
SelfConsistentCalculation executeSelfConsistentCalculation(
atomic_configuration,
method,
runtime_parameters
)

Restart from a previous calculation using supplied parameters

SelfConsistentCalculation executeSelfConsistentCalculation(
atomic_configuration,
method,
runtime_parameters,
initial_calculation
)

Restart from a previous calculation using the original parameters

SelfConsistentCalculation executeSelfConsistentCalculation(self_consistent_calculation)

Description

This function is the work-horse for all density-functional calculations in ATK. The principle input is an atomic configuration, which may either be a molecule, a bulk, or a two-probe; this atomic configuration is then combined with a method, which completes the initialization of the self-consistent calculation.

The object returned from this function after the self-consistent calculation has converged serves the role as the principle input used in all subsequent analysis calculations. Typical examples are the evaluation of the total energy or the transmission spectrum.

List of arguments

atomic_configuration

Either a MoleculeConfiguration, a BulkConfiguration, a PeriodicAtomConfiguration, or a TwoProbeConfiguration.

Default: None

method

For bulk and molecules, a KohnShamMethod. For two-probes, either a TwoProbeMethod or a GatedTwoProbeMethod

Default: None

runtime_parameters

Runtime parameters that determine the location of the checkpoint file, and the verbosity level of the self-consistent calculation.

Default: None

initial_calculation

An object returned from a previously performed calculation using executeSelfConsistentCalculation() or the apply() method of any of the KohnShamMethod or TwoProbeMethod objects.

Default: None

self_consistent_calculation

An object returned from a previously performed calculation using executeSelfConsistentCalculation() or the apply() method of any of the KohnShamMethod or TwoProbeMethod objects.

Default: None

Usage examples

Perform a self-consistent calculation using default runtime parameters:

from ATK.KohnSham import *
...
self_consistent_calculation = executeSelfConsistentCalculation(
    atomic_configuration,
    dft_method
    )

Perform a self-consistent two-probe calculation, with a specified checkpoint file:

from ATK.TwoProbe import *
...
rt_params = runtimeParameters(
    verbosity_level=10,
    checkpoint_filename='myfile.nc'
    )
self_consistent_calculation = executeSelfConsistentCalculation(
    atomic_configuration,
    twoprobe_method,
    runtime_parameters = rt_params
    )

Perform a self-consistent calculation for different voltages from 0.0*Volt to 1.0*Volt, using the converged density matrix from the previous voltage calculation as initial guess for the next calculation:

use_old=False
for bias in range(0,11,1):
    dft_method = TwoProbeMethod(
         electrode_parameters=(electrode_one,electrode_two),
         electrode_voltages=(0.0,bias/10.0)*Volt
         )
    if not use_old:
        scf = executeSelfConsistentCalculation(
             atomic_configuration=old_two_probe_configuration,
             method=dft_method
             )
         use_old=True
         old_scf=scf
    else:
        scf = executeSelfConsistentCalculation(
             atomic_configuration=old_two_probe_configuration,
             method=dft_method,
             initial_calculation=old_scf
             )
        old_scf=scf
        
      

Notes

The contents of the object returned from executeSelfConsistentCalculation() are stored in the checkpoint NetCDF file, which later may be restored from disk using the restoreSelfConsistentCalculation(). function.

In ATK 2.1 it was possible to specify electrode voltages in the executeSelfConsistentCalculation(). This functionality has now been deferred to the TwoProbeMethod class.

A new feature in ATK 2.2 is the ability to restart from a previously converged electron density using a slightly changed method or atomic configuration. This corresponds to the -i option in ATK 2.0 and allows for changing i.e. iteration parameters or slightly changing the atomic positions. There are, however, a few restrictions to this procedure:

  • The atomic_configuration must contain the same type and number of atoms as the previously converged calculation. Furthermore, these atoms must be listed in the same order in the list used for specifying the atomic_configuration.

  • The atoms must be specified using the same basis set size as was used in the previous calculation.

If the above restrictions are disregarded ATK 2.2 will not be able to process your NanoLanguage script correctly.

The method objects (such as the KohnShamMethod) have a method apply(), which perform the equivalent calculation as executeSelfConsistentCalculation(), and returns the same kind of object. The main difference between these two different ways to perform the calculation presently lies in the way that the verbosity level and the name of the checkpoint file should be specified. The executeSelfConsistentCalculation() function takes an argument runtime_parameters which allows the specification of these parameters specifically for the actual self-consistent iteration. The apply() method, on the other hand, uses the globally set verbosity level and checkpoint file name.

Additional information on NETCDF files can be found in the Saving data tutorial.