# 3. Settings

KITE uses the classes kite.Configuration and kite.Calculation to define the calculation settings.

This is what a typical kite.Configuration object (for a 2D lattice) looks like:

  1 2 3 4 5 6 7 8 9 10 nx = ny = 2 lx = ly = 128 mode = 'periodic' configuration = kite.Configuration( divisions=[nx, ny], length=[lx, ly], boundaries=[mode, mode], is_complex=False, precision=1 ) 
Below, we explain each of the arguments in the kite.Configuration object.

### Divisions¶

The divisions is an integer number that defines the number of decomposition parts in each spatial direction. KITEx implements a domain decomposition technique to divide the lattice into various partitions that are computed in parallel. The domain decomposition is optimized at the design level and allows a substantial speed up of multithreaded calculations, it's usage is recommended.
To activate this feature, set a number of decomposition parts larger than one nx * ny * nz > 1.

Warning

The product nx * ny * nz equals the number of threads used by KITEx and thus must not exceed the number of available cores in the computer.

### Length¶

The length is an integer number of unit cells along the direction of lattice vectors lx, ly, lz = 256, 256, 256. The lateral size of the decomposed parts are given by lx/nx and ly/ny.

Warning

The laterial sizes lx/nx, ly/ny, lz/nz must be integers.

When using a 2D lattice, only lx, ly, nx, ny are needed.

### Boundaries¶

KITE has 3 standard types of boundary conditions (BCs) implemented, namely: periodic, open, and twisted. Moreover, a "random BCs" option is available, whereby statistical averages over ensembles of random vectors (or disorder configurations) are done with the help of random twist angles drawn from a uniform distribution. This special option is particularly useful to simulate the infinite-size “bulk", since it efficiently eliminates finite size effects.

Info

It is possible to impose open BCs along one spatial direction to build ribbons in 2D and slabs in 3D.

The boundaries is a string, use 'periodic' for periodic BCs, 'open' for open BCs, 'twisted' for twisted BCs and 'random' for random BCs. In all cases, the system has the geometry of the unit cell, which is replicated lx, ly, lz times in the directions of the unit vectors. Different BCs can be used along the x, y and z axis. If twisted boundary conditions are used, the twist angles must be included in radians.

#### Twisted BC¶

For twisted BCs, the twist phase angles need to be specified by the user. This is done by means of an extra argument ' angles=[phi_1,..,phi_DIM]' where ' phi_i \in [0, 2*M_PI]'. The syntax is simple:

  1 2 3 4 5 6 7 8 9 10 11 12 13 nx = ny = 2 lx = ly = 128 mode = 'twisted' twsx = twsy = np.pi/2.0 configuration = kite.Configuration( divisions=[nx, ny], length=[lx, ly], boundaries=[mode, mode], angles = [twsx,twsy] is_complex=False, precision=1 ) 

#### Random BC¶

Random BCs are defined using mode = 'random'. No extra arguments are required, but this option implicitely assumes that many random vectors (and/or disorder configurations) will be used. For a single system realization (Sec. calculation for calculation settings), this option is equivalent to a mere twisted-BC simulation with randomly chosen twist-angles along x, y and z axis.

Warning

The usage of True or False for the boundaries is deprecated.

### Complex¶

The is_complex is a boolean value. For optimisation purposes, KITEx only considers and stores complex data with the setting is_complex=True. False should be used for real symmetric Hamiltonians.

### Precision¶

The precision is an integer identifier for the used data type. KITEx allows users to define the precision of the calculation. Use 0 for float, 1 for double, and 2 for long double.

### Spectrum Range¶

The optional spectrum_range is an array of reals. By default, KITEx executes an automated rescaling of the Hamiltonian, see the Documentation. Advanced users should avoid the automated rescaling and override this feature using spectrum_range=[Emin,Emax], where Emin, Emax are the minimum, maximum eigenvalues of the TB matrix. Lower/upper bounds on smallest/largest energy eigenvalues should be used if exact eigenvalues are unknown (often the case in systems with disorder); see Sec. Disorder for more information.

To manually set the spectrum_range, it is necessary to add an extra parameter to the kite.Configuration class:

configuration = kite.Configuration(
divisions=[nx, ny],
length=[lx, ly],
boundaries=["periodic", "periodic"],
is_complex=False,
precision=1,
spectrum_range=[-10, 10]
)