easyunfold.cli#

Commandline interface

Module Contents#

Functions#

easyunfold

Tool for performing band unfolding

generate

Generate the kpoints for performing supercell calculations.

unfold

Perform unfolding and plotting

unfold_status

Print the status

unfold_calculate

Perform the unfolding

add_mpl_style_option

Decorator that adds the mpl_style_file option to a command

unfold_effective_mass

Compute and print effective masses by tracing the unfolded weights.

add_plot_options

Decorator that adds common plotting options to a function

unfold_plot

Plot the spectral function

process_dos

Process the DOS data for plotting, and return the SDOSPlotter object and dos_options dict.

unfold_plot_projections

Plot the effective band structure with atomic projections.

_unfold_plot

Routine for plotting the spectral function.

print_symmetry_data

Print the symmetry information

matrix_from_string

Parse transformation matrix from a string

Data#

SUPPORTED_DFT_CODES

DEFAULT_CMAPS

CONTEXT_SETTINGS

API#

easyunfold.cli.SUPPORTED_DFT_CODES#

(‘vasp’, ‘castep’)

easyunfold.cli.DEFAULT_CMAPS#

[‘Purples’, ‘Greens’, ‘Oranges’, ‘Reds’, ‘Blue’, ‘YlOrBr’, ‘YlOrRd’, ‘OrRd’, ‘PuRd’, ‘RdPu’, ‘BuPu’,…

easyunfold.cli.CONTEXT_SETTINGS#

None

easyunfold.cli.easyunfold()#

Tool for performing band unfolding

easyunfold.cli.generate(pc_file, code, sc_file, matrix, kpoints, time_reversal, out_file, no_expand, symprec, nk_per_split, scf_kpoints, yes, separate_folders)#

Generate the kpoints for performing supercell calculations.

There are two modes of running supercell calculations:

  1. Use the generated kpoints for unfolding for non-SCF calculations, e.g. with a fixed charged density from the SCF calculation.

  2. Include the generated kpoints in SCF calculation but set their weights to zeros.

In both cases, the kpoints can be split into multiple calculations.

This command defaults to go down the first route where the kpoints generated are only those needed for the unfolding, all kpoints and written into the same file, but the user is free to manually split them into multiple calculations. The second approach can be activated with the --nk-per-split option and in the same time provide the --scf-kpoints. This will generate a serial of kpoints files containing the SCF kpoints followed by the actual kpoints needed for unfolding with zero weights.

easyunfold.cli.unfold(ctx, data_file)#

Perform unfolding and plotting

There are multiple sub-command available under this command group.

easyunfold.cli.unfold_status(ctx)#

Print the status

easyunfold.cli.unfold_calculate(ctx, wavefunc, save_as, gamma, ncl)#

Perform the unfolding

Multiple wave function (e.g. the WAVECAR file if using VASP) files can be supplied for split-path calculations. Once the calculation is done, the wave function data are not longer needed as the spectral weights will be stored in the outputs json file.

easyunfold.cli.add_mpl_style_option(func)#

Decorator that adds the mpl_style_file option to a command

easyunfold.cli.unfold_effective_mass(ctx, intensity_threshold, spin, band_filter, npoints, extrema_detect_tol, nocc, plot, plot_fit, fit_label, out_file, emin, emax, manual_extrema)#

Compute and print effective masses by tracing the unfolded weights.

Note that this functionality only works for simple unfolded band structures, and it is likely to fail for complex cases.

Use the --plot-fit flag to generate the detected band edge verses the parabolic fit for visual confirmation if unsure.

easyunfold.cli.add_plot_options(func)#

Decorator that adds common plotting options to a function

easyunfold.cli.unfold_plot(ctx, npoints, sigma, eref, out_file, show, emin, emax, cmap, no_symm_average, vscale, dos, dos_label, zero_line, dos_elements, dos_orbitals, dos_atoms, legend_cutoff, gaussian, no_total, total_only, scale, procar, atoms, poscar, atoms_idx, orbitals, title, width, height, dpi, intensity)#

Plot the spectral function

This command uses the stored unfolding data to plot the effective bands structure (EBS) using the spectral function.

easyunfold.cli.process_dos(dos, dos_elements, dos_orbitals, dos_atoms, gaussian, total_only, atoms, orbitals, poscar, no_total, legend_cutoff, scale)#

Process the DOS data for plotting, and return the SDOSPlotter object and dos_options dict.

easyunfold.cli.unfold_plot_projections(ctx, npoints, sigma, eref, out_file, show, emin, emax, cmap, no_symm_average, vscale, dos, dos_label, zero_line, dos_elements, dos_orbitals, dos_atoms, legend_cutoff, gaussian, no_total, total_only, scale, procar, atoms, poscar, atoms_idx, orbitals, title, combined, colours, colourspace, width, height, dpi, intensity)#

Plot the effective band structure with atomic projections.

easyunfold.cli._unfold_plot(ctx, npoints, sigma, eref, out_file, show, emin, emax, cmap, no_symm_average, vscale, dos, dos_label, zero_line, dos_elements, dos_orbitals, dos_atoms, legend_cutoff, gaussian, no_total, total_only, scale, procar, atoms, poscar, atoms_idx, orbitals, title, width, height, dpi, intensity, ax=None)#

Routine for plotting the spectral function.

easyunfold.cli.print_symmetry_data(kset)#

Print the symmetry information

easyunfold.cli.matrix_from_string(string)#

Parse transformation matrix from a string