gvasp.common package
gvasp.common.base module
- class gvasp.common.base.Atom(*args, **kwargs)[源代码]
基类:
objectAtom 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
- class gvasp.common.base.Atoms(*args, **kwargs)[源代码]
基类:
AtomAtoms 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
- 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 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)[源代码]
基类:
objectBase Descriptor, <get, set, del> method of each param is unlimited
- class gvasp.common.descriptor.IntegerLeftDescriptor(*args, **kwargs)[源代码]
-
IntegerLeft Descriptor, limit param’s value
- class gvasp.common.descriptor.IntegerLeftRealRightDescriptor(*args, **kwargs)[源代码]
-
IntegerLeftRealRight Descriptor, limit param’s value
- class gvasp.common.descriptor.TypeDescriptor(*args, **kwargs)[源代码]
基类:
DescriptorType Descriptor, limit param’s type
- class gvasp.common.descriptor.TypeListDescriptor(*args, **kwargs)[源代码]
基类:
DescriptorTypeList Descriptor, limit param’s type
- class gvasp.common.descriptor.ValueDescriptor(*args, **kwargs)[源代码]
基类:
DescriptorValue Descriptor, limit param’s value
gvasp.common.error module
gvasp.common.figure module
- class gvasp.common.figure.DashLine(*args, **kwargs)[源代码]
基类:
LineBaseDash Line class, subclass of LineBase
- class gvasp.common.figure.Figure(*args, **kwargs)[源代码]
基类:
objectPlot-type class’ parent, unify the figure format
- lloc
Value Descriptor, limit param’s value
- class gvasp.common.figure.LineBase(*args, **kwargs)[源代码]
基类:
objectLine-Base-class, cant’ instantiated
- class gvasp.common.figure.SolidLine(*args, **kwargs)[源代码]
基类:
LineBaseSolid Line class, subclass of LineBase
- class gvasp.common.figure.Text(figure, x, y, s, color, fontsize=18)[源代码]
基类:
objectAdd 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
gvasp.common.file module
- class gvasp.common.file.CHGBase(*args, **kwargs)[源代码]
-
Subclass of StructInfoFile, inherit <structure property>
- class gvasp.common.file.CHGCAR(*args, **kwargs)[源代码]
- class gvasp.common.file.DOSCAR(*args, **kwargs)[源代码]
基类:
MetaFile- ISPIN
Value Descriptor, limit param’s value
- LORBIT
Value Descriptor, limit param’s value
- class gvasp.common.file.LOCPOT(*args, **kwargs)[源代码]
- class gvasp.common.file.MODECAR(*args, **kwargs)[源代码]
基类:
MetaFile
- 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
- class gvasp.common.file.POSCAR(*args, **kwargs)[源代码]
- class gvasp.common.file.POTCAR(*args, **kwargs)[源代码]
基类:
MetaFile
- class gvasp.common.file.SubmitFile(*args, **kwargs)[源代码]
基类:
MetaFile- property backup_lines
- property bader_lines
- property build
- property check_success_lines
- property modify_lines
- property spin_lines
gvasp.common.logger module
gvasp.common.parameter module
- class gvasp.common.parameter.Parameter[源代码]
基类:
objectParameters 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.plot module
- class gvasp.common.plot.DOSData(dos_file, pos_file, ISPIN=2, LORBIT=12, magnification=100)[源代码]
基类:
object<DOSData main class>
- 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
- class gvasp.common.plot.PESData(data)[源代码]
基类:
objectGenerate the data for PlotPES
- 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.PlotPES(*args, **kwargs)[源代码]
基类:
FigurePlot potential energy surface (PES)
- 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- 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.setting module
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
- 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_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
gvasp.common.task module
- class gvasp.common.task.BandTask(*args, **kwargs)[源代码]
基类:
NormalTaskBand Structure calculation task manager, subclass of NormalTask
- class gvasp.common.task.BaseTask[源代码]
基类:
objectTask 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
- class gvasp.common.task.ChargeTask(*args, **kwargs)[源代码]
基类:
NormalTaskCharge calculation task manager, subclass of NormalTask
- class gvasp.common.task.ConTSTask(*args, **kwargs)[源代码]
-
Constrain transition state (Con-TS) calculation task manager, subclass of NormalTask
- class gvasp.common.task.DOSTask(*args, **kwargs)[源代码]
基类:
NormalTaskDensity 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,AnimatableFrequency calculation task manager, subclass of NormalTask
- class gvasp.common.task.MDTask(*args, **kwargs)[源代码]
基类:
NormalTask,XDATMovieab-initio molecular dynamics (AIMD) calculation task manager, subclass of NormalTask
- class gvasp.common.task.NEBTask(ini_poscar=None, fni_poscar=None, images=4)[源代码]
基类:
BaseTask,AnimatableNudged 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
- class gvasp.common.task.OptTask(*args, **kwargs)[源代码]
基类:
NormalTask,XDATMovieOptimization task manager, subclass of NormalTask
- class gvasp.common.task.STMTask(*args, **kwargs)[源代码]
基类:
NormalTaskScanning Tunneling Microscope (STM) image modelling calculation task manager, subclass of NormalTask
- class gvasp.common.task.SequentialTask(end)[源代码]
基类:
objectApply Sequential Task from opt => chg or opt => dos
- class gvasp.common.task.WorkFuncTask(*args, **kwargs)[源代码]
基类:
NormalTaskWork Function calculation task manager, subclass of NormalTask
- class gvasp.common.task.XDATMovie(*args, **kwargs)[源代码]
基类:
Animatable
gvasp.common.utils module
- gvasp.common.utils.is_subset_recommend_pot(element)[源代码]
Identify an element is or not in RecommendPot