.. _basic: Basic functions in mcu ====================== You can use the code by either writing a simple python script. .. code-block:: bash $ python mymcu.py or work interactively in python environment (I prefer this way): .. code-block:: bash $ python **Compute bandgap and Fermi level:** **mcu.VASP** works with vasprun.xml and OUTCAR (optional). OUTCAR is only used in case Fermi level cannot be read from vasprun.xml .. code-block:: python :linenos: import mcu mymcu = mcu.VASP() # Define an mcu object mymcu.get_bandgap() # Get the bandgap mymcu.efermi # Get Fermi level **WAVEDER and WAVEDERF file can be read from mcu** .. code-block:: python :linenos: import mcu cder, nodesn_i_dielectric_function, wplasmon = mcu.read_WAVEDER(waveder = 'WAVEDER') cder = mcu.read_WAVEDERF(wavederf = 'WAVEDERF') **Generate k-mesh list from a k-path** Providing a high symmetric k-point coordinates and labels (can be get from `BCS `_), **mcu** can generate KPOINTS file following a k-path. This k-mesh is used to compute band structure in the unconventional way (e.g. hydrib functional). You need to copy the k-mesh (for SCF) from IBZKPT file to the KPOINTS file generated by **mcu**. .. code-block:: python :linenos: import mcu kpath =''' Y 0.5 0.0 0.0 G 0.0 0.0 0.0 X 0.0 0.5 0.0 R 0.5 0.5 0.0 Y-G-R-X-G ''' kmesh = mcu.make_KPOINTS(kpath, npoint=10)