### Installation and Technical Remarks Source: https://docs.wannier-berri.org/en/master Information regarding installation, parallelization, and known issues. ```APIDOC ## Installation and Technical Remarks ### Parallelization Information on how to utilize parallel processing capabilities. ### Windows OS Notes specific to running Wannier-Berri on Windows operating systems. ### Known Bugs - `known bug with pyfftw`: Details a known issue related to the `pyfftw` library. ``` -------------------------------- ### Install Wannier-Berri with all dependencies Source: https://docs.wannier-berri.org/en/master/install.html Use this command to install the latest stable version of Wannier-Berri along with all its necessary dependencies. ```bash pip install wannierberri[all] ``` -------------------------------- ### Install Wannier-Berri with specific features Source: https://docs.wannier-berri.org/en/master/install.html Install Wannier-Berri with a subset of features by specifying them in the pip command. This is useful for reducing installation size or avoiding problematic dependencies. ```bash pip install wannierberri[parallel,fftw] ``` -------------------------------- ### Multi-node Cluster Setup Source: https://docs.wannier-berri.org/en/master/docs/parallel.html Instructions for setting up a multi-node Ray cluster for parallel execution using SLURM or PBS batch systems. ```APIDOC ## Multi-node Mode ### Description When more than one node are employed on a cluster, first they should be connected together into a Ray cluster. This can be done by a script suggested by gregSchwartz18 here. ### SLURM Example ```bash python -m wannierberri.cluster --batch-system slurm --exp-name wb-2nondes --num-nodes 2 --partition cmt --command "python -u example.py 2-nodes" --submit ``` ### PBS Example ```bash python -m wannierberri.cluster --batch-system pbs --exp-name wb-2nondes --num-nodes 2 --partition cmt --command "python -u example.py 2-nodes" --submit ``` ### Help For more info see: ```bash python -m wannierberri.cluster -h ``` ### Temporary Files **NOTE**: Ray will produce a lot of temporary files during running. `/tmp` is the default directory for temporary data files. More information about temporary files. If you are using a cluster, you may have no permission to delete them under `/tmp`. Please store them under the folder which under your control by adding `ray_init={'_temp_dir': Your_Path}`. Please keep `Your_Path` shorter. There is a problem if your path is long. Please check temp_dir too long bug. ``` -------------------------------- ### Get Cluster Script Help Source: https://docs.wannier-berri.org/en/master/docs/parallel.html Run this command to display the help message for the `wannierberri.cluster` module, which provides options for generating cluster scripts. ```bash python -m wannierberri.cluster -h ``` -------------------------------- ### Initialize Chiral Model Source: https://docs.wannier-berri.org/en/master/docs/models.html Creates a chirally stacked Haldane model using PythTB. Requires the pythtb package to be installed. ```python wannierberri.models.Chiral(_delta =2_, _hop1 =1_, _hop2 =0.3333333333333333_, _phi =0.3141592653589793_, _hopz_right =0.0_, _hopz_left =0.2_, _hopz_vert =0.0_) ``` -------------------------------- ### Initialize Haldane Model (PythTB) Source: https://docs.wannier-berri.org/en/master/docs/models.html Defines a Haldane model using the PythTB backend. Requires the pythtb package to be installed. ```python wannierberri.models.Haldane_ptb(_delta =0.2_, _hop1 =-1.0_, _hop2 =0.15_, _phi =1.5707963267948966_) ``` -------------------------------- ### Initialize Haldane Model (TBmodels) Source: https://docs.wannier-berri.org/en/master/docs/models.html Defines a Haldane model using the TBmodels backend. Requires the tbmodels package to be installed. ```python wannierberri.models.Haldane_tbm(_delta =0.2_, _hop1 =-1.0_, _hop2 =0.15_, _phi =1.5707963267948966_) ``` -------------------------------- ### WannierBerri Classes and Methods (S-T) Source: https://docs.wannier-berri.org/en/master/genindex.html This section details various classes and methods available in the WannierBerri library, starting with 'S' and continuing through 'T'. It includes properties, attributes, and methods related to data handling, system configuration, symmetry operations, and calculations. ```APIDOC ## WannierBerri API Reference (S-T) This document provides a reference for classes and methods within the WannierBerri library. ### Classes and Methods starting with 'S' * **SDCT** (wannierberri.data_K.data_K.Data_K property) * **seedname** (wannierberri.system.System_w90 attribute) * (wannierberri.w90files.Wannier90data attribute) * **select_bands()** (wannierberri.data_K.data_K.Data_K method) * (wannierberri.w90files.AMN method) * (wannierberri.w90files.EIG method) * (wannierberri.w90files.MMN method) * (wannierberri.w90files.SPN method) * (wannierberri.w90files.Wannier90data method) * (wannierberri.w90files.xxu.SXU method) * (wannierberri.w90files.xxu.UXU method) * **Serial** (class in wannierberri.parallel) * **set_pointgroup()** (wannierberri.system.System method) * **set_R_mat()** (wannierberri.system.System_R method) * **set_random_symmetric_projections()** (wannierberri.w90files.Wannier90data method) * **set_spin()** (wannierberri.system.System_R method) * **set_spin_from_projections()** (wannierberri.system.System_R method) * **set_spin_pairs()** (wannierberri.system.System_R method) * **set_spinor()** (wannierberri.symmetry.projections.ProjectionsSet method) * **set_structure()** (wannierberri.system.System_R method) * **set_symmetry_from_structure()** (wannierberri.system.System_R method) * **SHC** (class in wannierberri.calculators.dynamic) * (class in wannierberri.calculators.static) * **ShiftCurrent** (class in wannierberri.calculators.dynamic) * **ShiftCurrentFormula** (class in wannierberri.calculators.dynamic) * **SHU** (class in wannierberri.w90files) * **SIU** (class in wannierberri.w90files) * **Spin** (class in wannierberri.calculators.static) * (class in wannierberri.calculators.tabulate) * (class in wannierberri.formula.covariant) * **spin_order_block_to_interlace()** (wannierberri.w90files.AMN method) * (wannierberri.w90files.CheckPoint method) * **spin_order_interlace_to_block()** (wannierberri.w90files.AMN method) * (wannierberri.w90files.CheckPoint method) * **SpinBerry** (class in wannierberri.calculators.tabulate) * **SpinOmega** (class in wannierberri.formula.covariant) * **spinor** (wannierberri.symmetry.projections.Projection attribute) * **SpinVelocity** (class in wannierberri.formula.covariant) * **split()** (wannierberri.symmetry.projections.Projection method) * **split_into_orbits()** (in module wannierberri.symmetry.wyckoff_position) * **split_orbitals()** (wannierberri.symmetry.projections.ProjectionsSet method) * **SPN** (class in wannierberri.w90files) * **StaticCalculator** (class in wannierberri.calculators.static) * **stick_to_atoms()** (wannierberri.symmetry.projections.ProjectionsSet method) * (wannierberri.symmetry.wyckoff_position.WyckoffPosition method) * **str_short** (wannierberri.symmetry.projections.Projection property) * **string** (wannierberri.symmetry.wyckoff_position.WyckoffPosition attribute) * **SXU** (class in wannierberri.w90files.xxu) * **Symmetric** (class in wannierberri.formula.covariant_basic) * **symmetrize()** (wannierberri.system.System_R method) * **symmetrize2()** (wannierberri.system.System_R method) * **sympy** (wannierberri.symmetry.wyckoff_position.WyckoffPosition attribute) * **System** (class in wannierberri.system) * **System_ASE** (class in wannierberri.system) * **System_fplo** (class in wannierberri.system) * **System_PythTB** (class in wannierberri.system) * **System_R** (class in wannierberri.system) * **System_tb** (class in wannierberri.system) * **System_TBmodels** (class in wannierberri.system) * **System_w90** (class in wannierberri.system) * **SystemKP** (class in wannierberri.system) * **SystemRandom** (class in wannierberri.system) ### Classes and Methods starting with 'T' * **TABresult** (class in wannierberri.result) * **Tabulator** (class in wannierberri.calculators.tabulate) * **TabulatorAll** (class in wannierberri.calculators) * (class in wannierberri.calculators.tabulate) * **tetraWeights** (wannierberri.data_K.data_K.Data_K property) * **tildeFab** (class in wannierberri.formula.covariant_basic) * **tildeFab_d** (class in wannierberri.formula.covariant_basic) * **tildeFc** (class in wannierberri.formula.covariant_basic) * **tildeFc_d** (class in wannierberri.formula.covariant_basic) * **tildeHab** (class in wannierberri.formula.covariant_basic) * **tildeHab_d** (class in wannierberri.formula.covariant_basic) * **tildeHGab** (class in wannierberri.formula.covariant_basic) * **tildeHGab_d** (class in wannierberri.formula.covariant_basic) * **tildeHGc** (class in wannierberri.formula.covariant_basic) * **tildeHGc_d** (class in wannierberri.formula.covariant_basic) * **TR** (wannierberri.point_symmetry.PointSymmetry attribute) * **trace_ln()** (wannierberri.calculators.dynamic.Formula_dyn_ident method) * (wannierberri.calculators.dynamic.Formula_OptCond method) * (wannierberri.calculators.dynamic.Formula_SHC method) * (wannierberri.calculators.dynamic.InjectionCurrentFormula method) * (wannierberri.calculators.dynamic.ShiftCurrentFormula method) * **Transform** (class in wannierberri.point_symmetry) * **TransformProduct** (class in wannierberri.point_symmetry) ``` -------------------------------- ### SystemKP Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes a system to describe k.p Hamiltonians. ```APIDOC ## SystemKP ### Description A system to describe k.p Hamiltonians, considered as a periodic system with k-vector limited to the box defined by the reciprocal lattice. ### Parameters - **Ham** (function) - Required - The Hamiltonian function of 3D k-vector - **derHam** (function) - Optional - Cartesian k-derivative of the Hamiltonian - **der2Ham** (function) - Optional - Cartesian second k-derivative of the Hamiltonian - **der3Ham** (function) - Optional - Cartesian third k-derivative of the Hamiltonian - **kmax** (float) - Optional - Maximal k-vector - **real_lattice** (array(3,3)) - Optional - Lattice vectors of the model - **recip_lattice** (array(3,3)) - Optional - Reciprocal lattice vectors - **k_vector_cartesian** (bool) - Optional - Whether k-vector is in cartesian coordinates - **finite_diff_dk** (float) - Optional - Defines the dk in taking derivatives ``` -------------------------------- ### System_w90 Initialization Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes a system from Wannier90 output files including .chk, .eig, and optional matrix files. ```APIDOC ## System_w90 ### Description Initializes the system from Wannier functions generated by the Wannier90 code. ### Parameters - **seedname** (str) - Required - The seedname used in Wannier90. - **w90data** (Wannier90data) - Optional - Object containing all Wannier90 input files. - **transl_inv_JM** (bool) - Optional - Translational-invariant scheme for matrix elements. - **wannier_centers_from_chk** (bool) - Optional - If True, read centers from .chk file. - **npar** (int) - Optional - Number of processes for the constructor. - **fftlib** (str) - Optional - Library for FFT (fftw or numpy). - **kmesh_tol** (float) - Optional - Tolerance for b_k vector shells. - **bk_complete_tol** (float) - Optional - Tolerance for b_k shell completeness. - **symmetrize** (bool) - Optional - If True, symmetrizes R-matrices and centers. ``` -------------------------------- ### System_tb Initialization Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes a system from a tight-binding model file. ```APIDOC ## System_tb ### Description Initializes the system from a *_tb.dat file, either from Wannier90 or a custom tight-binding model. ### Parameters - **tb_file** (str) - Optional - Name and path of the file to be read. - **convention_II_to_I** (bool) - Optional - Converts convention II to convention I if True. - **wannier_centers_cart** (np.ndarray) - Optional - Overrides centers read from the file. ``` -------------------------------- ### GET /get_SS_q Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Returns the spin matrix in the Wannier gauge. ```APIDOC ## GET /get_SS_q ### Description Returns the spin matrix in the Wannier gauge. ### Parameters #### Query Parameters - **spn** (~wannierberri.w90files.SPN) - Required - The spin matrix ### Response #### Success Response (200) - **matrix** (np.ndarray) - The spin matrix in the Wannier gauge ``` -------------------------------- ### System_fplo Initialization Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes a system from the +hamdata file generated by FPLO. ```APIDOC ## System_fplo ### Description Initializes the system from the +hamdata file written by the FPLO code. ### Parameters - **hamdata** (str) - Optional - Name and path of the +hamdata file. - **mp_grid** (list) - Optional - Size of the Monkhorst-Pack grid used in ab initio calculation. ``` -------------------------------- ### GET /wannier_gauge Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Returns the matrix elements in the Wannier gauge given indices of k-points. ```APIDOC ## GET /wannier_gauge ### Description Returns the matrix elements in the Wannier gauge. ### Parameters #### Query Parameters - **mat** (np.ndarray) - Required - The matrix elements in the Hamiltonian gauge - **ik1** (int) - Required - The indices of the k-points - **ik2** (int) - Required - The indices of the k-points ### Response #### Success Response (200) - **matrix** (np.ndarray) - The matrix elements in the Wannier gauge ``` -------------------------------- ### GET /get_HH_q Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Returns the Hamiltonian matrix in the Wannier gauge based on provided eigenvalues. ```APIDOC ## GET /get_HH_q ### Description Returns the Hamiltonian matrix in the Wannier gauge. ### Parameters #### Query Parameters - **eig** (~wannierberri.w90files.EIG) - Required - The eigenvalues of the Hamiltonian ### Response #### Success Response (200) - **matrix** (np.ndarray) - The Hamiltonian matrix in the Wannier gauge ``` -------------------------------- ### GET wannierberri.smoother.get_smoother Source: https://docs.wannier-berri.org/en/master/docs/smoother.html Factory function to return a smoother object based on the specified mode and parameters. ```APIDOC ## get_smoother ### Description Returns a smoother object that applies to an array based on the provided energy range and mode. ### Parameters #### Arguments - **energy** (1D array of float) - Required - The energies on which the data are calculated at. Must be evenly spaced. - **smear** (float) - Required - Smearing parameter. Units depend on mode (Kelvin for Fermi-Dirac, eV for Gaussian). - **mode** (str or None) - Optional - Smoother mode. Options: None, "Fermi-Dirac", "Gaussian". Default: None. ### Request Example ```python smoother = wannierberri.get_smoother(efermi, 300, "Fermi-Dirac") ``` ``` -------------------------------- ### System_ASE Initialization Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes a system from Wannier functions generated by ASE. ```APIDOC ## System_ASE ### Description Initializes the system from an ASE Wannier object. ### Parameters - **ase_wannier** (object) - Required - An object of ASE Wannier. ``` -------------------------------- ### GET /get_wannier_centers Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Calculates Wannier centers using the Marzarri-Vanderbilt translational invariant formula, with an optional calculation of spreads. ```APIDOC ## GET /get_wannier_centers ### Description Calculate wannier centers with the Marzarri-Vanderbilt translational invariant formula and optionally the spreads. ### Parameters #### Query Parameters - **mmn** (MMN) - Required - The overlap matrix elements between the Wavefunctions at neighbouring k-points - **spreads** (bool) - Optional - If True, the spreads are calculated ### Response #### Success Response (200) - **centers** (np.ndarray) - The wannier centers (shape=(num_wann, 3), dtype=float) - **spreads** (np.ndarray) - The wannier spreads (in Angstrom^2) (if spreads=True, shape=(num_wann,), dtype=float) ``` -------------------------------- ### System_PythTB Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes the System class from a PythTB tight-binding model. ```APIDOC ## System_PythTB ### Description Initializes the System class from a tight-binding model created with PythTB. It defines the Hamiltonian matrix Ham_R and the AA_R matrix used to calculate Berry related quantities. ### Parameters - **ptb_model** (class) - Required - Name of the PythTB tight-binding model class. ``` -------------------------------- ### Get orbit and symmetry operations Source: https://docs.wannier-berri.org/en/master/docs/projections_searcher.html Retrieves the orbit of a point along with the associated rotation matrices and translation vectors. ```python wannierberri.symmetry.projections.orbit_and_rottrans(_spacegroup_ , _p_)[source] ``` -------------------------------- ### Run postw90.x emulator via command line Source: https://docs.wannier-berri.org/en/master/docs/postw90.html Execute the emulator using the Python module flag, specifying the seedname and optional parameters or library configurations. ```bash python3 -m wannierberri.utils.postw90 seedname [parameters] [ __wb_fft_lib= ] ``` -------------------------------- ### postw90.x Configuration for Benchmarking Source: https://docs.wannier-berri.org/en/master/benchmark.html This is the corresponding `.win` file configuration for postw90.x to match the Wannier-Berri script. Key parameters like `transl_inv=F` and `berry_kmesh` should align with the script's settings. ```win fermi_energy_min=11 fermi_energy_max=14 fermi_energy_step=0.01 berry = T berry_task = ahc berry_kmesh = 50 50 50 # the followinfg parameters are at default values, so may be omitted in the .win file: transl_inv=F use_ws_distance=T berry_curv_adpt_kmesh = 1 ``` -------------------------------- ### System Class Initialization Source: https://docs.wannier-berri.org/en/master/docs/system.html The base class for describing a system. Child classes like System_w90 or System_tb should be used for instantiation. ```APIDOC ## System Class ### Description The base class for describing a system. It is not intended for direct instantiation; use child classes such as `System_w90` or `System_tb`. ### Parameters #### Initialization Parameters - **periodic** (list[bool, bool, bool]) - Optional - Defines periodic directions (True) and confined directions (False). Defaults to [True, True, True]. If fewer than 3 values are provided, the remaining are treated as False. - **frozen_max** (float) - Optional - The upper edge of the frozen window, used for orbital moment evaluation. Not strictly necessary. - **NKFFT** (tuple or list) - Optional - The FFT grid to be used in calculations. Defaults to None. - **force_internal_terms_only** (bool) - Optional - If True, only internal terms (Hamiltonian and spin) are evaluated, excluding external or cross terms. Defaults to False. - **name** (str) - Optional - A name for the system, used for output file naming. Defaults to 'wberri'. - **silent** (bool) - Optional - If True, suppresses informational output about the system. Defaults to False. ### Notes - The system is defined by its real lattice, symmetry group, and Hamiltonian. - Lattice vectors are provided in Cartesian coordinates. - The symmetry group is defined by its generators and is further evaluated by the code. - Hopping terms between orbitals constitute the Hamiltonian, specified in real space. - Systems can be either periodic or confined in specific directions. ``` -------------------------------- ### SystemRandom Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes a randomly generated system, primarily for testing purposes. ```APIDOC ## SystemRandom ### Description Randomly generated system for testing. Can be symmetrized to get a generic system with certain symmetries. ### Parameters - **num_wann** (int) - Required - Number of Wannier functions - **nRvec** (int) - Optional - Number of R-space vectors - **real_lattice** (array(3,3)) - Optional - Real lattice vectors - **max_R** (float) - Optional - Maximal coordinate in the R-vectors ``` -------------------------------- ### Get Symmetric Tensor Components Source: https://docs.wannier-berri.org/en/master/docs/point_symmetries.html Determines which components of a tensor are non-zero and identifies components that are equal or opposite due to symmetry. This helps in understanding the independent components of a tensor. ```python components_info = point_group.get_symmetric_components(rank=2, TRodd=False, Iodd=False) ``` -------------------------------- ### Configure Temporary Directory for Ray Source: https://docs.wannier-berri.org/en/master/docs/parallel.html When using Ray on a cluster where `/tmp` might not be writable, specify a custom temporary directory using `ray_init`. Ensure the provided path is relatively short to avoid potential issues. ```python from wannierberri.parallel import Parallel # Example: Set a custom temporary directory for Ray parallel_obj = Parallel(ray_init={'_temp_dir': '/path/to/your/temp_dir'}) ``` -------------------------------- ### Grid and Path Utilities Source: https://docs.wannier-berri.org/en/master Classes for defining and manipulating k-point grids and paths. ```APIDOC ## GridAbstract ### Description Abstract base class for k-point grids. ### Methods - `get_K_list()`: Returns the list of k-points. ### Attributes - `points_FFT`: Points for FFT. ## Grid ### Description Represents a regular k-point grid. ## GridTetra ### Description Represents a k-point grid suitable for tetrahedron integration. ## GridTrigonal ### Description Represents a k-point grid for trigonal crystal systems. ## GridTrigonalH ### Description Represents a k-point grid for trigonal systems with hexagonal axes. ## Path ### Description Represents a path through k-space, often used for plotting band structures. ``` -------------------------------- ### System_TBmodels Source: https://docs.wannier-berri.org/en/master/docs/system.html Initializes the System class from a TBmodels tight-binding model. ```APIDOC ## System_TBmodels ### Description Initializes the System class from a tight-binding model created with TBmodels. It defines the Hamiltonian matrix Ham_R and the AA_R matrix used to calculate Berry related quantities. ### Parameters - **tbmodel** (object) - Required - Name of the TBmodels tight-binding model object. ``` -------------------------------- ### Initialize Parallel Execution Object Source: https://docs.wannier-berri.org/en/master/docs/parallel.html Use the `Parallel` class to define parameters for parallel evaluation. Set `num_cpus` for the number of processes, `npar_k` for k-point parallelization, and `cluster` to `True` for multi-node Ray clusters. Configure `ray_init` for custom Ray initialization, and `progress_step_percent` to control progress reporting. ```python from wannierberri.parallel import Parallel # Example: Initialize with 4 CPUs and additional k-point parallelization parallel_obj = Parallel(num_cpus=4, npar_k=2) ``` -------------------------------- ### Run vaspspn utility Source: https://docs.wannier-berri.org/en/master/docs/vaspspn.html Execute the vaspspn utility via the command line to process VASP WAVECAR files. ```bash python3 -m wannierberri.utils.vaspspn option=value ``` -------------------------------- ### W90files Handling Source: https://docs.wannier-berri.org/en/master/genindex.html This section details classes related to handling W90 files. ```APIDOC ## MMN (class in wannierberri.w90files) ### Description Represents and handles data from MMN files. ### Method N/A (Class definition) ### Endpoint N/A (Internal library function) ``` -------------------------------- ### System Management API Source: https://docs.wannier-berri.org/en/master/documentation.html Classes for defining and managing physical systems in real and k-space. ```APIDOC ## System Classes ### Description Classes used to define the physical system for calculations. ### Classes - **System** - Base class for system definitions - **System_R** - Class for real-space systems, including support for symmetrization and tight-binding models ``` -------------------------------- ### Generate PBS Cluster Script Source: https://docs.wannier-berri.org/en/master/docs/parallel.html This command generates a script to set up a multi-node Ray cluster using PBS. Specify the number of nodes, partition, experiment name, and the command to run on each node. ```bash python -m wannierberri.cluster --batch-system pbs --exp-name wb-2nondes --num-nodes 2 --partition cmt --command "python -u example.py 2-nodes" --submit ``` -------------------------------- ### Generate DMN and Wannier90 output using Wannier Berri Source: https://docs.wannier-berri.org/en/master/docs/wannierisation.html Initializes Wannier90 data, defines band structures and projections, and executes the Wannierization process. ```python from wannierberri.symmetry.projections import Projection, ProjectionsSet from irrep.bandstructure import BandStructure import wannierberri as wb path_data = "../../tests/data/Fe-222-pw/" w90data = wb.w90files.Wannier90data(seedname=path_data + "Fe", readfiles=["mmn", "eig", "win", ], read_npz=True) bandstructure = BandStructure(code='espresso', prefix=path_data + "/Fe", Ecut=200, normalize=True, magmom=[[0, 0, 1.]], include_TR=True, ) spacegroup = bandstructure.spacegroup spacegroup.show() # exit() # symmetrizer = wb.symmetry.sawf.SymmetrizerSAWF().from_npz(path_data + f"/Fe_TR={False}.sawf.npz") symmetrizer = wb.symmetry.sawf.SymmetrizerSAWF().from_irrep(bandstructure) projection_s = Projection(orbital='s', position_num=[0, 0, 0], spacegroup=spacegroup) projection_p = Projection(orbital='p', position_num=[0, 0, 0], spacegroup=spacegroup) projection_d = Projection(orbital='d', position_num=[0, 0, 0], spacegroup=spacegroup) projection_sp3d2 = Projection(orbital='sp3d2', position_num=[0, 0, 0], spacegroup=spacegroup) projection_t2g = Projection(orbital='t2g', position_num=[0, 0, 0], spacegroup=spacegroup) # projections_set = ProjectionsSet(projections=[projection_s, projection_p, projection_d]) projections_set = ProjectionsSet(projections=[projection_sp3d2, projection_t2g]) symmetrizer.set_D_wann_from_projections(projections_set) amn = wb.w90files.amn_from_bandstructure(bandstructure, projections=projections_set) w90data.set_symmetrizer(symmetrizer) w90data.set_file("amn", amn) w90data.select_bands(win_min=-8, win_max=50) w90data.wannierise(init="amn", froz_min=-10, froz_max=20, print_progress_every=10, num_iter=101, conv_tol=1e-10, mix_ratio_z=1.0, sitesym=True, parallel=False ) system = wb.system.System_w90(w90data=w90data, berry=True) # Now do whatever you want with the system, as if it was created with Wannier90 ``` -------------------------------- ### Benchmarking Source: https://docs.wannier-berri.org/en/master Information on benchmarking the software. ```APIDOC ## Benchmarking ### Benchmarking with `postw90.x` Details on how to benchmark Wannier-Berri against the `postw90.x` code. ``` -------------------------------- ### Generate .uHu, .sHu, .sIu files with mmn2uHu Source: https://docs.wannier-berri.org/en/master/docs/mmn2uHu.html Use this command to generate .uHu, .sHu, and/or .sIu files from .mmn, .spn, and .eig files. Specify the number of output bands (NBout) and summation bands (NBsum) to control convergence. The 'targets' option specifies which files to write, and 'formatted' ensures output files are in a readable format. ```bash python3 -m wannierberri.utils.mmn2uHu seedname NBout=10 NBsum=100,200 targets=mmn,uHu formatted=uHu ``` -------------------------------- ### from_w90_file(seedname, formatted, suffix, **kwargs) Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Reads sHu or sIu files into the SXU object. ```APIDOC ## from_w90_file(seedname, formatted, suffix, **kwargs) ### Description Reads the sHu or sIu file and sets up the data structure. ### Parameters #### Request Body - **seedname** (str) - Optional - The prefix of the file (including path, excluding extension). - **formatted** (bool) - Optional - If True, the file is expected to be formatted; otherwise, it is binary. - **suffix** (str) - Optional - The suffix of the file (e.g., 'sHu', 'sIu'). - **kwargs** (dict) - Optional - Keyword arguments passed to the file constructor. ``` -------------------------------- ### Initialize PointSymmetry Source: https://docs.wannier-berri.org/en/master/docs/point_symmetries.html Initializes a general PointSymmetry object with a rotation matrix R and an optional time reversal flag. ```python symmetry_op = PointSymmetry(R=np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), TR=False) ``` -------------------------------- ### POST /run Source: https://docs.wannier-berri.org/en/master/docs/run.html Executes a calculation in WannierBerri, supporting both integration and tabulation in a single run. ```APIDOC ## POST /run ### Description The run() function performs integration and tabulation of quantities. It replaces the obsolete integrate() and tabulate() functions. ### Method POST ### Parameters #### Request Body - **system** (System) - Required - System under investigation - **grid** (Grid or Path) - Required - Initial grid for integration or path for tabulation - **calculators** (dict) - Required - Dictionary of Calculator objects - **adpt_num_iter** (int) - Optional - Number of recursive adaptive refinement iterations - **adpt_mesh** (int) - Optional - Size of the refinement grid - **adpt_fac** (int) - Optional - Number of K-points to be refined per quantity and criteria - **parallel** (Parallel) - Optional - Object describing parallelization scheme - **use_irred_kpt** (bool) - Optional - Evaluate only symmetry-irreducible K-points - **symmetrize** (bool) - Optional - Symmetrize the result - **fout_name** (str) - Optional - Beginning of the output files - **suffix** (str) - Optional - Extra marker for output files - **print_Kpoints** (bool) - Optional - Print the list of K points - **file_Klist** (str) - Optional - Name of file to store Kpoint list - **restart** (bool) - Optional - Read restart information from file_Klist - **Klist_part** (int) - Optional - Write file_Klist in portions - **parameters_K** (dict) - Optional - Parameters passed to Data_K class - **fast_iter** (bool) - Optional - Toggle for fast iteration mode - **print_progress_step** (float/int) - Optional - Intervals to print progress ### Response #### Success Response (200) - **result** (dictionary of EnergyResult) - The calculated results ``` -------------------------------- ### write(seedname, comment) Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Writes the wannier90.win file with specified parameters. ```APIDOC ## write(seedname, comment) ### Description Writes the wannier90.win file. ### Parameters #### Request Body - **seedname** (str) - Optional - The prefix of the file (including path, excluding extension). If None, defaults to self.seedname + ".win". - **comment** (str) - Optional - The comment to be written at the beginning of the file. ``` -------------------------------- ### WannierBerri WIN File Handler Source: https://docs.wannier-berri.org/en/master/docs/w90_files.html Class for reading and storing the wannier90.win input file. ```APIDOC ## Class wannierberri.w90files.WIN ### Description Class to read and store the wannier90.win input file. ### Parameters - **seedname** (str) - Required - The prefix of the file. - **data** (dict) - Optional - Initial data. - **autoread** (bool) - Optional - Whether to read automatically. ### Methods - **get_kpoints()**: Returns numpy.ndarray(float, shape=(NK, 3)) of kpoints in reciprocal coordinates. - **get_projections()**: Returns list(str) of projections. - **get_unit_cell_cart_ang()**: Returns numpy.ndarray(float, shape=(3, 3)) of the unit cell in Angstrom. - **update(dic)**: Updates the parameters with a dictionary. ``` -------------------------------- ### POST /system/structure Source: https://docs.wannier-berri.org/en/master/docs/system.html Sets the atomic structure of the system, including positions, labels, and optional magnetic moments. ```APIDOC ## POST /system/structure ### Description Sets the atomic structure of the system. This must be called before setting symmetry. ### Parameters #### Request Body - **positions** (array_like) - Required - Atomic positions in fractional coordinates (num_atom, 3). - **atom_labels** (list) - Required - Labels to distinguish species. - **magnetic_moments** (array_like) - Optional - Magnetic moment vector of each atom (num_atom, 3). ``` -------------------------------- ### Initialize TransformProduct Source: https://docs.wannier-berri.org/en/master/docs/point_symmetries.html Constructs a composite Transform object from a list of individual Transform objects. This allows combining multiple transformations. ```python combined_transform = TransformProduct([transform1, transform2]) ``` -------------------------------- ### External Software Source: https://docs.wannier-berri.org/en/master List of external software dependencies. ```APIDOC ## External Software ### External software used Lists the third-party software packages that Wannier-Berri relies on. ``` -------------------------------- ### System_R Class API Source: https://docs.wannier-berri.org/en/master/docs/system.html The System_R class handles real-space systems, including Wannier function centers, lattice parameters, and symmetrization routines. ```APIDOC ## System_R Class ### Description Handles real-space tight-binding models and Wannier function data. ### Attributes - **needed_R_matrices** - Required R-matrices for the calculation. - **npar** - Number of parameters. - **wannier_centers_cart** - Wannier centers in Cartesian coordinates. - **wannier_centers_red** - Wannier centers in reduced coordinates. - **num_wann** - Number of Wannier functions. - **real_lattice** - Real-space lattice vectors. - **NKFFT_recommended** - Recommended FFT grid size. ### Methods - **set_R_mat()** - Sets the R-matrices. - **set_spin()** - Configures spin properties. - **set_spin_pairs()** - Sets spin pair interactions. - **set_spin_from_projections()** - Configures spin based on projections. - **set_structure()** - Defines the atomic structure. - **set_symmetry_from_structure()** - Automatically determines symmetry from structure. - **symmetrize()** - Performs system symmetrization. - **symmetrize2()** - Performs alternative system symmetrization. ``` -------------------------------- ### POST /system/symmetry Source: https://docs.wannier-berri.org/en/master/docs/system.html Sets the symmetry group of the system using spglib. Requires the structure to be set first. ```APIDOC ## POST /system/symmetry ### Description Sets the symmetry group of the System. Requires spglib to be installed and System.set_structure() to be called in advance. ``` -------------------------------- ### Run cluster script with Slurm/PBS Source: https://docs.wannier-berri.org/en/master/docs/cluster.html Use this command to submit jobs to a Slurm or PBS batch system. Specify the batch system, job name, number of nodes, partition, and the command to run. ```bash python -m wannierberri.cluster –batch-system –exp-name –num-nodes –partition cmt –command “” ``` -------------------------------- ### GridAbstract API Source: https://docs.wannier-berri.org/en/master/docs/grid.html Documentation for the GridAbstract base class used for defining k-space grids. ```APIDOC ## GridAbstract ### Description Base class for defining k-space grids used in WannierBerri calculations. ### Methods - **get_K_list()**: Returns the list of k-points defined in the grid. ### Attributes - **points_FFT**: Property representing the grid points formatted for FFT operations. ``` -------------------------------- ### Models Source: https://docs.wannier-berri.org/en/master Available models for electronic structure calculations. ```APIDOC ## Models ### Available Models - `Chiral()`: A model related to chiral symmetry. - `Haldane_ptb()`: The Haldane model, possibly in a perturbative (ptb) formulation. - `Haldane_tbm()`: The Haldane model, possibly in a tight-binding (tbm) formulation. ``` -------------------------------- ### Method: ln(ik, inn, out) Source: https://docs.wannier-berri.org/en/master/docs/formula.html Returns the submatrix Xln at a specific point ik, where l is in the output set and n is in the input set. ```APIDOC ## ln(ik, inn, out) ### Description Returns the submatrix Xln at point ik, where l belongs to the output set and n belongs to the input set. ### Parameters #### Path Parameters - **ik** (int) - Required - The index of the k-point. - **inn** (list) - Required - The set of input indices. - **out** (list) - Required - The set of output indices. ``` -------------------------------- ### Methods Source: https://docs.wannier-berri.org/en/master Detailed explanation of the mathematical and computational methods employed. ```APIDOC ## Methods ### General Equations for Wannier Interpolation Provides the fundamental equations used for Wannier interpolation. ### Mixed Fourier Transform Describes the implementation and usage of mixed Fourier transforms. ### Symmetries Details how crystal symmetries are handled and utilized. ### Recursive Adaptive Refinement Explains the method of recursive adaptive refinement for calculations. ### Minimal-Distance Replica Selection Method Describes the method for selecting minimal-distance replicas. ``` -------------------------------- ### Data Structures and Methods Source: https://docs.wannier-berri.org/en/master Details on the data structures and associated methods for handling K-point data. ```APIDOC ## Data Structures ### `Data_K_R` This structure likely handles data related to the R-space (real space) representation of K-point data. #### Methods - `HH_K`: Likely retrieves or computes the HH (Hamiltonian or similar) matrix in K-space. - `Xbar()`: A method for computing or accessing the Xbar quantity. - `get_R_mat()`: Retrieves the R-matrix, possibly related to lattice translations or Wannier functions. ### `Data_K_k` This structure likely handles data related to the k-space (reciprocal space) representation of K-point data. #### Methods - `E_K_corners_parallel()`: Computes energy-related quantities at the corners of the Brillouin zone, possibly in a parallel manner. - `E_K_corners_tetra()`: Computes energy-related quantities at the corners of the Brillouin zone using a tetrahedral method. - `HH_K`: Likely retrieves or computes the HH matrix in K-space. - `Xbar()`: A method for computing or accessing the Xbar quantity. ``` -------------------------------- ### Apply Fermi-Dirac smoothing to data Source: https://docs.wannier-berri.org/en/master/docs/smoother.html Use get_smoother to initialize a smoother object with specific energy and temperature parameters, then apply it to a data array. ```python smoother = wannierberri.get_smoother(efermi, 300, "Fermi-Dirac") data_smooth = smoother(data) ``` -------------------------------- ### Perform Wannierisation and Localization Source: https://docs.wannier-berri.org/en/master/docs/wannierisation.html Use `wannierise.wannierise()` to perform disentanglement and maximal localization of bands. It can optionally use site symmetry and a frozen window. Ensure `ray` is initialized if parallel execution is desired. ```python wannierise.wannierise(_froz_min =inf_, _froz_max =-inf_, _num_iter =1000_, _conv_tol =1e-09_, _num_iter_converge =3_, _mix_ratio_z =0.5_, _mix_ratio_u =1_, _print_progress_every =10_, _sitesym =False_, _localise =True_, _init ='amn'_, _num_wann =None_, _parallel =True_, _symmetrize_Z =True_) ``` -------------------------------- ### Generate SLURM Cluster Script Source: https://docs.wannier-berri.org/en/master/docs/parallel.html This command generates a script to set up a multi-node Ray cluster using SLURM. Specify the number of nodes, partition, experiment name, and the command to run on each node. ```bash python -m wannierberri.cluster --batch-system slurm --exp-name wb-2nondes --num-nodes 2 --partition cmt --command "python -u example.py 2-nodes" --submit ``` -------------------------------- ### EBRsearcher Class Initialization Source: https://docs.wannier-berri.org/en/master/docs/projections_searcher.html Initializes the EBRsearcher class to search for EBRs that cover the frozen window while fitting into the outer window. ```APIDOC ## Class: EBRsearcher ### Description A class to search for EBRs that cover the frozen window, but fit into the outer window. ### Parameters - **symmetrizer** (SymmetrizerSAWF) - Required - The file of symmetry properties. - **froz_min** (float) - Required - Minimum energy of the frozen window. - **froz_max** (float) - Required - Maximum energy of the frozen window. - **outer_min** (float) - Required - Minimum energy of the outer window. - **outer_max** (float) - Required - Maximum energy of the outer window. - **degen_thresh** (float) - Optional - Threshold to consider bands as degenerate. - **trial_projections_set** (ProjectionsSet) - Optional - The set of trial projections. - **debug** (bool) - Optional - If True, print debug information. ``` -------------------------------- ### Calculator Class Initialization Source: https://docs.wannier-berri.org/en/master/docs/calculators.html The base class for all calculators in WannierBerri, used to define parameters for saving results and handling band degeneracy. ```APIDOC ## class wannierberri.calculators.Calculator ### Description Initializes the base calculator object for WannierBerri calculations. ### Parameters - **degen_thresh** (float) - Optional - Threshold (in eV) to consider bands as degenerate. Default: 0.0001 - **degen_Kramers** (bool) - Optional - Whether to consider all bands as Kramers degenerate. Default: False - **save_mode** (str) - Optional - Format for saving results: 'bin', 'txt', or 'bin+txt'. Default: 'bin+txt' - **print_comment** (bool) - Optional - Whether to print the comment or docstring during initialization. Default: False ``` -------------------------------- ### Initialize Mirror Symmetry Source: https://docs.wannier-berri.org/en/master/docs/point_symmetries.html Initializes a Mirror symmetry object. The mirror plane is defined by its normal vector in Cartesian coordinates. ```python mirror_plane = Mirror(axis=[0, 0, 1]) ``` -------------------------------- ### Formula_ln Methods Source: https://docs.wannier-berri.org/en/master/docs/formula.html Common methods available across various formula classes like Der2A, Der2B, Der2H, etc. ```APIDOC ## Formula_ln Methods ### Description Standard methods for retrieving submatrices from formula objects. ### Methods - **ln(ik, inn, out)**: Returns the submatrix Xln at point ik, where l is in the out set and n is in the inn set. - **nn(ik, inn, out)**: Returns the submatrix Xnn' at point ik, where n,n' are in the inn set. ```