Running a calculation

On a grip or path

In the new API with the run() method one can do integration and tabulating in one run. Also, different parameters may be used for different quantities and also same qantities may be calculated with different sets of parameters in one run. This is done by calling the following function:

wannierberri.run(system, grid, calculators, adpt_num_iter=0, use_irred_kpt=True, symmetrize=True, fout_name='result', suffix='', parameters_K=None, file_Klist=None, restart=False, Klist_part=10, parallel=None, print_Kpoints=False, adpt_mesh=2, adpt_fac=1, fast_iter=True, print_progress_step=5)[source]

The function to run a calculation. Substitutes the old (obsolete and removed) integrate() and tabulate() and allows to integrate and tabulate in one run.

Parameters:
  • system (System) – System under investigation

  • grid (Grid or Path) – initial grid for integration. or path for tabulation

  • calculators (dict) – a dictionary where keys aare any string identifiers, and the values are of Calculator

  • adpt_num_iter (int) – number of recursive adaptive refinement iterations. See Recursive adaptive refinement

  • adpt_mesh (int) – the size of the refinement grid (usuallay no need to change)

  • adpt_fac (int) – number of K-points to be refined per quantity and criteria.

  • parallel (Parallel) – object describing parallelization scheme

  • use_irred_kpt (bool) – evaluate only symmetry-irreducible K-points

  • symmetrize (bool) – symmetrize the result (always True if use_irred_kpt == True)

  • fout_name (str) – beginning of the output files for each quantity after each iteration

  • suffix (str) – extra marker inserted into output files to mark this particular calculation run

  • print_Kpoints (bool) – print the list of K points

  • file_Klist (str or None) – name of file where to store the Kpoint list of each iteration. May be needed to restart a calculation to get more iterations. If None – the file is not written

  • restart (bool) – if True : reads restart information from file_Klist and starts from there

  • Klist_part (int) – write the file_Klist by portions. Increase for speed, decrease for memory saving

  • parameters_K (dict) – parameters to be passed to Data_K class

  • fast_iter (bool) – if under iterations appear peaks that arte not further removed, set this parameter to False.

  • print_progress_step (float or int) – intervals to print progress

Return type:

dictionary of EnergyResult

Notes

Results are also printed to ASCII files

Single k-point

Sometimes, ot os needed to evaluate some properties at a single k-point. To make it simple a functions is provided:

wannierberri.evaluate_k(system=None, k=(0.0, 0.0, 0.0), quantities=(), calculators=None, formula=None, param_formula=None, iband=None, return_single_as_dict=False, parameters_K=None)[source]

This function presents a shortcut to evaluate some property at a particular k-point The main goal is to be convenient, rather than efficient

Parameters:
  • system (System) – system for which the calculation is performed

  • k (tuple) – 3 numbers denoting the k-vector in reciprocal lattice vectors (reduced coordinates)

  • quantities (list of str) – Which pre-defined quantities to calculate. Use evaluate() to get the list of available quantities

  • calculators (dict) – Dictionary str : Calculator alows to evaluate quantities that are not available here, or using specific parameters

  • formula (dict) – Dictionary str : Formula_ln allows to evaluate block-diagonal part of a covariant formula (considering iband as “inner” states)

  • param_formula (dict) – Dictionary str : dict -parameters to be passed to the corresponding formula

  • return_single_as_dict (bool) – wether to pack a result into dict if only one calculator/quantity is requested

  • parameters_K (dict) – parameters to be passed to Data_K class

  • iband (int or list(int)) – bands to select (only for quantities and formula

Returns:

Returns a dictionary {key:array} where keys are strings identifying the calculated quantities, if only one quantity is calculated and return_single_as_dict=False, then only an array is returned, without packing into dict

Return type:

dict or array

on a path (simple)

While calculation on a k-path may be done with the run method, and a Path object, for simplicity there is a shortcut function:

wannierberri.evaluate_k_path(system, nodes=None, labels=None, length=500, path=None, tabulators=None, ibands=None, quantities=(), parallel=None, return_path=None, **kwargs)[source]

Evaluate a quantity along a path in the reciprocal space

Parameters:
  • system (System) – system for which the calculation is performed

  • nodes (list of tuples) – list of k-points in reduced coordinates (3 numbers for each point) (see also Path)

  • labels (list of str) – labels for the k-points (see also Path)

  • length (int) – number of points along the path (see also Path)

  • path (Path) – if provided, then the path is not created, but used as is (overriding nodes and labels)

  • return_path (bool) – if True, then the path object is returned as well. If None - it is set to True if k_path is None (i.e. when the path is created here)

  • kwargs – additional parameters to be passed to run()

Returns:

  • path (Path) – the path object (if return_path=True)

  • result (TABresult) – the result of the calculation

Notes

See also Path for the description of the path object (parameters nodes, labels, length)