gvasp.common package

gvasp.common.base module

class gvasp.common.base.Atom(*args, **kwargs)[source]

Bases: 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[source]

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)[source]
static search_image(atom_i, atom_j) ndarray[source]

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

Parameters
  • atom_i (Atom) – Atom instance

  • atom_j (Atom) – Atom instance

Returns

record the transform direction

Return type

image (np.ndarray)

set_coord(lattice: Lattice)[source]

recalculate frac_coord from cart_coord / recalculate cart_coord from frac_coord

Parameters

lattice (Lattice) – Lattice instance

class gvasp.common.base.Atoms(*args, **kwargs)[source]

Bases: 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)[source]
perturb(lattice: Lattice, threshold=0.1, groups=9)[source]

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)[source]

recalculate frac_coord from cart_coord / recalculate cart_coord from frac_coord

Parameters

lattice (Lattice) – Lattice instance

property size
class gvasp.common.base.Lattice(matrix: ndarray)[source]

Bases: object

property angle: ndarray

Calculate the lattice angle

Returns

store the angle, shape = (3x1)

Return type

angle (np.ndarray)

static from_POSCAR(name)[source]

Construct a Lattice instance from POSCAR file

Parameters

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

Returns

Lattice instance

Return type

lattice (Lattice)

static from_string(string)[source]

Construct a Lattice instance from string

Parameters

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]])

Returns

Lattice instance

Return type

lattice (Lattice)

property inverse: ndarray

Calculate the inverse matrix of lattice

Returns

store the inverse matrix

Return type

inverse (np.ndarray)

property length: ndarray

Calculate the lattice length

Returns

store the length, shape = (3x1)

Return type

length (np.ndarray)

property strings: str

Transform a Lattice instance to string

Returns

Lattice instance in string format

Return type

strings (str)

property volume: float

Calculate the lattice volume

Returns

store the volume

Return type

volume (float)

gvasp.common.descriptor module

class gvasp.common.descriptor.Descriptor(*args, **kwargs)[source]

Bases: object

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

class gvasp.common.descriptor.IntegerLeftDescriptor(*args, **kwargs)[source]

Bases: ValueDescriptor

IntegerLeft Descriptor, limit param’s value

class gvasp.common.descriptor.IntegerLeftRealRightDescriptor(*args, **kwargs)[source]

Bases: IntegerLeftDescriptor

IntegerLeftRealRight Descriptor, limit param’s value

class gvasp.common.descriptor.TypeDescriptor(*args, **kwargs)[source]

Bases: Descriptor

Type Descriptor, limit param’s type

class gvasp.common.descriptor.TypeListDescriptor(*args, **kwargs)[source]

Bases: Descriptor

TypeList Descriptor, limit param’s type

class gvasp.common.descriptor.TypeListValueDescriptor(*args, **kwargs)[source]

Bases: TypeListDescriptor, ValueDescriptor

class gvasp.common.descriptor.TypeValueDescriptor(*args, **kwargs)[source]

Bases: TypeDescriptor, ValueDescriptor

class gvasp.common.descriptor.ValueDescriptor(*args, **kwargs)[source]

Bases: Descriptor

Value Descriptor, limit param’s value

gvasp.common.error module

exception gvasp.common.error.AnimationError[source]

Bases: RuntimeError

exception gvasp.common.error.AttributeNotAssignedError[source]

Bases: AttributeError

exception gvasp.common.error.AttributeNotRegisteredError[source]

Bases: AttributeError

exception gvasp.common.error.ConstrainError[source]

Bases: TypeError

exception gvasp.common.error.FrequencyError[source]

Bases: IndexError

exception gvasp.common.error.GridNotEqualError[source]

Bases: ValueError

exception gvasp.common.error.JsonFileNotFoundError[source]

Bases: FileNotFoundError

exception gvasp.common.error.ParameterError[source]

Bases: TypeError

exception gvasp.common.error.PathNotExistError[source]

Bases: TypeError

exception gvasp.common.error.PotDirNotExistError[source]

Bases: FileExistsError

exception gvasp.common.error.StructureNotEqualError[source]

Bases: ValueError

exception gvasp.common.error.StructureOverlapError[source]

Bases: ValueError

exception gvasp.common.error.TooManyXSDFileError[source]

Bases: FileExistsError

exception gvasp.common.error.XSDFileNotFoundError[source]

Bases: FileNotFoundError

gvasp.common.figure module

class gvasp.common.figure.DashLine(*args, **kwargs)[source]

Bases: LineBase

Dash Line class, subclass of LineBase

class gvasp.common.figure.Figure(*args, **kwargs)[source]

Bases: object

Plot-type class’ parent, unify the figure format

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

Bases: object

Line-Base-class, cant’ instantiated

plot()[source]
class gvasp.common.figure.PchipLine(*args, **kwargs)[source]

Bases: LineBase

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

Bases: LineBase

Solid Line class, subclass of LineBase

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

Bases: 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()[source]

check the text overlap

main idea:
  1. tailor box along the line

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

tailor_text()[source]
gvasp.common.figure.plot_wrapper(func)[source]

gvasp.common.file module

class gvasp.common.file.ACFFile(*args, **kwargs)[source]

Bases: MetaFile

class gvasp.common.file.AECCAR0(*args, **kwargs)[source]

Bases: CHGBase

class gvasp.common.file.AECCAR2(*args, **kwargs)[source]

Bases: CHGBase

class gvasp.common.file.ARCFile(*args, **kwargs)[source]

Bases: MetaFile

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

Bases: StructInfoFile

Subclass of StructInfoFile, inherit <structure property>

load()[source]

load Electronic-Density

@return:

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

write(title=None, factor=1.0)[source]

write CHGCAR_* file from array

@param:

system: specify the structure system factor: coordination factor

class gvasp.common.file.CHGCAR(*args, **kwargs)[source]

Bases: StructInfoFile

load()[source]

load Electronic-Density

@return:

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

split()[source]

split CHGCAR to CHGCAR_tot && CHGCAR_mag

class gvasp.common.file.CHGCAR_mag(*args, **kwargs)[source]

Bases: CHGBase

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

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)[source]

Bases: CHGBase

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

Bases: CHGBase

class gvasp.common.file.CONTCAR(*args, **kwargs)[source]

Bases: POSCAR

class gvasp.common.file.CellFile(*args, **kwargs)[source]

Bases: StructInfoFile

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

Bases: MetaFile

load()[source]
class gvasp.common.file.EIGENVAL(*args, **kwargs)[source]

Bases: MetaFile

write(directory='band_data')[source]

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.INCAR(*args, **kwargs)[source]

Bases: MetaFile, Parameter

write(name)[source]

Write interface, callback every _write* func

class gvasp.common.file.KPOINTS(*args, **kwargs)[source]

Bases: MetaFile

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

Bases: StructInfoFile

line_potential(direction='z')[source]

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

Parameters

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

Returns

]): electrostatic potential along one axis

Return type

line_potential (np.array[

load()[source]

load Electrostatic Potential

Returns

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

Return type

self.NGrid (int)

class gvasp.common.file.MODECAR(*args, **kwargs)[source]

Bases: MetaFile

static write_from_POSCAR(pos1: str, pos2: str)[source]

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')[source]

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)[source]

Bases: object

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

Bases: MetaFile

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

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)[source]

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)[source]

Bases: StructInfoFile

static align(pos1: str, pos2: str)[source]

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)[source]

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)[source]

Bases: MetaFile

static cat(potentials, elements: List[str], potdir='/home/docs/checkouts/readthedocs.org/user_builds/qvasp/envs/v0.1.2/lib/python3.9/site-packages/gvasp-0.1.2-py3.9-linux-x86_64.egg/gvasp/pot')[source]
write(name)[source]
class gvasp.common.file.StructInfoFile(*args, **kwargs)[source]

Bases: MetaFile

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

Bases: MetaFile

property run_command
class gvasp.common.file.XDATCAR(*args, **kwargs)[source]

Bases: StructInfoFile

movie(name)[source]

Transform the XDATCAR to arc file

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

Bases: MetaFile

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

formatter wrapper: format the INCAR parameters

@params:

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

gvasp.common.logger module

class gvasp.common.logger.ColoredFormatter(msg, use_color=False)[source]

Bases: Formatter

format(record)[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

class gvasp.common.logger.ColoredLogger(name)[source]

Bases: Logger

COLOR_FORMAT = '%(asctime)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d) [\x1b[1m%(name)s\x1b[0m][%(levelname)s] %(message)s'
FILE_FORMAT = '%(asctime)s (%(filename)s:%(lineno)d) [%(name)s][%(levelname)s] %(message)s'
FORMAT = '%(asctime)s ($BOLD%(filename)s$RESET:%(lineno)d) [$BOLD%(name)s$RESET][%(levelname)s] %(message)s'
LogDir = PosixPath('/home/docs/logs')
gvasp.common.logger.formatter_message(message, use_color=True)[source]
gvasp.common.logger.init_root_logger(name=None, level=20)[source]

gvasp.common.parameter module

class gvasp.common.parameter.Parameter[source]

Bases: 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

IBRION

Value Descriptor, limit param’s value

ICHAIN

Value Descriptor, limit param’s value

ICHARG

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

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

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

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

gvasp.common.parameter.bool_str(value)[source]

transform str to (bool, str)

gvasp.common.parameter.int_float(value)[source]

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

gvasp.common.parameter.list_float(values)[source]

transform str to List[float]

gvasp.common.parameter.list_int(values)[source]

transform str to List[int]

gvasp.common.parameter.logic(value: str)[source]

transform str to bool

gvasp.common.parameter.str_prec(value)[source]

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

gvasp.common.plot module

class gvasp.common.plot.PESData(data)[source]

Bases: object

Generate the data for PlotPES

@method:

convert_sd: func for converting data to solid_dash type convert_sc: func for converting data to solid_curve type

convert_sc()[source]

func for converting data to solid_curve type

@return:

solid_x_1: 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)

convert_sd()[source]

func for converting data to solid_dash type

@return:

solid_x: 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)

class gvasp.common.plot.PlotBand(*args, **kwargs)[source]

Bases: Figure

plot()[source]

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

class gvasp.common.plot.PlotDOS(*args, **kwargs)[source]

Bases: Figure

<PlotDOS main class>

plot()[source]

plot main func

center()[source]

calculate the band-center

contcar_parse()

parse CONTCAR data

doscar_parse()

parse DOSCAR data

center(atoms=None, orbitals=None, xlim=None)[source]

Calculate Band-Center Value (can’t put in the <DOSCAR class>, causing it needs CONTCAR information)

static parse_contcar(name)[source]

read CONTCAR file, obtain the elements’ list.

@params:

name: CONTCAR file name

@return:

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

static parse_doscar(name, LORBIT)[source]

read DOSCAR file, obtain the TDOS && LDOS.

@params:

name: DOSCAR file name

@return:

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

plot(atoms=None, exclude=None, orbitals=None, color='#000000', method='line', avgflag=False, alpha=0.5)[source]

Plot DOS Main Func

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

  • exclude – remove specified atoms in <atoms parameters>

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

  • method (str) – [‘line’, ‘dash line’,’fill’, ‘output’]

  • avgflag (bool) – whether calculate the average dos

class gvasp.common.plot.PlotEPotential(*args, **kwargs)[source]

Bases: Figure

plot()[source]

Plot Electrostatic Potential

class gvasp.common.plot.PlotNEB(*args, **kwargs)[source]

Bases: Figure

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

Bases: Figure

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

Bases: Figure

Plot potential energy surface (PES)

@method:

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)[source]
static add_pchip(linewidth, x, y, color, num=100)[source]
static add_solid(linewidth, x, y, color)[source]
add_text(x, y, text, color)[source]
plot(data, color, text_flag=True, style='solid_dash')[source]

Main plot func of <PlotPES class>

@param:

data: energy or (energy, label) types data color: specify which color you want to plot text_flag: only affect solid_dash type style: specify which style PES you want to plot, default: solid_dash

gvasp.common.plot.interpolated_wrapper(func)[source]

gvasp.common.setting module

class gvasp.common.setting.ConfigManager[source]

Bases: object

property dict
load()[source]

Load the configuration (need consider the multi-users)

write()[source]

gvasp.common.structure module

class gvasp.common.structure.NeighbourTable[source]

Bases: defaultdict

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

Bases: object

static align(structure1, structure2, tolerance1=0.2, tolerance2=100)[source]

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)[source]
static dist(structure1, structure2)[source]

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)[source]
static from_POSCAR(name)[source]
static from_cell(name)[source]
static from_structure(structure, coord, type='cart')[source]

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

Parameters
  • 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)[source]

gvasp.common.task module

class gvasp.common.task.Animatable[source]

Bases: object

abstract static movie(name)[source]

make arc file to visualize the optimization steps

class gvasp.common.task.BandTask[source]

Bases: BaseTask

Band Structure calculation task manager, subclass of BaseTask

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, nelect=None, gamma=False)[source]

fully inherit BaseTask’s generate

class gvasp.common.task.BaseTask[source]

Bases: 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/qvasp/envs/v0.1.2/lib/python3.9/site-packages/gvasp-0.1.2-py3.9-linux-x86_64.egg/gvasp/slurm.submit')
Template = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/qvasp/envs/v0.1.2/lib/python3.9/site-packages/gvasp-0.1.2-py3.9-linux-x86_64.egg/gvasp/INCAR')
UValueBase = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/qvasp/envs/v0.1.2/lib/python3.9/site-packages/gvasp-0.1.2-py3.9-linux-x86_64.egg/gvasp/UValue.yaml')
abstract generate(potential: (<class 'str'>, <class 'list'>), continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

generate main method, subclass should inherit or overwrite

static get_all_parents()[source]
class gvasp.common.task.ChargeTask[source]

Bases: BaseTask

Charge calculation task manager, subclass of BaseTask

static apply_analysis()[source]
generate(potential='PAW_PBE', continuous=False, analysis=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

rewrite BaseTask’s generate

static split()[source]

split CHGCAR to CHGCAR_tot && CHGCAR_mag

static sum()[source]

sum AECCAR0 and AECCAR2 to CHGCAR_sum

static to_grd(name='vasp.grd', Dencut=250)[source]

transform CHGCAR_mag to grd file

class gvasp.common.task.ConTSTask[source]

Bases: BaseTask, Animatable

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

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

static movie(name='movie.arc')[source]

fully inherit BaseTask’s movie

class gvasp.common.task.DOSTask[source]

Bases: BaseTask

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

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

class gvasp.common.task.DimerTask[source]

Bases: BaseTask, Animatable

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

static movie(name='movie.arc')[source]

make arc file to visualize the optimization steps

class gvasp.common.task.FreqTask[source]

Bases: BaseTask, Animatable

Frequency calculation task manager, subclass of BaseTask

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

static movie(file='OUTCAR', freq='image')[source]

visualize the frequency vibration, default: image

class gvasp.common.task.MDTask[source]

Bases: BaseTask, Animatable

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

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

static movie(name='movie.arc')[source]

fully inherit BaseTask’s movie

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

Bases: 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)[source]

Overwrite BaseTask’s generate, add method and check_overlap parameters

static monitor()[source]

Monitor tangent, energy and barrier in the NEB-task

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

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

static sort(ini_poscar, fni_poscar)[source]

Tailor the atoms’ order for neb task

@param:

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

class gvasp.common.task.OptTask[source]

Bases: BaseTask, Animatable

Optimization task manager, subclass of BaseTask

generate(potential='PAW_PBE', continuous=False, low=False, print_end=True, vdw=False, sol=False, gamma=False, nelect=None)[source]

rewrite BaseTask’s generate

static movie(name='movie.arc')[source]

fully inherit BaseTask’s movie

class gvasp.common.task.OutputTask[source]

Bases: object

static output(name)[source]

Transform the results to .xsd file

class gvasp.common.task.STMTask[source]

Bases: BaseTask

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

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

class gvasp.common.task.SequentialTask(end)[source]

Bases: 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)[source]
class gvasp.common.task.WorkFuncTask[source]

Bases: BaseTask

Work Function calculation task manager, subclass of BaseTask

generate(potential='PAW_PBE', continuous=False, vdw=False, sol=False, gamma=False, nelect=None)[source]

fully inherit BaseTask’s generate

gvasp.common.task.end_symbol(func)[source]
gvasp.common.task.write_wrapper(func)[source]

gvasp.common.utils module

gvasp.common.utils.colors_generator()[source]

Color cycle generator

gvasp.common.utils.get_HOME() Path[source]

obtain HOME directory

gvasp.common.utils.identify_atoms(atoms, elements)[source]

Calculate the real index for the atoms