Python package
The KITE package for pre-processing is split up in various subclasses and contains several functions:
- class
kite.StructuralDisorder(lattice, concentration=0, position=None)- Add disorder to the lattice. - class
kite.Disorder(lattice)- Add Guassian disorder to the lattice. - class
kite.Modification(magnetic_field=None, flux=None)- Add a magnetic field to the lattice. - class
kite.Configuration([...])- Define the basic parameters used in the calculation. - class
kite.Calculation(configuration=None)- Describe the required target functions. - function make_pybinding_model
- function estimate_bounds
- function config_system
- warning LoudDeprecationWarning
StructuralDisorder¶
class kite.StructuralDisorder(lattice, concentration=0, position=None)
- Class that introduces Structural Disorder into the initially built
pb.Lattice. -
- Parameters
-
lattice:pb.Lattice- The lattice used to build the structural disorder.
-
concentration:float- Concentration of disorder (can only be different from
0ifposition=None).
-
position:array_like- Exact position of disorder (can only be different from
Noneifconcentration=0).
-
- Methods
-
Method Description add_vacancy(*disorder)Add vacancy disorder to the lattice. add_structural_disorder(*disorder)Add structural disorder to the lattice. add_local_vacancy_disorder(relative_index, sub)Internal function to add one vacancy disorder to chosen position. add_local_bond_disorder(relative_index_from, [, ...])Internal function to add one bond disorder between chosen positions. add_local_onsite_disorder(relative_index, [, ...])Internal function to add one onsite disorder to chosen position. map_the_orbital(orb, nodes_map)Internal function to map the orbitals to the NodesMap. -
function
add_vacancy(*disorder)-
Add vacancy disorder to the lattice.
- Parameters
-
Parameter Description *disorder:strortuple(array_like, str)Vacancy disorder, in the form of sublattice_nameor([relatice_index], sublattice_name)
-
-
function
add_structural_disorder(*disorder)-
Add structural disorder to the lattice.
- Parameters
-
Parameter Description *disorder:tuple(array_like, str, float)ortuple(array_like, str, array_like, str, array_like)ortuple(array_like, str, array_like, str, float)ortuple(array_like, str, array_like)Vacancy disorder, in the form of ([relatice_index], sublattice_name, onsite_energy)or([relatice_index_from], sublattice_name_from, [relatice_index_to], sublattice_name_to, onsite_energy)
-
-
function
add_local_vacancy_disorder(relative_index, sub)-
Internal function to add one vacancy disorder to chosen position.
- Parameters
-
Parameter Description relative_index:array_likeRelative index of the position to change the onsite energy. sub:strName of the sublattice to change the onsite energy.
-
-
function
add_local_bond_disorder(relative_index_from, from_sub, relative_index_to, to_sub, hoppings)-
Internal function to add one bond disorder between chosen positions.
- Parameters
-
Parameter Description relative_index_from:array_likeRelative index of the position from wich the bond connects to change the onsite energy. from_sub:strName of the sublattice from wich the bond connects to change the onsite energy. relative_index_to:array_likeRelative index of the position to wich the bond connects to change the onsite energy. to_sub:strName of the sublattice to wich the bond connects to change the onsite energy. hoppings:floatorarray_likeThe hopping energy between the different sublattices at the given positions, with the right shape to connect between the orbitals.
-
-
function
add_local_onsite_disorder(relative_index, sub, value)-
AInternal function to add one onsite disorder to chosen position.
- Parameters
-
Parameter Description relative_index:array_likeRelative index of the position to change the onsite energy. sub:strName of the sublattice to change the onsite energy. value:floatorarray_likeThe onsite energy of sublattice at the given positions, with the right shape for the orbitals.
-
-
function
map_the_orbital(orb, nodes_map)-
Internal function to map the orbitals to the NodesMap.
- Parameters
-
Parameter Description orb:strName of the sublattice to give a unique value. nodes_map:dictThe object that stores the unique values for the sublattices.
-
Disorder¶
class kite.Disorder(lattice)
-
Class that introduces Disorder into the initially built
pb.Lattice.The informations about the disorder are the type, mean value, and standard deviation. The function that you can use in the bulding of the
pb.Latticeisadd_disorder(). The class method takes care of the shape of the disorder chosen (it needs to be same as the number of orbitals at a given atom), and takes care of the conversion to the c++ orbital-only format. -
- Parameters
-
lattice:pb.Lattice- The lattice used to build the disorder.
-
- Methods
-
Method Description add_disorder(sublattice [, ...])Add the disorder to the lattice. add_local_disorder(sublattice_name [, ...])Internal function to add the disorder to the positions. -
function
add_disorder(sublattice, dis_type, mean_value, standard_deviation=0.)-
Add the disorder to the lattice.
- Parameters
-
Parameter Description sublattice:strorlist(str)Name of the sublattice to give a unique value. dis_type:intorlist(int)The type of disorder to apply, possible values are "Gaussian","Uniform","Deterministic","gaussian","uniform"or"deterministic".dis_mean_valuetype:floatorlist(float)Mean value of the deformation. standard_deviation:floatorlist(float)Standard deviation of the deformation.
-
-
function
add_local_disorder(sublattice_name, dis_type, mean_value, standard_deviation)-
Internal function to add the disorder to the positions.
- Parameters
-
Parameter Description sublattice:list(str)Name of the sublattices to give a unique value. dis_type:list(int)The type of disorder to apply, possible values are "Gaussian","Uniform","Deterministic","gaussian","uniform"or"deterministic".dis_mean_valuetype:list(float)Mean value of the deformation. standard_deviation:list(float)Standard deviation of the deformation.
-
Modification¶
class kite.Modification(magnetic_field=None, flux=None)
- Class that modifies the initially built
pb.Latticewith a magnetic field. -
- Parameters
-
magnetic_field:float- Add the magnetic field to the lattice. The field will point along the second primitive lattice vector of the lattice. The magnetic field is in units of \(Tesla\), if the
pb.Latticeis in units of \(nm\). The magnetic field is rounded down to the nearest flux quantum.
-
flux:float- Add the magnetic flux to the lattice.
-
- Attributes
-
Attribute Description magnetic_field:floatThe added magnetic field to the lattice. flux:floatThe added magnetic flux to the lattice. This is not* the exact value used in the calculation, but the value added using the parameter above.
Configuration¶
class kite.Configuration(divisions=(1, 1, 1), length=(1, 1, 1), boundaries=('open', 'open', 'open'), is_complex=False, precision=1, spectrum_range=None, angles=(0,0,0), custom_local=False, custom_local_print=False)
- Define the basic parameters used in the calculation
-
- Parameters
-
divisions:intortuple(int, int)ortuple(int, int, int)- Number of decomposition parts of the system.
-
length:intortuple(int, int)ortuple(int, int, int)- Number of unit cells in each direction.
-
boundaries:strortuple(str, str)ortuple(str, str, str)- Periodic boundary conditions each direction. Possible values are
"periodic","open","twisted"*(this option needs the extra argumentanglesand"random"
-
is_complex:bool- Boolean that reflects whether the type of Hamiltonian is complex or not.
-
precision:int- Integer which defines the precision of the number used in the calculation,
float(0),double(1),long double(2).
-
spectrum_range:tuple(float, float)-
Energy scale which defines the scaling factor of all the energy related parameters. The scaling is done automatically in the background after this definition. If the term is not specified, a rough estimate of the bounds is found.
Warning
Automatic scaling can lead to segmentation-errors due to an error in pybinding.
-
angles:floatortuple(float, float)ortuple(float, float, float)- The angles used for the twisted boundary conditions when
boundary="twist"is selected. The values ofanglemust be in the interval \([0, M \cdot 2 \pi]\).
-
custom_local:bool- Boolean that reflects whether the calculation should use the user-defined local potential.
-
custom_local_print:bool- Boolean that reflects whether the calculation should use output the values for the local potential for the various sublattices of the
pb.Lattice.
-
- Attributes
-
Attribute Description energy_scale:floatReturns the energy scale of the hopping parameters. energy_shift:floatReturns the energy shift of the hopping parameters around which the spectrum is centered. comp:intReturns 0if hamiltonian is real and1elsewise.prec:intReturns 0,1,2if precision iffloat,double, andlong doublerespectively.div:intReturns the number of decomposed elements of matrix in \(x\), \(y\) and/or \(z\) direction. Their product gives the total number of threads spawn. bound:tuple(array_like, array_like)Returns the boundary conditions in each direction, the first argument describes the boundary conditions for the various dimensions with 0- open boundary condtions,1- periodic or twisted boundary conditions,2- random boundary conditions, the second gives the angle used ifboundary="twist"was chosen.leng:array_likeReturn the number of unit cell repetitions in each direction. type:np.float32ornp.float64ornp.float128ornp.float256Return the type of the Hamiltonian complex or real, and float, double or long double. custom_pot:boolReturn custom potential flag. print_custom_pot:boolReturn print custom potential flag.
-
- Methods
-
Method Description set_type()Internal function to determine the precision to be used during the calculation. -
function
set_type()- Internal function to determine the precision to be used during the calculation.
Calculation¶
class kite.Calculation(configuration=None)
- Class that contains the required target functions to calculate in later steps.
-
- Parameters
-
configuration:kite.Configuration- A
kite.Configurationthat contains the settings for the calculation.
-
- Attributes
-
Attribute Description get_dos:dictReturns the requested DOS functions. get_ldos:dictReturns the requested LDOS functions. get_arpes:dictReturns the requested ARPES functions. get_gaussian_wave_packet:dictReturns the requested wave packet time evolution function, with a gaussian wavepacket mutiplied with different plane waves. get_conductivity_dc:dictReturns the requested DC conductivity functions. get_conductivity_optical:dictReturns the requested optical conductivity functions. get_conductivity_optical_nonlinear:dictReturns the requested nonlinear optical conductivity functions. get_singleshot_conductivity_dc:dictReturns the requested singleshot DC conductivity functions.
-
- Methods
-
Method Description dos(num_points, num_moments, [, ...])Calculate the density of states as a function of energy. ldos(energy, num_moments, [, ...])Calculate the local density of states as a function of energy. arpes(k_vector, weight [, ...])Calculate the spectral contribution for given k-points and weights. gaussian_wave_packet(num_points [, ...])Calculate the time evolution function of a wave packet. conductivity_dc(direction, [, ...])Calculate the DC conductivity for a given direction. conductivity_optical(direction, [, ...])Calculate optical conductivity for a given direction. conductivity_optical_nonlinear([...])Calculate nonlinear optical conductivity for a given direction. singleshot_conductivity_dc(energy, [...])Calculate the DC conductivity using KITEx for a given direction and energy. -
function
dos(num_points, num_moments, num_random, num_disorder=1)-
Calculate the density of states as a function of energy.
- Parameters
-
Parameter Description num_points:intNumber of energy point inside the spectrum at which the DOS will be calculated. num_moments:intNumber of polynomials in the Chebyshev expansion. num_random:intNumber of random vectors to use for the stochastic evaluation of trace. num_disorder:intNumber of different disorder realisations.
-
-
function
ldos(energy, num_moments, position, sublattice, num_disorder=1)-
Calculate the local density of states as a function of energy.
- Parameters
-
Parameter Description energy:array_likeList of energy points at which the LDOS will be calculated. num_moments:intNumber of polynomials in the Chebyshev expansion. position:intRelative index of the unit cell where the LDOS will be calculated. sublattice:listName of the sublattice at which the LDOS will be calculated. num_disorder:strorlistNumber of different disorder realisations.
-
-
function
arpes(k_vector, weight, num_moments, num_disorder=1)-
Calculate the spectral contribution for given k-points and weights.
- Parameters
-
Parameter Description k_vector:array_likeList of K points with respect to reciprocal vectors b0 and b1 at which the band structure will be calculated. weight:array_likeList of orbital weights used for ARPES. num_moments:intNumber of polynomials in the Chebyshev expansion. num_disorder:intNumber of different disorder realisations.
-
-
function
gaussian_wave_packet(num_points, num_moments, timestep, k_vector, spinor, width, mean_value, num_disorder=1, probing_point=0)-
Calculate the time evolution function of a wave packet.
- Parameters
-
Parameter Description num_points:intNumber of time points for the time evolution. num_moments:intNumber of polynomials in the Chebyshev expansion. timestep:floatTimestep for calculation of time evolution. k_vector:array_likeDifferent wave vectors, components corresponding to vectors b0 and b1. spinor:array_likeSpinors for each of the k vectors. width:floatWidth of the gaussian. mean_value:tuple(float, float)Mean value of the gaussian envelope. num_disorder:intNumber of different disorder realisations. probing_point:intorarray_likeForward probing point, defined with x, y coordinate were the wavepacket will be checked at different timesteps.
-
-
function
conductivity_dc(direction, num_points, num_moments, num_random, num_disorder=1, temperature=0)-
Calculate the DC conductivity for a given direction.
- Parameters
-
Parameter Description direction:strDirection in \(xyz\)-coordinates along which the conductivity is calculated, supports "xx","yy","zz","xy","xz","yx","yz","zx","zy".num_points:intNumber of energy point inside the spectrum at which the DOS will be calculated. num_moments:intNumber of polynomials in the Chebyshev expansion. num_random:intNumber of random vectors to use for the stochastic evaluation of trace. num_disorder:intNumber of different disorder realisations. temperature:floatValue of the temperature at which we calculate the response. If \(eV\) is used as unit for energy, then \(k_B\cdot T\) is also in \(eV\). To define the temperature in arbitraty units, specify the quantity \(K_B \cdot T\), which has units of energy.
-
-
function
conductivity_optical(direction, num_points, num_moments, num_random, num_disorder=1, temperature=0)-
Calculate optical conductivity for a given direction.
- Parameters
-
Parameter Description direction:strDirection in \(xyz\)-coordinates along which the conductivity is calculated, supports "xx","yy","zz","xy","xz","yx","yz","zx","zy".num_points:intNumber of energy point inside the spectrum at which the DOS will be calculated. num_moments:intNumber of polynomials in the Chebyshev expansion. num_random:intNumber of random vectors to use for the stochastic evaluation of trace. num_disorder:intNumber of different disorder realisations. temperature:floatValue of the temperature at which we calculate the response. If \(eV\) is used as unit for energy, then \(k_B\cdot T\) is also in \(eV\). To define the temperature in arbitraty units, specify the quantity \(K_B \cdot T\), which has units of energy.
-
-
function
conductivity_optical_nonlinear(direction, num_points, num_moments, num_random, num_disorder=1, temperature=0, special=0)-
Calculate nonlinear optical conductivity for a given direction.
- Parameters
-
Parameter Description direction:strDirection in \(xyz\)-coordinates along which the conductivity is calculated, supports all the combinations of the directions "x","y"and"z"with length 3 like"xxx","zzz","xxy","xxz"etc.num_points:intNumber of energy point inside the spectrum at which the DOS will be calculated. num_moments:intNumber of polynomials in the Chebyshev expansion. num_random:intNumber of random vectors to use for the stochastic evaluation of trace. num_disorder:intNumber of different disorder realisations. temperature:floatValue of the temperature at which we calculate the response. If \(eV\) is used as unit for energy, then \(k_B\cdot T\) is also in \(eV\). To define the temperature in arbitraty units, specify the quantity \(K_B \cdot T\), which has units of energy. special:intOptional, a parameter that can simplify the calculation for some materials.
-
-
function
singleshot_conductivity_dc(energy, direction, eta, num_moments, num_random, num_disorder=1, preserve_disorder=False)-
Calculate the DC conductivity using KITEx for a given direction and energy.
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.There is also a script that automates this process with,
"output.h5"the name of the HDF5-file processed by KITEx:this will result in a data-file
"output.dat", as explained in the API of KITE-tools.- Parameters
-
Parameter Description energy:array_likeorfloatArray or a single value of energies at which singleshot_conductivity_dcwill be calculated.direction:strDirection in \(xyz\)-coordinates along which the conductivity is calculated, supports "xx","yy"and"zz".eta:intParameter that affects the broadening of the kernel function. num_moments:intNumber of polynomials in the Chebyshev expansion. num_random:intNumber of random vectors to use for the stochastic evaluation of trace. num_disorder:intNumber of different disorder realisations. preserve_disorder:boolOptional.
-
make_pybinding_model¶
-
function
kite.make_pybinding_model(lattice, disorder=None, disorder_structural=None, shape=None)-
Build a Pybinding model with disorder used in Kite. Bond disorder or magnetic field are not currently supported.
- Parameters
-
Parameter Description lattice:pb.LatticePybinding lattice object that carries the info about the unit cell vectors, unit cell cites, hopping terms and onsite energies. disorder:kite.DisorderClass that introduces kite.Disorderinto the initially built lattice. For more info check thekite.Disorderclass.disorder_structural:kite.StructuralDisorderClass that introduces kite.StructuralDisorderinto the initially built lattice. For more info check thekite.StructuralDisorderclass.shape:pb.ShapeOptional argument pb.Shape.
-
estimate_bounds¶
-
function
kite.estimate_bounds(lattice, disorder=None, disorder_structural=None)-
Estimate the bounds for the energy, given the
pb.Latticeand/orkite.Disorderand/orkite.StructuralDisorder.- Parameters
-
Parameter Description lattice:pb.LatticePybinding lattice object that carries the info about the unit cell vectors, unit cell cites, hopping terms and onsite energies. disorder:kite.DisorderClass that introduces kite.Disorderinto the initially built lattice. For more info check thekite.Disorderclass.disorder_structural:kite.StructuralDisorderClass that introduces kite.StructuralDisorderinto the initially built lattice. For more info check thekite.StructuralDisorderclass.
-
config_system¶
-
function
kite.config_system(lattice, config, calculation, modification=None, filename="kite_config.h5", disorder=None, disorder_structural=None)-
Export the lattice and related parameters to the *.h5 file.
- Parameters
-
Parameter Description lattice:pb.LatticePybinding lattice object that carries the info about the unit cell vectors, unit cell cites, hopping terms and onsite energies. config:kite.Configurationkite.Configurationobject, basic parameters defining size, precision, energy scale and number of decomposition parts in the calculation.calculation:kite.Calculationkite.Calculationobject that defines the requested functions for the calculation.modification:kite.ModificationIf specified kite.Modificationobject, has the magnetic field selection, either in terms of field, or in the number of flux quantum through the selected system.filename:strFilename for the output HDF5-file. disorder:kite.DisorderClass that introduces kite.Disorderinto the initially built lattice. For more info check thekite.Disorderclass.disorder_structural:kite.StructuralDisorderClass that introduces kite.StructuralDisorderinto the initially built lattice. For more info check thekite.StructuralDisorderclass.
-
LoudDeprecationWarning¶
- Deprecationwarning.