Skip to content

4. Calculation

The kite.Calculation object carries the information about the to be calculated quantities, the target functions. For this, parameters related to the Chebyshev expansion are included here. The parameters are used by KITEx to determine the coefficients that are used by KITE-tools to calculate the required target functions. The parameters given in the Examples already have optimized parameters for a standard desktop computer.

The target function currently available are:

  • dos
    Calculates the global density of states (DOS) as a function of energy.
  • ldos
    Calculate the local density of states (LDOS) as a function of energy (for a set of lattice positions).
  • arpes
    Calculate the ARPES response.
  • gaussian_wave_packet
    Calculate the propagation of a gaussian wave-packet.
  • conductivity_dc
    Calculates a given component of the DC conductivity tensor.
  • conductivity_optical
    Calculates a given component of the linear optical conductivity tensor as a function of frequency for a given Fermi energy.
  • conductivity_optical_nonlinear
    Calculates a given component of the 2nd-order nonlinear optical conductivity tensor.
  • singleshot_conductivity_dc
    Calculates the longitudinal DC conductivity for a set of Fermi energies (uses the \(\propto\mathcal{O}(N)\) single-shot method).

KITE previous release worked in two dimensions. However, since then, there has been an efford to expand the calculations for three dimensional systems. In this new release, many of them are implemented in 3D as well. For details, check the table below:

Method 2D 3D
DOS
LDOS
ARPES
conductivity_dc
singleshot_conductivity_dc
optical conductivity
conductivity_optical_nonlinear
gaussian_wave_packet
external magnetic field

- Extensivelly used and checked

- Implemented

- Not implemented

Warning

Processing the output of singleshot_conductivity_dc

singleshot_conductivity_dc() works different from the other target-functions in that a single run with KITEx is sufficient. The results don't have to be processed by KITE-tools. As such, the results are already available in the HDF5-file. You can extract the results from the HDF5 file as explained in the tutorial, with "output.h5" the name of the HDF5 file processed by KITEx:

1
2
3
4
    import numpy as np
    from h5py import File
    condDC = File("output.h5", "r+")['Calculation']['singleshot_conductivity_dc']['SingleShot']
    np.savetxt("condDC.dat",condDC)                

All target functions require the following parameters:

  • num_moments
    defines the number of moments of the Chebyshev expansion and hence the energy resolution of the calculation; see Documentation.
  • num_random
    Defines the number of random vectors for the stochastic evaluation of traces.
  • num_disorder
    Defines the number of disorder realisations (and boundary twists if the "random" boundary mode is chosen).

Some parameters are specific of the target function:

  • direction
    Specifies the component of the linear (longitudinal: 'xx', 'yy' (, 'zz'), transversal: 'xy', 'yx' (, 'xz', 'yz')) or the nonlinear conductivity tensor (e.g., 'xyx' or 'xxz') to be calculated.
  • temperature
    Temperature of the Fermi-Dirac distribution used to evaluate optical and DC conductivities. temperature specifies the quantity \(k_B T\), which has units of energy. If the hoppings are given in eV, temperatureis given in eV . To convert to Kelvin, it is necessary to divide the value by the Boltzmann's constant \(k_B\).
  • num_points
    Number of energy points used by the post-processing tool to output the density of states.
  • special
    Simplified form of nonlinear optical conductivity hBN example.
  • energy
    Selected values of Fermi energy at which we want to calculate the singleshot_conductivity_dc.
  • eta
    Imaginary term in the denominator of the Green's function that provides a controlled broadening or inelastic energy scale. For technical details, see Documentation.

The calculation is structured in the following way:

calculation = kite.Calculation(configuration)
calculation.dos(
    num_points=1000,
    num_random=10,
    num_disorder=1,
    num_moments=512
)
calculation.conductivity_optical(
    num_points=1000,
    num_random=1,
    num_disorder=1,
    num_moments=512,
    direction='xx'
)
calculation.conductivity_dc(
    num_points=1000,
    num_moments=256,
    num_random=1,
    num_disorder=1,
    direction='xy',
    temperature=1
)
calculation.singleshot_conductivity_dc(
    energy=[(n / 100.0 - 0.5) * 2 for n in range(101)],
    num_moments=256,
    num_random=1,
    num_disorder=1,
    direction='xx',
    eta=0.02
)
calculation.conductivity_optical_nonlinear(
    num_points=1000,
    num_moments=256,
    num_random=1,
    num_disorder=1,
    direction='xxx',
    temperature=1.0,
    special=1
)

Note

The user can decide what functions are used in a calculation. However, it is not possible to configure the same function twice in the same Python script (HDF5 file).

When these objects are defined, we can export the file that will contain set of input instructions for KITEx using the kite.config_system function: function:

kite.config_system(lattice, configuration, calculation, filename='test.h5')

Running a Calculation

To run the code and to post-process it, run from the kite/-directory

./build/KITEx test.h5
./tools/build/KITE-tools test.h5

KITE-tools output

The output of KITE-tools is dependent of the target function. Each spicific case is described in the API. The output is generally a "*.dat"-file where the various columns of data contain the required target functions.

Visualizing the Output Data

After calculating the quantity of interest and post-processing the data, we can plot the resulting data with the following script:

1
2
3
4
5
data=np.loadtxt('dos.dat')

plt.plot(data[:,0], data[:,1])
plt.xlabel('E (eV)')
plt.ylabel('DOS (a.u)')

If you want to make these steps more automatic, you can use the following Bash script:

#!/bin/bash

file_out=example1                 # name of python script that exports the HDF5-file
file_in=example1                  # name of the exported HDF5-file

python ${file_out}.py             # make a model
./KITEx ${file_in}.h5             # run Kite

./tools/KITE-tools ${file_in}.h5  # run the post-processing steps
python plot_dos.py                # display the data