gvasp.common package

gvasp.common.base module

class gvasp.common.base.Atom(*args, **kwargs)[源代码]

基类:object

Atom class represent one atom in periodic solid system

formula

chemical formula

Type:

str

number

atomic number

Type:

int

period

atomic period in element period table

Type:

int

group

atomic group in element period table

Type:

int

color

atomic color using RGB

Type:

str

order

atomic order in <Structure class>, default: 0

Type:

int

frac_coord

fractional coordinates

Type:

np.ndarray

cart_coord

cartesian coordinates

Type:

np.ndarray

_default_bonds

atomic default bond property {atom: bond-length}

atom_type(self) property

register atom_type property

set_coord(self, lattice

Lattice) -> object: recalculate frac_coord from cart_coord / recalculate cart_coord from frac_coord

search_image(atom_i, atom_j) np.ndarray[源代码]

search the nearest image in which have minimum distance between two atoms

__load_config(cls)

load element.yaml file

__initialize_attrs(self)

initialize the attributes from the element.yaml

property atom_type

register atom_type property

static distance(atom_i, atom_j, lattice: Lattice)[源代码]
static search_image(atom_i, atom_j) ndarray[源代码]

search the nearest image in which have minimum distance between two atoms

参数:
  • atom_i (Atom) – Atom instance

  • atom_j (Atom) – Atom instance

返回:

record the transform direction

返回类型:

image (np.ndarray)

set_coord(lattice: Lattice)[源代码]

recalculate frac_coord from cart_coord / recalculate cart_coord from frac_coord

参数:

lattice (Lattice) – Lattice instance

class gvasp.common.base.Atoms(*args, **kwargs)[源代码]

基类:Atom

Atoms class represent atom set in periodic solid system

@property

formula: chemical formula, <list> number: atomic number, <list> period: atomic period in element period table, <list> group: atomic group in element period table, <list> color: atomic color using RGB, <list> order: atomic order in <Structure class>, default: <list(range(len(formula)))> frac_coord: fractional coordinates, <list> cart_coord: cartesian coordinates, <list> _default_bonds: atomic default bond property {atom: bond-length}

count: total atom number in atom set size: list atom number according to their formula

@func

__initialize_attrs: initialize the attributes from the element.yaml from_list: construct the <class Atoms> from an Atom list, i.e., [Atom, Atom, Atom] –> Atoms

property atom_list
property atom_type

register atom_type property

property count: int
property elements
static from_list(atoms: list)[源代码]
perturb(lattice: Lattice, threshold=0.1, groups=9)[源代码]

Perturb the atoms’ coords

@params:

lattice: Lattice type threshold: max offset of atom groups: how many groups you want to get

set_coord(lattice: Lattice)[源代码]

recalculate frac_coord from cart_coord / recalculate cart_coord from frac_coord

参数:

lattice (Lattice) – Lattice instance

property size
class gvasp.common.base.Lattice(matrix: ndarray)[源代码]

基类:object

property angle: ndarray

Calculate the lattice angle

返回:

store the angle, shape = (3x1)

返回类型:

angle (np.ndarray)

static arc_lattice(lattice)[源代码]

Construct a Arc Lattice instance from lattice

参数:

lattice (Lattice) – Lattice instance

返回:

Lattice instance

返回类型:

arc lattice (Lattice)

static from_POSCAR(name)[源代码]

Construct a Lattice instance from POSCAR file

参数:

name ([str, Path]) – path of POSCAR

返回:

Lattice instance

返回类型:

lattice (Lattice)

static from_string(string)[源代码]

Construct a Lattice instance from string

参数:

string (List[str]) –

three-line <string>

>>> string
array([[  7.707464,  0.000000,  0.000000],
         -3.853732,  6.674860,  0.000000],
          0.000000,  0.000000, 28.319031]])

返回:

Lattice instance

返回类型:

lattice (Lattice)

property inverse: ndarray

Calculate the inverse matrix of lattice

返回:

store the inverse matrix

返回类型:

inverse (np.ndarray)

property length: ndarray

Calculate the lattice length

返回:

store the length, shape = (3x1)

返回类型:

length (np.ndarray)

property strings: str

Transform a Lattice instance to string

返回:

Lattice instance in string format

返回类型:

strings (str)

property volume: float

Calculate the lattice volume

返回:

store the volume

返回类型:

volume (float)

gvasp.common.descriptor module

class gvasp.common.descriptor.Descriptor(*args, **kwargs)[源代码]

基类:object

Base Descriptor, <get, set, del> method of each param is unlimited

class gvasp.common.descriptor.IntegerLeftDescriptor(*args, **kwargs)[源代码]

基类:ValueDescriptor

IntegerLeft Descriptor, limit param’s value

class gvasp.common.descriptor.IntegerLeftRealRightDescriptor(*args, **kwargs)[源代码]

基类:IntegerLeftDescriptor

IntegerLeftRealRight Descriptor, limit param’s value

class gvasp.common.descriptor.TypeDescriptor(*args, **kwargs)[源代码]

基类:Descriptor

Type Descriptor, limit param’s type

class gvasp.common.descriptor.TypeListDescriptor(*args, **kwargs)[源代码]

基类:Descriptor

TypeList Descriptor, limit param’s type

class gvasp.common.descriptor.TypeListValueDescriptor(*args, **kwargs)[源代码]

基类:TypeListDescriptor, ValueDescriptor

class gvasp.common.descriptor.TypeValueDescriptor(*args, **kwargs)[源代码]

基类:TypeDescriptor, ValueDescriptor

class gvasp.common.descriptor.ValueDescriptor(*args, **kwargs)[源代码]

基类:Descriptor

Value Descriptor, limit param’s value

gvasp.common.error module

exception gvasp.common.error.AnimationError[源代码]

基类:RuntimeError

exception gvasp.common.error.ArgsNotRegisteredError[源代码]

基类:TypeError

exception gvasp.common.error.AttributeNotAssignedError[源代码]

基类:AttributeError

exception gvasp.common.error.AttributeNotRegisteredError[源代码]

基类:AttributeError

exception gvasp.common.error.ConstrainError[源代码]

基类:TypeError

exception gvasp.common.error.FrequencyError[源代码]

基类:IndexError

exception gvasp.common.error.GridNotEqualError[源代码]

基类:ValueError

exception gvasp.common.error.JsonFileNotFoundError[源代码]

基类:FileNotFoundError

exception gvasp.common.error.ParameterError[源代码]

基类:TypeError

exception gvasp.common.error.PathNotExistError[源代码]

基类:TypeError

exception gvasp.common.error.PotDirNotExistError[源代码]

基类:FileExistsError

exception gvasp.common.error.StructureNotEqualError[源代码]

基类:ValueError

exception gvasp.common.error.StructureOverlapError[源代码]

基类:ValueError

exception gvasp.common.error.TooManyXSDFileError[源代码]

基类:FileExistsError

exception gvasp.common.error.XSDFileNotFoundError[源代码]

基类:FileNotFoundError

gvasp.common.figure module

class gvasp.common.figure.DashLine(*args, **kwargs)[源代码]

基类:LineBase

Dash Line class, subclass of LineBase

class gvasp.common.figure.Figure(*args, **kwargs)[源代码]

基类:object

Plot-type class’ parent, unify the figure format

lloc

Value Descriptor, limit param’s value

static save(name='figure.svg')[源代码]
static show()[源代码]
class gvasp.common.figure.LineBase(*args, **kwargs)[源代码]

基类:object

Line-Base-class, cant’ instantiated

plot()[源代码]
class gvasp.common.figure.PchipLine(*args, **kwargs)[源代码]

基类:LineBase

static interpolate(x_ori, y_ori, num)[源代码]
class gvasp.common.figure.SolidLine(*args, **kwargs)[源代码]

基类:LineBase

Solid Line class, subclass of LineBase

class gvasp.common.figure.Text(figure, x, y, s, color, fontsize=18)[源代码]

基类:object

Add text on the figure, for PlotPES.

param:

figure: Figure instance x: bi-tuple, specify which x-range to add text y: bi-tuple, specify which y-range to add text; text: content

check_overlap()[源代码]

check the text overlap

main idea:
  1. tailor box along the line

  2. if not, tailor the box vertically, then loop

tailor_text()[源代码]
gvasp.common.figure.plot_wrapper(type='default')[源代码]

gvasp.common.file module

class gvasp.common.file.ACFFile(*args, **kwargs)[源代码]

基类:MetaFile

class gvasp.common.file.AECCAR0(*args, **kwargs)[源代码]

基类:CHGBase

class gvasp.common.file.AECCAR2(*args, **kwargs)[源代码]

基类:CHGBase

class gvasp.common.file.ARCFile(*args, **kwargs)[源代码]

基类:MetaFile

static write(name: str, structure: List[Structure], lattice: Lattice)[源代码]
class gvasp.common.file.CHGBase(*args, **kwargs)[源代码]

基类:StructInfoFile

Subclass of StructInfoFile, inherit <structure property>

load()[源代码]

load Electronic-Density

@return:

self.density: shape=(NGX, NGY, NGZ)

write(title=None, factor=1.0)[源代码]

write CHGCAR_* file from array

@param:

system: specify the structure system factor: coordination factor

class gvasp.common.file.CHGCAR(*args, **kwargs)[源代码]

基类:StructInfoFile

load()[源代码]

load Electronic-Density

@return:

self.NGrid: NGX * NGY * NGZ self.density: shape=(NGX, NGY, NGZ) self._density_strings: density with strings format

split()[源代码]

split CHGCAR to CHGCAR_tot && CHGCAR_mag

class gvasp.common.file.CHGCAR_diff(*args, **kwargs)[源代码]

基类:CHGBase

line_potential(direction='z')[源代码]

Calculate Charge Density Difference along one direction, default: z-axis

参数:

direction (str) – which axis you want to Average the CCD

返回:

]): CCD along one axis

返回类型:

line_potential (np.array[

class gvasp.common.file.CHGCAR_mag(*args, **kwargs)[源代码]

基类:CHGBase

static to_grd(name='vasp.grd', DenCut=-1)[源代码]

transform CHGCAR_mag to grd file

param:

name: specify the name of grd file DenCut: density lower than DenCut will be set to zero (default: -1: disable the DenCut option)

class gvasp.common.file.CHGCAR_sum(*args, **kwargs)[源代码]

基类:CHGBase

static from_array(name: str, structure, NGrid: tuple[int, int, int], density)[源代码]
property structure
class gvasp.common.file.CHGCAR_tot(*args, **kwargs)[源代码]

基类:CHGBase

class gvasp.common.file.CONTCAR(*args, **kwargs)[源代码]

基类:POSCAR

class gvasp.common.file.CellFile(*args, **kwargs)[源代码]

基类:StructInfoFile

property structure
to_POSCAR()[源代码]
class gvasp.common.file.DOSCAR(*args, **kwargs)[源代码]

基类:MetaFile

ISPIN

Value Descriptor, limit param’s value

LORBIT

Value Descriptor, limit param’s value

load()[源代码]
class gvasp.common.file.EIGENVAL(*args, **kwargs)[源代码]

基类:MetaFile

write(directory='band_data')[源代码]

Write band-data to file, each band corresponding to one file and named as band_{index}

@params:

dir: save directory, default: $CWD/band_data

class gvasp.common.file.Fort188File(*args, **kwargs)[源代码]

基类:MetaFile

property constrain
write(name='fort.188')[源代码]
class gvasp.common.file.INCAR(*args, **kwargs)[源代码]

基类:MetaFile, Parameter

write(name)[源代码]

Write interface, callback every _write* func

class gvasp.common.file.KPATHIN(*args, **kwargs)[源代码]

基类:MetaFile

class gvasp.common.file.KPOINTS(*args, **kwargs)[源代码]

基类:MetaFile

static from_strings(strings)[源代码]
static min_number(structure: Structure, length=20.0)[源代码]
write(name)[源代码]
class gvasp.common.file.LOCPOT(*args, **kwargs)[源代码]

基类:StructInfoFile

line_potential(direction='z')[源代码]

Calculate the electrostatic potential along one direction, default: z-axis

参数:

direction (str) – which axis you want to calculate the electrostatic potential

返回:

]): electrostatic potential along one axis

返回类型:

line_potential (np.array[

load()[源代码]

load Electrostatic Potential

返回:

value = NGX * NGY * NGZ self.potential (np.array[:, :, :]): record the electrostatic potential self.lattice (Lattice): <Lattice class> instance

返回类型:

self.NGrid (int)

class gvasp.common.file.MODECAR(*args, **kwargs)[源代码]

基类:MetaFile

static write_from_POSCAR(pos1: str, pos2: str)[源代码]

Generate MODECAR file from the two POSCAR file

@param:

pos1: name of first POSCAR file pos2: name of second POSCAR file

static write_from_freq(freq: int, scale: float, outcar='OUTCAR')[源代码]

Generate MODECAR file from the image-freq

@param:

freq: which freq you want to generate MODECAR scale: scale factor, may lower than 1.0 outcar: name of the OUTCAR

class gvasp.common.file.MetaFile(*args, **kwargs)[源代码]

基类:object

property strings
property type
class gvasp.common.file.OUTCAR(*args, **kwargs)[源代码]

基类:MetaFile

animation_freq(freq: [<class 'str'>, <class 'int'>] = 'image', frames: int = 30, scale: float = 0.6)[源代码]

Generate freq.arc file from OUTCAR

@param:

freq: specify which freq you want to animate, accept [int, str] arguments frames: specify how many points you want to interpolate along one direction, default = 30 scale: determine the vibration scale, default = 0.6

bandgap(cutoff=0.01)[源代码]

Calculated the bandgap from OUTCAR file

@param:

cutoff: any occupy lower than cutoff will be treated as the empty state

@return:

type: type of bandgap, [‘direct’, ‘indirect’] bandgap: value of bandgap

class gvasp.common.file.POSCAR(*args, **kwargs)[源代码]

基类:StructInfoFile

static align(pos1: str, pos2: str)[源代码]

Tailor the atoms’ order to make the distance of pos1 and pos2 minimum

@param:

pos1: first POSCAR file name pos2: second POSCAR file name

static dist(pos1: str, pos2: str)[源代码]

Calculate the distance of two POSCAR, distance = sqrt(sum((i-j)**2))

@param:

pos1: first POSCAR file name pos2: second POSCAR file name

class gvasp.common.file.POTCAR(*args, **kwargs)[源代码]

基类:MetaFile

static cat(potentials, elements: List[str], potdir='/home/docs/checkouts/readthedocs.org/user_builds/gvasp-zh-cn/envs/latest/lib/python3.9/site-packages/gvasp/pot')[源代码]
write(name)[源代码]
class gvasp.common.file.StructInfoFile(*args, **kwargs)[源代码]

基类:MetaFile

property structure
class gvasp.common.file.SubmitFile(*args, **kwargs)[源代码]

基类:MetaFile

property backup_lines
property bader_lines
property build
property check_success_lines
property modify_lines
pipe(attrs: list) str[源代码]
property spin_lines
class gvasp.common.file.XDATCAR(*args, **kwargs)[源代码]

基类:StructInfoFile

movie(name)[源代码]

Transform the XDATCAR to arc file

property structure
class gvasp.common.file.XSDFile(*args, **kwargs)[源代码]

基类:MetaFile

property strings
property structure
static write(contcar: str | Path, outcar: str | Path, name='output.xsd')[源代码]
gvasp.common.file.formatter(parameters)[源代码]

formatter wrapper: format the INCAR parameters

@params:

parameters: which type of INCAR parameters func: write* func in INCAR class

gvasp.common.logger module

gvasp.common.parameter module

class gvasp.common.parameter.Parameter[源代码]

基类:object

Parameters manager, register parameter && check theirs type

ALGO

Value Descriptor, limit param’s value

AMIX

Type Descriptor, limit param’s type

AMIX_MAG

Type Descriptor, limit param’s type

BMIX

Type Descriptor, limit param’s type

BMIX_MAG

Type Descriptor, limit param’s type

DFNMax

Type Descriptor, limit param’s type

DFNMin

Type Descriptor, limit param’s type

DRotMax

Type Descriptor, limit param’s type

DdR

Type Descriptor, limit param’s type

EB_K

Type Descriptor, limit param’s type

EDIFF

Type Descriptor, limit param’s type

EDIFFG

Type Descriptor, limit param’s type

EINT

Type Descriptor, limit param’s type

ENCUT

Type Descriptor, limit param’s type

GGA

Value Descriptor, limit param’s value

HFSCREEN

Type Descriptor, limit param’s type

IBRION

Value Descriptor, limit param’s value

ICHAIN

Value Descriptor, limit param’s value

ICHARG

Value Descriptor, limit param’s value

IDIPOL

Value Descriptor, limit param’s value

IMAGES

Type Descriptor, limit param’s type

IOPT

Value Descriptor, limit param’s value

ISIF

Value Descriptor, limit param’s value

ISMEAR

IntegerLeft Descriptor, limit param’s value

ISPIN

Value Descriptor, limit param’s value

ISTART

Value Descriptor, limit param’s value

ISYM

Value Descriptor, limit param’s value

IVDW

Value Descriptor, limit param’s value

LAECHG

Type Descriptor, limit param’s type

LCHARG

Type Descriptor, limit param’s type

LCLIMB

Type Descriptor, limit param’s type

LDAU

Type Descriptor, limit param’s type

LDAUJ

TypeList Descriptor, limit param’s type

LDAUL

TypeList Descriptor, limit param’s type

LDAUPRINT

Value Descriptor, limit param’s value

LDAUTYPE

Value Descriptor, limit param’s value

LDAUU

TypeList Descriptor, limit param’s type

LDIPOL

Type Descriptor, limit param’s type

LHFCALC

Type Descriptor, limit param’s type

LMAXMIX

Type Descriptor, limit param’s type

LORBIT

Value Descriptor, limit param’s value

LPARD

Type Descriptor, limit param’s type

LREAL

Value Descriptor, limit param’s value

LSEPB

Type Descriptor, limit param’s type

LSEPK

Type Descriptor, limit param’s type

LSOL

Type Descriptor, limit param’s type

LVHAR

Type Descriptor, limit param’s type

LWAVE

Type Descriptor, limit param’s type

MAGMOM

Type Descriptor, limit param’s type

MAXMOVE

Type Descriptor, limit param’s type

MDALGO

Value Descriptor, limit param’s value

NBMOD

Type Descriptor, limit param’s type

NEDOS

Type Descriptor, limit param’s type

NELECT

Type Descriptor, limit param’s type

NELM

Type Descriptor, limit param’s type

NELMIN

Type Descriptor, limit param’s type

NFREE

Type Descriptor, limit param’s type

NPAR

Type Descriptor, limit param’s type

NSIM

Type Descriptor, limit param’s type

NSW

Type Descriptor, limit param’s type

POTIM

Type Descriptor, limit param’s type

PREC

Value Descriptor, limit param’s value

PRECFOCK

Value Descriptor, limit param’s value

SIGMA

Type Descriptor, limit param’s type

SMASS

IntegerLeftRealRight Descriptor, limit param’s value

SPRING

Type Descriptor, limit param’s type

SYSTEM

Type Descriptor, limit param’s type

TEBEG

Type Descriptor, limit param’s type

TEEND

Type Descriptor, limit param’s type

TIME

Type Descriptor, limit param’s type

gvasp.common.parameter.bool_str(value)[源代码]

transform str to (bool, str)

gvasp.common.parameter.int_float(value)[源代码]

transform str to int (value<0) or float (value>0)

gvasp.common.parameter.list_float(values)[源代码]

transform str to List[float]

gvasp.common.parameter.list_int(values)[源代码]

transform str to List[int]

gvasp.common.parameter.list_mag(value)[源代码]

transform MAGMOM in n*m format to list

gvasp.common.parameter.logic(value: str)[源代码]

transform str to bool

gvasp.common.parameter.str_prec(value)[源代码]

transform PREC optional values to [‘Low’, ‘Medium’, ‘High’, ‘Normal’, ‘Single’, ‘Accurate’]

gvasp.common.plot module

class gvasp.common.plot.DOSData(dos_file, pos_file, ISPIN=2, LORBIT=12, magnification=100)[源代码]

基类:object

<DOSData main class>

get_data()[源代码]

get_data main func

center()

calculate the band-center

contcar_parse()

parse CONTCAR data

doscar_parse()

parse DOSCAR data

get_data(atoms=None, exclude=None, orbitals=None, avgflag=False, **kargs)[源代码]

<Get_Data Main Func>

参数:
  • atoms – accept int, list, and str(‘1-10’ or ‘Ce’) type

  • exclude – remove specified atoms in <atoms parameters>

  • orbitals – list, e.g., [‘s’, ‘p’]

  • avgflag (bool) – whether calculate the average dos

static parse_contcar(name)[源代码]

read CONTCAR file, obtain the elements’ list.

参数:

name – CONTCAR file name

返回:

elements list, e.g., [‘’,’Be’,’Be’,’C’]

返回类型:

element

static parse_doscar(name, ISPIN, LORBIT)[源代码]

read DOSCAR file, obtain the TDOS && LDOS.

参数:

name – DOSCAR file name

返回:

DataFrame(NDOS, 2) LDOS: energy_list + List(NAtom * DataFrame(NDOS, NOrbital+8))

返回类型:

TDOS

class gvasp.common.plot.PESData(data)[源代码]

基类:object

Generate the data for PlotPES

convert_sd()[源代码]

func for converting data to solid_dash type

convert_sc()[源代码]

func for converting data to solid_curve type

convert_sc()[源代码]

func for converting data to solid_curve type

返回:

x position in bi-tuple format of solid-type line (MS state) solid_y_1: y position in bi-tuple format of solid-type line (MS state) solid_x_2: y position in bi-tuple format of solid-type line (MS-MS) solid_y_2: y position in bi-tuple format of solid-type line (MS-MS) pchip_x: x position in tri-tuple format of pchip-type line (MS-TS-MS) pchip_y: y position in tri-tuple format of pchip-type line (MS-TS-MS)

返回类型:

solid_x_1

convert_sd()[源代码]

func for converting data to solid_dash type

返回:

x position in bi-tuple format of solid-type line (MS/TS-state) solid_y: y position in bi-tuple format of solid-type line (MS/TS-state) dash_x: x position in bi-tuple format of dash-type line (MS/TS)-(MS/TS) dash_y: y position in bi-tuple format of dash-type line (MS/TS)-(MS-TS)

返回类型:

solid_x

class gvasp.common.plot.PlotBand(*args, **kwargs)[源代码]

基类:Figure

plot()[源代码]

Plot Band Structure, for spin-system, the average energy was applied

class gvasp.common.plot.PlotCCD(*args, **kwargs)[源代码]

基类:Figure

plot()[源代码]

Plot Charge Density Difference

class gvasp.common.plot.PlotEPotential(*args, **kwargs)[源代码]

基类:Figure

plot()[源代码]

Plot Electrostatic Potential

class gvasp.common.plot.PlotNEB(*args, **kwargs)[源代码]

基类:Figure

plot(color='#ed0345', workdir=None)[源代码]
class gvasp.common.plot.PlotOpt(*args, **kwargs)[源代码]

基类:Figure

plot(color=('#ed0345', '#009734'))[源代码]
class gvasp.common.plot.PlotPES(*args, **kwargs)[源代码]

基类:Figure

Plot potential energy surface (PES)

plot()[源代码]

plot main func

add_solid()[源代码]

auxiliary func, add solid line

add_dash()[源代码]

auxiliary func, add dash line

add_text()[源代码]

auxiliary func, add text

static add_dash(linewidth, x, y, color)[源代码]
static add_pchip(linewidth, x, y, color, num=100)[源代码]
static add_solid(linewidth, x, y, color)[源代码]
add_text(x, y, text, color)[源代码]
plot(data, color, text_type=None, style='solid_dash', legend=None)[源代码]

Main plot func of <PlotPES class>

参数:
  • data – energy or (energy, label) types data

  • color – specify which color you want to plot

  • text_type – only affect solid_dash type

  • style – specify which style PES you want to plot, default: solid_dash

  • legend – specify the legend, triple element: [x, y, label]

class gvasp.common.plot.PostDOS(*args, **kwargs)[源代码]

基类:Figure

center(selector: dict)[源代码]

Calculate Band-Center Value

plot(selector: dict)[源代码]

<Plot DOS Method>

参数:
  • selector (>>>) – keys: [atoms, orbitals, color, method, alpha]

  • selector.method (optional) – [“line”, “dash line”, “fill”, “output”]

  • Examples

  • ---------

  • selector

  • {"0" (selector =) –

    [{“atoms”: “C”, “orbitals”: [“p”], “color”: “#ed0345”, “method”: “fill”, “alpha”: 0.3},

    {“atoms”: “1-10”, “orbitals”: [“s”, “d”], “color”: “#098760”}],

    ”1”: [{“atoms”: [0, 1, “H”], “orbitals”: [“p”], “color”: “#ed0345”},

    {“atoms”: 12, “orbitals”: [“s”, “p”], “color”: “#098760”}]}

返回:

display or save the DOS figures

gvasp.common.plot.interpolated_wrapper(func)[源代码]

gvasp.common.setting module

class gvasp.common.setting.ConfigManager[源代码]

基类:object

property dict
load()[源代码]

Load the configuration (need consider the multi-users)

write()[源代码]

gvasp.common.structure module

class gvasp.common.structure.NeighbourTable[源代码]

基类:defaultdict

property coordination
property dist
property dist3d
property index
property index_tuple
class gvasp.common.structure.Structure(atoms: Atoms | None = None, lattice: Lattice | None = None)[源代码]

基类:object

static align(structure1, structure2, tolerance1=0.2, tolerance2=100)[源代码]

Tailor the atoms’ order to make the distance of structure1 and structure2 minimum

@param:

structure1: first Structure structure2: second Structure tolerance1: first sort tolerance tolerance2: second sort tolerance

check_overlap(cutoff=0.1)[源代码]
static dist(structure1, structure2)[源代码]

Calculate the distance of two structures, distance = sqrt(sum((i-j)**2))

@param:

structure1: first Structure structure2: second Structure

@return

diff: distance between two structures

find_neighbour_table(neighbour_num: int = 12, cut_radius=None, adj_matrix=None, sort=True, including_self=False)[源代码]
static from_POSCAR(name)[源代码]
static from_cell(name)[源代码]
static from_structure(structure, coord, type='cart')[源代码]

Generate the Structure instance from original structure with changing its atoms’ coord

参数:
  • structure – which structure you want to base

  • coord – coord for new structure, <frac or cart>

  • type – which type of new coord, should be one of [“frac”, “cart”], default: “cart”

Returns: new Structure instance

write_POSCAR(name, title=None, factor=1.0)[源代码]

gvasp.common.task module

class gvasp.common.task.Animatable[源代码]

基类:object

abstract static movie(name)[源代码]

Abstractmethod: Generate the *.arc file to be loaded by Material Studio

参数:

name (str) – the name of the output *.arc file

class gvasp.common.task.BandTask(*args, **kwargs)[源代码]

基类:NormalTask

Band Structure calculation task manager, subclass of NormalTask

class gvasp.common.task.BaseTask[源代码]

基类:object

Task Base class, load config.json, generate INCAR, KPOINTS, POSCAR and POTCAR Note: subclass should have generate method

PotDir = PosixPath('C:\\Users\\hui_zhou\\Desktop\\packages\\GVasp\\pot')
Scheduler = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/gvasp-zh-cn/envs/latest/lib/python3.9/site-packages/gvasp/slurm.submit')
Template = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/gvasp-zh-cn/envs/latest/lib/python3.9/site-packages/gvasp/INCAR')
UValueBase = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/gvasp-zh-cn/envs/latest/lib/python3.9/site-packages/gvasp/UValue.yaml')
abstract generate(potential: (<class 'str'>, <class 'list'>) = 'PAW_PBE', continuous: bool = False, low: bool = False, print_end: bool = True, analysis: bool = False, vdw: bool = False, sol: bool = False, gamma: bool = False, mag: bool = False, hse: bool = False, static: bool = False, nelect=None, points: int = 21)[源代码]

generate main method, subclass should inherit or overwrite

static get_all_parents()[源代码]
class gvasp.common.task.ChargeTask(*args, **kwargs)[源代码]

基类:NormalTask

Charge calculation task manager, subclass of NormalTask

static apply_analysis(submit)[源代码]
static split()[源代码]

split CHGCAR to CHGCAR_tot && CHGCAR_mag

static sum()[源代码]

sum AECCAR0 and AECCAR2 to CHGCAR_sum

static to_grd(name='vasp.grd', Dencut=250)[源代码]

transform CHGCAR_mag to grd file

class gvasp.common.task.ConTSTask(*args, **kwargs)[源代码]

基类:OptTask, XDATMovie

Constrain transition state (Con-TS) calculation task manager, subclass of NormalTask

class gvasp.common.task.DOSTask(*args, **kwargs)[源代码]

基类:NormalTask

Density of States (DOS) calculation task manager, subclass of NormalTask

class gvasp.common.task.DimerTask(*args, **kwargs)[源代码]

基类:NormalTask, XDATMovie

class gvasp.common.task.FreqTask(*args, **kwargs)[源代码]

基类:NormalTask, Animatable

Frequency calculation task manager, subclass of NormalTask

static movie(file='OUTCAR', freq='image')[源代码]

visualize the frequency vibration, default: image

class gvasp.common.task.MDTask(*args, **kwargs)[源代码]

基类:NormalTask, XDATMovie

ab-initio molecular dynamics (AIMD) calculation task manager, subclass of NormalTask

class gvasp.common.task.NEBTask(ini_poscar=None, fni_poscar=None, images=4)[源代码]

基类:BaseTask, Animatable

Nudged Elastic Band (NEB) calculation (no-climbing) task manager, subclass of BaseTask

generate(method='linear', check_overlap=True, potential='PAW_PBE', vdw=False, sol=False, gamma=False, nelect=None, mag=False, hse=False, static=False)[源代码]

Overwrite BaseTask’s generate, add method and check_overlap parameters

static monitor()[源代码]

Monitor tangent, energy and barrier in the NEB-task

static movie(name='movie.arc', file='CONTCAR', workdir=None)[源代码]

Generate arc file from images/[POSCAR|CONTCAR] files

static sort(ini_poscar, fni_poscar)[源代码]

Tailor the atoms’ order for neb task

@param:

ini_poscar: initial POSCAR file name fni_poscar: final POSCAR file name

class gvasp.common.task.NormalTask(*args, **kwargs)[源代码]

基类:BaseTask

generate(*args, **kargs)[源代码]

fully inherit BaseTask’s generate

class gvasp.common.task.OptTask(*args, **kwargs)[源代码]

基类:NormalTask, XDATMovie

Optimization task manager, subclass of NormalTask

class gvasp.common.task.OutputTask[源代码]

基类:object

static output(name)[源代码]

Transform the results to .xsd file

class gvasp.common.task.STMTask(*args, **kwargs)[源代码]

基类:NormalTask

Scanning Tunneling Microscope (STM) image modelling calculation task manager, subclass of NormalTask

class gvasp.common.task.SequentialTask(end)[源代码]

基类:object

Apply Sequential Task from opt => chg or opt => dos

generate(potential='PAW_PBE', low=False, analysis=False, vdw=False, sol=False, gamma=False, nelect=None, hse=False, static=False)[源代码]
class gvasp.common.task.WorkFuncTask(*args, **kwargs)[源代码]

基类:NormalTask

Work Function calculation task manager, subclass of NormalTask

class gvasp.common.task.XDATMovie(*args, **kwargs)[源代码]

基类:Animatable

static movie(name='movie.arc')[源代码]

make arc file to visualize the optimization steps

gvasp.common.task.end_symbol(func)[源代码]
gvasp.common.task.write_wrapper(file)[源代码]

gvasp.common.utils module

gvasp.common.utils.colors_generator()[源代码]

Color cycle generator

gvasp.common.utils.get_HIGH_SYM()[源代码]
gvasp.common.utils.get_HOME() Path[源代码]

obtain HOME directory

gvasp.common.utils.identify_atoms(atoms, elements)[源代码]

Calculate the real index for the atoms

gvasp.common.utils.is_subset_recommend_pot(element)[源代码]

Identify an element is or not in RecommendPot

gvasp.common.utils.redefine_frac(frac)[源代码]

Make frac_coord within [0,1]

参数:

frac (np.array) – frac_coord input

返回:

frac_coord output

返回类型:

frac (np.array)

gvasp.common.utils.remove_mapping(atoms: list, tol=0.01)[源代码]
gvasp.common.utils.search_peak(dos_data: Series, tol: float = 0.0001)[源代码]
gvasp.common.utils.str_list(_list)[源代码]

Transform the list to strings with s delimiter, e.g. [1, 2, 3] => 1 2 3