pyiron_atomistics.vasp.base.VaspBase#
- class pyiron_atomistics.vasp.base.VaspBase(project, job_name)[source]#
Bases:
GenericDFTJobClass to setup and run and analyze VASP simulations which is a derivative of pyiron_atomistics.objects.job.generic.GenericJob. The functions in these modules are written in such the function names and attributes are very generic (get_structure(), molecular_dynamics(), version) but the functions are written to handle VASP specific input/output.
- Parameters:
project (pyiron_atomistics.project.Project instance) – Specifies the project path among other attributes
job_name (str) – Name of the job
- input#
Instance which handles the input
- Type:
pyiron_atomistics.vasp.vasp.Input
Examples
Let’s say you need to run a vasp simulation where you would like to control the input parameters manually. To set up a static dft run with Gaussian smearing and a k-point MP mesh of [6, 6, 6]. You would have to set it up as shown below:
>>> ham = VaspBase(job_name="trial_job") >>> ham.input.incar[IBRION] = -1 >>> ham.input.incar[ISMEAR] = 0 >>> ham.input.kpoints.set_kpoints_file(size_of_mesh=[6, 6, 6])
However, the according to pyiron’s philosophy, it is recommended to avoid using code specific tags like IBRION, ISMEAR etc. Therefore the recommended way to set this calculation is as follows:
>>> ham = VaspBase(job_name="trial_job") >>> ham.calc_static() >>> ham.set_occupancy_smearing(smearing="gaussian") >>> ham.set_kpoints(mesh=[6, 6, 6]) The exact same tags as in the first examples are set automatically.
Methods
__init__(project, job_name)animate_structure([spacefill, show_cell, ...])Animates the job if a trajectory is present
animate_structures([spacefill, show_cell, ...])Animate a series of atomic structures.
append_charge_density([job_specifier, path])Append charge density file (CHGCAR)
append_wave_function([job_specifier, path])Append wave function file (WAVECAR)
calc_md([temperature, n_ionic_steps, ...])Sets appropriate tags for molecular dynamics in VASP
calc_minimize([electronic_steps, ...])Function to setup the hamiltonian to perform ionic relaxations using DFT.
calc_static([electronic_steps, algorithm, ...])Function to setup the hamiltonian to perform static SCF DFT runs.
check_if_job_exists([job_name, project])Check if a job already exists in an specific project.
Checks whether certain parameters (such as plane wave cutoff radius in DFT) are changed from the pyiron standard values to allow for a physically meaningful results.
cleanup([files_to_remove])Removes excess files (by default: WAVECAR, CHGCAR, CHG)
Convenience function to clear job info after suspend.
Collects errors from the VASP run
Collect errors and warnings.
Collect the output files of the external executable and store the information in the HDF5 file.
collect_structures([filter_function])Collects a copy of all structures in a compact
StructureStorage.Collects warnings from the VASP run
compress([files_to_compress])Compress the output files of a job object.
continue_with_final_structure([job_type, ...])- param job_type:
continue_with_restart_files([job_type, job_name])- param job_type:
Checks for electronic and ionic convergence according to the user specified tolerance
copy()Copy the GenericJob object which links to the job and its HDF5 file
Copy a specific file to the working directory before the job is executed.
copy_hamiltonian(job_name)Copies a job to new one with a different name.
copy_template([project, new_job_name])Copy the content of the job including the HDF5 file but without the output data to a new location
copy_to([project, new_job_name, input_only, ...])Copy the content of the job including the HDF5 file to a new location.
create_job(job_type, job_name[, ...])Create one of the following jobs: - 'StructureContainer’: - ‘StructurePipeline’: - ‘AtomisticExampleJob’: example job just generating random number - ‘ExampleJob’: example job just generating random number - ‘Lammps’: - ‘KMC’: - ‘Sphinx’: - ‘Vasp’: - ‘GenericMaster’: - ‘ParallelMaster’: series of jobs run in parallel - ‘KmcMaster’: - ‘ThermoLambdaMaster’: - ‘RandomSeedMaster’: - ‘MeamFit’: - ‘Murnaghan’: - ‘MinimizeMurnaghan’: - ‘ElasticMatrix’: - ‘ConvergenceEncutParallel’: - ‘ConvergenceKpointParallel’: - ’PhonopyMaster’: - ‘DefectFormationEnergy’: - ‘LammpsASE’: - ‘PipelineMaster’: - ’TransformationPath’: - ‘ThermoIntEamQh’: - ‘ThermoIntDftEam’: - ‘ScriptJob’: Python script or jupyter notebook job container - ‘ListMaster': list of jobs
create_pipeline(step_lst[, delete_existing_job])Create a job pipeline
db_entry()Generate the initial database entry
Decompress the output files of a compressed job object.
Change the job status to aborted when the job was intercepted.
from_dict(obj_dict)Populate the object from the serialized object.
from_directory(directory)The Vasp instance is created by parsing the input and output from the specified directory
from_hdf([hdf, group_name])Recreates instance from the hdf5 file
from_hdf_args(hdf)Read arguments for instance creation from HDF5 file
get(name[, default])Internal wrapper function for __getitem__() - self[name]
Returns the total charge on every atom determined by the Bader charge partitioning scheme.
Returns the integration volume around every atom from the Bader charge partitioning scheme.
Generate calculate() function
Gets the charge density from the hdf5 file.
get_density_of_states([sigma, ...])Get density of states from a fully converged result.
- returns:
status of EDDRMM handling
Gets the electronic structure instance from the hdf5 file
Gets the electrostatic potential from the hdf5 file.
get_encut()Get the final structure calculated from the job.
get_final_structure_from_file(cwd[, filename])Get the final structure of the simulation usually from the CONTCAR file
get_from_table(path, name)Get a specific value from a pandas.Dataframe
get_icharg_value([icharg, self_consistent_calc])Gives the correct ICHARG value for the restart calculation.
Get an hierarchical dictionary of input files.
get_job_id([job_specifier])get the job_id for job named job_name in the local project path from database
get_k_mesh_by_cell(k_mesh_spacing[, cell])Get k-mesh density according to the box size.
get_kpoints()get_magnetic_moments([iteration_step])Gives the magnetic moments of a calculation for each iteration step.
get_neighbors([start, stop, stride, ...])Get the neighbors for a given section of the trajectory
get_neighbors_snapshots([snapshot_indices, ...])Get the neighbors only for the required snapshots from the trajectory
Returns the number of electrons in the systems
get_output_parameter_dict()Gets the radii of Wigner-Seitz cell.
get_structure([frame, wrap_atoms, ...])Retrieve structure from object.
Gives the valence and total charge densities
get_workdir_file(filename)Checks if a given file exists within the job's working directory and returns the absolute path to it.
gui()Returns:
inspect(job_specifier)Inspect an existing pyiron object - most commonly a job - from the database
instantiate(obj_dict[, version])Create a blank instance of this class.
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable.
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable.
interactive_flush([path, include_last_step])For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable.
Check if the job is already compressed or not.
is_master_id(job_id)Check if the job ID job_id is the master ID for any child job
Check if the HDF5 file of the Job is compressed as tar-archive
iter_structures([wrap_atoms])Iterate over all structures in this object.
job_file_name(file_name[, cwd])combine the file name file_name with the path of the current working directory
kill()Kill the job.
list_all()Returns dictionary of :method:`.list_groups()` and :method:`.list_nodes()`.
List child jobs as JobPath objects - not loading the full GenericJob objects for each child
List files inside the working directory
Return a list of names of all nested groups.
Return a list of names of all nested nodes.
Lists all the possible POTCAR files for the elements in the structure depending on the XC functional
load(job_specifier[, convert_to_object])Load an existing pyiron object - most commonly a job - from the database
map(function, parameter_lst)Create
MapMasterwith the current job as reference job.modify_kpoints()move_to(project)Move the content of the job including the HDF5 file to a new location
Function to check if there are a sufficient number of empty bands in the calculation to ensure electronic convergence.
Refresh job status by updating the job status with the status from the database if a job ID is available.
relocate_hdf5([h5_path])Relocate the hdf file.
remove([_protect_childs])Remove the job - this removes the HDF5 file, all data stored in the HDF5 file an the corresponding database entry.
remove_and_reset_id([_protect_childs])Remove the job and reset its ID.
internal function to remove command that removes also child jobs.
rename(new_job_name)Rename the job - by changing the job name
reset_job_id([job_id])Reset the job id sets the job_id to None in the GenericJob as well as all connected modules like JobStatus.
Resets the output instance
restart([job_name, job_type])Creates a "restart" job from an existing Vasp calculation.
Restart a new job created from an existing Vasp calculation by reading the charge density for band structure calculations.
restart_from_charge_density([job_name, ...])Restart a new job created from an existing Vasp calculation by reading the charge density.
restart_from_wave_and_charge([job_name, ...])Restart a new job created from an existing Vasp calculation by reading the charge density and the wave function.
restart_from_wave_functions([job_name, ...])Restart a new job created from an existing Vasp calculation by reading the wave functions.
run([delete_existing_job, repair, debug, ...])This is the main run function, depending on the job status ['initialized', 'created', 'submitted', 'running', 'collect','finished', 'refresh', 'suspended'] the corresponding run mode is chosen.
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable.
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable.
The run if modal function is called by run to execute the simulation, while waiting for the output.
Internal helper function the run if refresh function is called when the job status is 'refresh'.
The run if queue function is called by run if the user decides to submit the job to and queing system.
The run static function is called by run to execute the simulation.
Internal helper function to store the run_time in the database
save()Save the object, by writing the content to the HDF5 file and storing an entry in the database.
save_output([output_dict, shell_output])Internal helper function to store the hierarchical output dictionary in the HDF5 file of the pyiron job object
Compress HDF5 file of the job object to tar-archive
Decompress HDF5 file of the job object from tar-archive
set_algorithm([algorithm, ialgo])Sets the type of electronic minimization algorithm
set_convergence_precision([...])Sets the electronic and ionic convergence precision.
set_coulomb_interactions([interaction_type, ...])Write the on-site Coulomb interactions in the INCAR file
set_dipole_correction([direction, dipole_center])Apply a dipole correction using the dipole layer method proposed by Neugebauer & Scheffler
set_eddrmm_handling([status])Sets the way, how EDDRMM warning is handled.
set_electric_field([e_field, direction, ...])Set an external electric field using the dipole layer method proposed by Neugebauer & Scheffler
set_empty_states([n_empty_states])Sets the number of empty states in the calculation :param n_empty_states: Required number of empty states :type n_empty_states: int
set_encut(encut)Sets the plane-wave energy cutoff :param encut: The energy cutoff in eV :type encut: float
set_exchange_correlation_functional(...)set_fft_mesh([nx, ny, nz])Set the number of points in the respective directions for the 3D FFT mesh used for computing the charge density or electrostatic potentials.
set_for_band_structure_calc(num_points[, ...])Sets up the input for a non self-consistent bandstructure calculation
This function enforces read-only mode for the input classes, but it has to be implement in the individual classes.
set_kpoints([mesh, scheme, center_shift, ...])Function to setup the k-points
set_mixing_parameters([method, ...])- param method:
mixing method 'PULAY' or 'KERKER' (default: PULAY)
set_occupancy_smearing([smearing, width, ...])Set how the finite temperature smearing is applied in determining partial occupancies
set_rwigs(rwigs_dict)Sets the radii of Wigner-Seitz cell.
set_spin_constraint(lamb, rwigs_dict[, ...])Sets spin constrains including 'LAMBDA' and 'RWIGS'.
show_hdf()Iterating over the HDF5 datastructure and generating a human readable graph.
signal_intercept(sig)Abort the job and log signal that caused it.
stop_calculation([next_electronic_step])Call to stop the VASP calculation
Create
StructureContainerjob with the initial structure of the job and sets that jobsparent_idfrom this job.suspend()Suspend the job by storing the object and its state persistently in HDF5 file and exit it.
to_dict()Reduce the object to a dictionary.
to_hdf([hdf, group_name])Stores the instance attributes into the hdf5 file
to_object([object_type])Load the full pyiron object from an HDF5 file
trajectory([stride, center_of_mass, ...])Returns a Trajectory instance containing the necessary information to describe the evolution of the atomic structure during the atomistic simulation.
Transfer the job from a remote location to the local machine.
transform_structures(modify)Return a modified object by applying a function to each object lazily.
update_master([force_update])After a job is finished it checks whether it is linked to any metajob - meaning the master ID is pointing to this jobs job ID.
Returns:
view_structure([snapshot, spacefill, show_cell])- param snapshot:
Snapshot of the trajectory one wants
Call routines that generate the code specific input files Returns:
Write the magnetic moments in INCAR from that assigned to the species
write_traj(filename[, file_format, ...])Writes the trajectory in a given file file_format based on the ase.io.write function.
Attributes
Generate keyword arguments for the calculate() function.
list of child job ids - only meta jobs have child jobs - jobs which list the meta job as their master
contentdatabase_entryencutThe exchange correlation functional used (LDA or GGA)
Get the list of groups which are excluded from storing in the hdf5 file
Get the list of nodes which are excluded from storing in the hdf5 file
Get the executable used to run the job - usually the path to an external executable.
executor_typeAllows to browse the files in a job directory.
files_to_compressfiles_to_removeTells if the type of constraints the spins have for this calculation
fix_symmetryUnique id to identify the job in the pyiron database - use self.job_id instead
Unique id to identify the job in the pyiron database
Short string to describe the job by it is job_name and job ID - mainly used for logging
Get name of the job, which has to be unique within the project
['ExampleJob', 'ParallelMaster', 'ScriptJob',
Number of unreduced k-points per Angstrom of the lattice vector
Number of unreduced k-points per Angstrom of the lattice vector
kpoint_meshGet the logger object to monitor the external execution and internal pyiron warnings.
Get job id of the master job - a meta job which groups a series of jobs, which are executed either in parallel or in serial.
Get name of the job, which has to be unique within the project
maximum iteration_step + 1 that can be passed to
get_structure().Get job id of the predecessor job - the job which was executed before the current one in the current job series
Absolute path of the HDF5 group starting from the system root - combination of the absolute system path plus the absolute path inside the HDF5 file starting from the root group.
Plane wave energy cutoff in eV
potentialpotential_availablepotential_listpotential_viewProject instance the jobs is located in
Get the ProjectHDFio instance which points to the HDF5 file the job is stored in
publicationGet the queue ID, the ID returned from the queuing system - it is most likely not the same as the job ID.
Number of unreduced k-points per Angstrom of the lattice vector
A dictionary of the new name of the copied restart files
Get the list of files which are used to restart the calculation from these files.
Get the server object to handle the execution environment for the job.
How the original atom indices are ordered in the vasp format (species by species)
Returns True if the calculation is spin constrained
Execution status of the job, can be one of the following [initialized, appended, created, submitted, running,
Returns:
Get the version of the hamiltonian, which is also the version of the executable unless a custom executable is used.
Get the working directory of the job is executed in - outside the HDF5 file. The working directory equals the path but it is represented by the filesystem: /absolute/path/to/the/file.h5/path/inside/the/hdf5/file becomes: /absolute/path/to/the/file_hdf5/path/inside/the/hdf5/file.
True if the charge density file CHGCAR file is/should be written
True if the local potential or electrostatic potential LOCPOT file is/should be written
True if the resolved DOS should be written (in the vasprun.xml file)
True if the wave function file WAVECAR file is/should be written
xc- animate_structure(spacefill: bool = True, show_cell: bool = True, stride: int = 1, center_of_mass: bool = False, particle_size: float = 0.5, camera: str = 'orthographic', atom_indices: list | ndarray = None, snapshot_indices: list | ndarray = None, repeat: int | Tuple[int, int, int] = None)#
Animates the job if a trajectory is present
- Parameters:
spacefill (bool) – If True, then atoms are visualized in spacefill stype
show_cell (bool) – True if the cell boundaries of the structure is to be shown
stride (int) –
show animation every stride [::stride] use value >1 to make animation faster
default=1
particle_size (float) – Scaling factor for the spheres representing the atoms. (The radius is determined by the atomic number)
center_of_mass (bool) – False (default) if the specified positions are w.r.t. the origin
camera (str) – camera perspective, choose from “orthographic” or “perspective”
atom_indices (list/numpy.ndarray) – The atom indices for which the trajectory should be generated
snapshot_indices (list/numpy.ndarray) – The snapshots for which the trajectory should be generated
repeat (int/3-tuple of int) – Repeat the structures by this before animating
- Returns:
nglview IPython widget
- Return type:
animation
- animate_structures(spacefill: bool = True, show_cell: bool = True, center_of_mass: bool = False, particle_size: float = 0.5, camera: str = 'orthographic')#
Animate a series of atomic structures.
- Parameters:
spacefill (bool) – If True, then atoms are visualized in spacefill stype
show_cell (bool) – True if the cell boundaries of the structure is to be shown
particle_size (float) – Scaling factor for the spheres representing the atoms. (The radius is determined by the atomic number)
center_of_mass (bool) – False (default) if the specified positions are w.r.t. the origin
camera (str) – camera perspective, choose from “orthographic” or “perspective”
- Returns:
nglview IPython widget
- Return type:
animation
- append_charge_density(job_specifier=None, path=None)[source]#
Append charge density file (CHGCAR)
- Parameters:
job_specifier (str/int) – name of the job or job ID
path (str) – path to CHGCAR file
- append_wave_function(job_specifier=None, path=None)[source]#
Append wave function file (WAVECAR)
- Parameters:
job_specifier (str/int) – name of the job or job ID
path (str) – path to WAVECAR file
- calc_md(temperature=None, n_ionic_steps=1000, n_print=1, time_step=1.0, retain_charge_density=False, retain_electrostatic_potential=False, **kwargs)[source]#
Sets appropriate tags for molecular dynamics in VASP
- Parameters:
temperature (int/float/list) – Temperature/ range of temperatures in Kelvin
n_ionic_steps (int) – Maximum number of ionic steps
n_print (int) – Prints outputs every n_print steps
time_step (float) – time step (fs)
retain_charge_density (bool) – True id the charge density should be written
retain_electrostatic_potential (bool) – True if the electrostatic potential should be written
- calc_minimize(electronic_steps=60, ionic_steps=100, max_iter=None, pressure=None, algorithm=None, retain_charge_density=False, retain_electrostatic_potential=False, ionic_energy_tolerance=None, ionic_force_tolerance=None, volume_only=False, cell_only=False)[source]#
Function to setup the hamiltonian to perform ionic relaxations using DFT. The ISIF tag has to be supplied separately.
- Parameters:
electronic_steps (int) – Maximum number of electronic steps
ionic_steps (int) – Maximum number of ionic
max_iter (int) – Maximum number of iterations
pressure (float) – External pressure to be applied
algorithm (str) – Type of VASP algorithm to be used “Fast”/”Accurate”
retain_charge_density (bool) – True if the charge density should be written
retain_electrostatic_potential (boolean) – True if the electrostatic potential should be written
ionic_energy_tolerance (float) – Ionic energy convergence criteria (eV)
ionic_force_tolerance (float) – Ionic forces convergence criteria (overwrites ionic energy) (ev/A)
volume_only (bool) – Option to relax only the volume (keeping the relative coordinates fixed)
cell_only (bool) – Option to relax only the cell parameters (keeping the relative coordinates fixed)
- calc_static(electronic_steps=100, algorithm=None, retain_charge_density=False, retain_electrostatic_potential=False)[source]#
Function to setup the hamiltonian to perform static SCF DFT runs.
- Parameters:
electronic_steps (int) – Maximum number of electronic steps
algorithm (str) – Type of VASP algorithm to be used “Fast”/”Accurate”
retain_charge_density (bool) – True if
retain_electrostatic_potential (bool) – True/False
- property calculate_kwargs: dict#
Generate keyword arguments for the calculate() function. A new simulation code only has to extend the get_input_parameter_dict() function which by default specifies an hierarchical dictionary with files_to_write and files_to_copy.
Example:
>>> calculate_function = job.get_calculate_function() >>> shell_output, parsed_output, job_crashed = calculate_function(**job.calculate_kwargs) >>> job.save_output(output_dict=parsed_output, shell_output=shell_output)
- Returns:
keyword arguments for the calculate() function
- Return type:
dict
- check_if_job_exists(job_name: str | None = None, project: ProjectHDFio | pyiron_base.project.generic.Project | None = None)#
Check if a job already exists in an specific project.
- Parameters:
job_name (str) – Job name (optional)
project (ProjectHDFio, Project) – Project path (optional)
- Returns:
True / False
- Return type:
(bool)
- check_setup() None#
Checks whether certain parameters (such as plane wave cutoff radius in DFT) are changed from the pyiron standard values to allow for a physically meaningful results. This function is called manually or only when the job is submitted to the queueing system.
- property child_ids: list#
list of child job ids - only meta jobs have child jobs - jobs which list the meta job as their master
- Returns:
list of child job ids
- Return type:
list
- cleanup(files_to_remove=('WAVECAR', 'CHGCAR', 'CHG', 'vasprun.xml'))[source]#
Removes excess files (by default: WAVECAR, CHGCAR, CHG)
- clear_job() None#
Convenience function to clear job info after suspend. Mimics deletion of all the job info after suspend in a local test environment.
- collect_output()[source]#
Collect the output files of the external executable and store the information in the HDF5 file. This method has to be implemented in the individual hamiltonians.
- collect_structures(filter_function=None) StructureStorage#
Collects a copy of all structures in a compact
StructureStorage.This can be used to force lazily applied modifications with
transform_structures()or simply to obtain a known object type from a genericHasStructureobject.- Parameters:
filter_function (function) – include structure only if this function returns True for it
- Returns:
a copy of all (filtered) structures
- Return type:
- compress(files_to_compress=None)[source]#
Compress the output files of a job object.
- Parameters:
files_to_compress (list) – A list of files to compress (optional)
- continue_with_final_structure(job_type=None, job_name=None)#
- Parameters:
job_type
job_name
Returns:
- continue_with_restart_files(job_type=None, job_name=None)#
- Parameters:
job_type
job_name
Returns:
- convergence_check()[source]#
Checks for electronic and ionic convergence according to the user specified tolerance
- Returns:
True if converged
- Return type:
bool
- copy() GenericJob#
Copy the GenericJob object which links to the job and its HDF5 file
- Returns:
New GenericJob object pointing to the same job
- Return type:
GenericJob
- copy_file_to_working_directory(file: str) None#
Copy a specific file to the working directory before the job is executed.
- Parameters:
file (str) – path of the file to be copied.
- copy_hamiltonian(job_name)[source]#
Copies a job to new one with a different name.
- Parameters:
job_name (str) – Job name
- Returns:
New job
- Return type:
pyiron.vasp.vasp.Vasp
- copy_template(project: ProjectHDFio | JobCore | None = None, new_job_name: None = None) GenericJob#
Copy the content of the job including the HDF5 file but without the output data to a new location
- Parameters:
project (JobCore/ProjectHDFio/Project/None) – The project to copy the job to. (Default is None, use the same project.)
new_job_name (str) – The new name to assign the duplicate job. Required if the project is None or the same project as the copied job. (Default is None, try to keep the same name.)
- Returns:
GenericJob object pointing to the new location.
- Return type:
GenericJob
- copy_to(project: ProjectHDFio | JobCore | None = None, new_job_name: str | None = None, input_only: bool = False, new_database_entry: bool = True, delete_existing_job: bool = False, copy_files: bool = True)#
Copy the content of the job including the HDF5 file to a new location.
- Parameters:
project (JobCore/ProjectHDFio/Project/None) – The project to copy the job to. (Default is None, use the same project.)
new_job_name (str) – The new name to assign the duplicate job. Required if the project is None or the same project as the copied job. (Default is None, try to keep the same name.)
input_only (bool) – [True/False] Whether to copy only the input. (Default is False.)
new_database_entry (bool) – [True/False] Whether to create a new database entry. If input_only is True then new_database_entry is False. (Default is True.)
delete_existing_job (bool) – [True/False] Delete existing job in case it exists already (Default is False.)
copy_files (bool) – If True copy all files the working directory of the job, too
- Returns:
GenericJob object pointing to the new location.
- Return type:
GenericJob
- create_job(job_type: str, job_name: str, delete_existing_job: bool = False) GenericJob#
Create one of the following jobs: - ‘StructureContainer’: - ‘StructurePipeline’: - ‘AtomisticExampleJob’: example job just generating random number - ‘ExampleJob’: example job just generating random number - ‘Lammps’: - ‘KMC’: - ‘Sphinx’: - ‘Vasp’: - ‘GenericMaster’: - ‘ParallelMaster’: series of jobs run in parallel - ‘KmcMaster’: - ‘ThermoLambdaMaster’: - ‘RandomSeedMaster’: - ‘MeamFit’: - ‘Murnaghan’: - ‘MinimizeMurnaghan’: - ‘ElasticMatrix’: - ‘ConvergenceEncutParallel’: - ‘ConvergenceKpointParallel’: - ’PhonopyMaster’: - ‘DefectFormationEnergy’: - ‘LammpsASE’: - ‘PipelineMaster’: - ’TransformationPath’: - ‘ThermoIntEamQh’: - ‘ThermoIntDftEam’: - ‘ScriptJob’: Python script or jupyter notebook job container - ‘ListMaster’: list of jobs
- Parameters:
job_type (str) – job type can be [‘StructureContainer’, ‘StructurePipeline’, ‘AtomisticExampleJob’, ‘ExampleJob’, ‘Lammps’, ‘KMC’, ‘Sphinx’, ‘Vasp’, ‘GenericMaster’, ‘ParallelMaster’, ‘KmcMaster’, ‘ThermoLambdaMaster’, ‘RandomSeedMaster’, ‘MeamFit’, ‘Murnaghan’, ‘MinimizeMurnaghan’, ‘ElasticMatrix’, ‘ConvergenceEncutParallel’, ‘ConvergenceKpointParallel’, ’PhonopyMaster’, ‘DefectFormationEnergy’, ‘LammpsASE’, ‘PipelineMaster’, ’TransformationPath’, ‘ThermoIntEamQh’, ‘ThermoIntDftEam’, ‘ScriptJob’, ‘ListMaster’]
job_name (str) – name of the job
delete_existing_job (bool) – delete an existing job - default false
- Returns:
job object depending on the job_type selected
- Return type:
GenericJob
- create_pipeline(step_lst, delete_existing_job=False)#
Create a job pipeline
- Parameters:
step_lst (list) – List of functions which create calculations
- Return type:
FlexibleMaster
- db_entry()#
Generate the initial database entry
- Returns:
db_dict
- Return type:
(dict)
- decompress() None#
Decompress the output files of a compressed job object.
- drop_status_to_aborted() None#
Change the job status to aborted when the job was intercepted.
- property exchange_correlation_functional#
The exchange correlation functional used (LDA or GGA)
- property exclude_groups_hdf: list#
Get the list of groups which are excluded from storing in the hdf5 file
- Returns:
groups(list)
- property exclude_nodes_hdf: list#
Get the list of nodes which are excluded from storing in the hdf5 file
- Returns:
nodes(list)
- property executable: Executable#
Get the executable used to run the job - usually the path to an external executable.
- Returns:
exectuable path
- Return type:
(str/pyiron_base.job.executable.Executable)
- property files: FileBrowser#
Allows to browse the files in a job directory.
By default this object prints itself as a listing of the job directory and the files inside.
>>> job.files /path/to/my/job: pyiron.log error.out
Access to the names of files is provided with
list()>>> job.files.list() ['pyiron.log', 'error.out', 'INCAR']
Access to the contents of files is provided by indexing into this object, which returns a list of lines in the file
>>> job.files['error.out'] ["Oh no
“, “Something went wrong! “]
The
tail()method prints the last lines of a file to stdout>>> job.files.tail('error.out', lines=1) Something went wrong!
For files that have valid python variable names can also be accessed by attribute notation
>>> job.files.INCAR File('INCAR')
- property fix_spin_constraint#
Tells if the type of constraints the spins have for this calculation
- Type:
bool
- from_dict(obj_dict)[source]#
Populate the object from the serialized object.
- Parameters:
obj_dict (dict) – data previously returned from
to_dict()version (str) – version tag written together with the data
- from_directory(directory)[source]#
The Vasp instance is created by parsing the input and output from the specified directory
- Parameters:
directory (str) – Path to the directory
- from_hdf(hdf=None, group_name=None)[source]#
Recreates instance from the hdf5 file
- Parameters:
hdf (pyiron_base.generic.hdfio.ProjectHDFio) – The HDF file/path to read the data from
group_name (str) – The name of the group under which the data must be stored as
- classmethod from_hdf_args(hdf: ProjectHDFio) dict#
Read arguments for instance creation from HDF5 file
- Parameters:
hdf (ProjectHDFio) – HDF5 group object
- get(name: str, default: Any | None = None) Any#
Internal wrapper function for __getitem__() - self[name]
- Parameters:
key (str, slice) – path to the data or key of the data object
default (any, optional) – return this if key cannot be found
- Returns:
data or data object
- Return type:
dict, list, float, int
- Raises:
ValueError – key cannot be found and default is not given
- get_bader_charges()#
Returns the total charge on every atom determined by the Bader charge partitioning scheme.
- Returns:
The Bader charges for each atom
- Return type:
numpy.ndarray
- get_bader_volumes()#
Returns the integration volume around every atom from the Bader charge partitioning scheme.
- Returns:
The Bader charges for each atom
- Return type:
numpy.ndarray
- get_calculate_function() callable#
Generate calculate() function
Example:
>>> calculate_function = job.get_calculate_function() >>> shell_output, parsed_output, job_crashed = calculate_function(**job.calculate_kwargs) >>> job.save_output(output_dict=parsed_output, shell_output=shell_output)
- Returns:
calculate() functione
- Return type:
callable
- get_charge_density()[source]#
Gets the charge density from the hdf5 file. This value is normalized by the volume
- Returns:
atomistics.volumetric.generic.VolumetricData instance
- get_density_of_states(sigma=0.1, shift_by_fermi_energy=True, grid=None)#
Get density of states from a fully converged result. A Gaussian smeared histogram is returned
- Parameters:
sigma (float) – Gaussian smearing parameter in energy unit.
shift_by_fermi_energy (bool) – Shift the histogram by the Fermi energy value. Setting this to False will return code specific absolute values which have physically no meaning.
grid (list/numpy.ndarray) – Energy grid. If None, the interval between maximum and minimum eigenvalues plus 5 x sigma with a step length of sigma will be taken.
- Returns:
grid and density of states (n_spin x energy_grid)
- Return type:
(dict)
- get_electronic_structure()#
Gets the electronic structure instance from the hdf5 file
- Returns:
pyiron_atomistics.atomistics.waves.electronic.ElectronicStructure instance
- get_electrostatic_potential()[source]#
Gets the electrostatic potential from the hdf5 file.
- Returns:
atomistics.volumetric.generic.VolumetricData instance
- get_final_structure_from_file(cwd, filename='CONTCAR')[source]#
Get the final structure of the simulation usually from the CONTCAR file
- Parameters:
filename (str) – Path to the CONTCAR file in VASP
- Returns:
The final structure
- Return type:
pyiron.atomistics.structure.atoms.Atoms
- get_from_table(path: str, name: str) dict | list | float | int#
Get a specific value from a pandas.Dataframe
- Parameters:
path (str) – relative path to the data object
name (str) – parameter key
- Returns:
the value associated to the specific parameter key
- Return type:
dict, list, float, int
- get_icharg_value(icharg=None, self_consistent_calc=None)[source]#
Gives the correct ICHARG value for the restart calculation.
- Parameters:
icharg (int/None) – If given, this value will be checked for validity and returned.
self_consistent_calc (bool/None) – If ‘True’ returns 1, if ‘False’ returns 11, if ‘None’ returns based on the job either 1 or 11.
- Returns:
the icharg tag
- Return type:
int
- get_input_parameter_dict() dict[source]#
Get an hierarchical dictionary of input files. On the first level the dictionary is divided in file_to_create and files_to_copy. Both are dictionaries use the file names as keys. In file_to_create the values are strings which represent the content which is going to be written to the corresponding file. In files_to_copy the values are the paths to the source files to be copied.
The get_input_file_dict() function is called before the write_input() function to convert the input specified on the job object to strings which can be written to the working directory as well as files which are copied to the working directory. After the write_input() function wrote the input files the executable is called.
- Returns:
hierarchical dictionary of input files
- Return type:
dict
- get_job_id(job_specifier: int | str | None = None) int | None#
get the job_id for job named job_name in the local project path from database
- Parameters:
job_specifier (str, int) – name of the job or job ID
- Returns:
job ID of the job
- Return type:
int
- get_k_mesh_by_cell(k_mesh_spacing, cell=None)#
Get k-mesh density according to the box size.
- Parameters:
k_mesh_spacing (float) – K-point spacing in units of 2 * pi reciprocal Angstrom. (smaller values result in a denser mesh for a given structure).
cell (numpy.ndarray/list) – The cell shape
- Returns:
Mesh size
- Return type:
list/numpy.ndarray
- get_magnetic_moments(iteration_step=-1)[source]#
Gives the magnetic moments of a calculation for each iteration step.
- Parameters:
iteration_step (int) – Step for which the structure is requested
- Returns:
array of final magmetic moments or None if no magnetic moment is given
- Return type:
numpy.ndarray/None
- get_neighbors(start=0, stop=-1, stride=1, num_neighbors=12, **kwargs)#
Get the neighbors for a given section of the trajectory
- Parameters:
start (int) – Start point of the slice of the trajectory to be sampled
stop (int) – End point of of the slice of the trajectory to be sampled
stride (int) – Samples the snapshots evert stride steps
num_neighbors (int) – The cutoff for the number of neighbors
**kwargs (dict) – Additional arguments to be passed to the get_neighbors() routine (eg. cutoff_radius, norm_order , etc.)
- Returns:
- NeighborsTraj instances
containing the neighbor information.
- Return type:
pyiron_atomistics.atomistics.structure.neighbors.NeighborsTrajectory
- get_neighbors_snapshots(snapshot_indices=None, num_neighbors=12, **kwargs)#
Get the neighbors only for the required snapshots from the trajectory
- Parameters:
snapshot_indices (list/numpy.ndarray) – Snapshots for which the the neighbors need to be computed (eg. [1, 5, 10,…, 100]
num_neighbors (int) – The cutoff for the number of neighbors
**kwargs (dict) – Additional arguments to be passed to the get_neighbors() routine (eg. cutoff_radius, norm_order , etc.)
- Returns:
- NeighborsTraj instances
containing the neighbor information.
- Return type:
pyiron_atomistics.atomistics.structure.neighbors.NeighborsTrajectory
- get_nelect()[source]#
Returns the number of electrons in the systems
- Returns:
Number of electrons in the system
- Return type:
float
- get_rwigs()[source]#
Gets the radii of Wigner-Seitz cell. (RWIGS tag)
- Returns:
dictionary of radii
- Return type:
dict
- get_structure(frame=-1, wrap_atoms=True, iteration_step=None)#
Retrieve structure from object. The number of available structures depends on the job and what kind of calculation has been run on it, see
number_of_structures.- Parameters:
frame (int, object) – index of the structure requested, if negative count from the back; if
:param
_translate_frame()is overridden: :param frame will pass through it: :param iteration_step: deprecated alias for frame :type iteration_step: int :param wrap_atoms: True if the atoms are to be wrapped back into the unit cell :type wrap_atoms: bool- Returns:
the requested structure
- Return type:
- Raises:
IndexError – if not -
number_of_structures<= iteration_step <number_of_structures
- get_valence_and_total_charge_density()[source]#
Gives the valence and total charge densities
- Returns:
The required charge densities
- Return type:
tuple
- get_workdir_file(filename: str) None#
Checks if a given file exists within the job’s working directory and returns the absolute path to it.
ToDo: Move this to pyiron_base since this is more generic.
- Parameters:
filename (str) – The name of the file
- Returns:
The name absolute path of the file in the working directory
- Return type:
str
- Raises:
FileNotFoundError – Raised if the given file does not exist.
- gui()#
Returns:
- property id: int#
Unique id to identify the job in the pyiron database - use self.job_id instead
- Returns:
job id
- Return type:
int
- inspect(job_specifier: str | int) JobCore#
Inspect an existing pyiron object - most commonly a job - from the database
- Parameters:
job_specifier (str, int) – name of the job or job ID
- Returns:
Access to the HDF5 object - not a GenericJob object - use load() instead.
- Return type:
JobCore
- classmethod instantiate(obj_dict: dict, version: str = None) Self#
Create a blank instance of this class.
This can be used when some values are already necessary for the objects __init__.
- Parameters:
obj_dict (dict) – data previously returned from
to_dict()version (str) – version tag written together with the data
- Returns:
a blank instance of the object that is sufficiently initialized to call
_from_dict()on it- Return type:
object
- interactive_close() None#
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job. After the interactive execution, the job can be closed using the interactive_close function.
- interactive_fetch() None#
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job. To access the output data during the execution the interactive_fetch function is used.
- interactive_flush(path: str = 'generic', include_last_step: bool = True) None#
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job. To write the interactive cache to the HDF5 file the interactive flush function is used.
- is_compressed() bool#
Check if the job is already compressed or not.
- Returns:
[True/False]
- Return type:
bool
- is_master_id(job_id: int) bool#
Check if the job ID job_id is the master ID for any child job
- Parameters:
job_id (int) – job ID of the master job
- Returns:
[True/False]
- Return type:
bool
- is_self_archived() bool#
Check if the HDF5 file of the Job is compressed as tar-archive
- Returns:
[True/False]
- Return type:
bool
- iter_structures(wrap_atoms=True)#
Iterate over all structures in this object.
- Parameters:
wrap_atoms (bool) – True if the atoms are to be wrapped back into the unit cell; passed to
get_structure()- Yields:
pyiron_atomistics.atomistitcs.structure.atoms.Atoms– every structure attached to the object
- job_file_name(file_name: str, cwd: str | None = None) str#
combine the file name file_name with the path of the current working directory
- Parameters:
file_name (str) – name of the file
cwd (str) – current working directory - this overwrites self.project_hdf5.working_directory - optional
- Returns:
absolute path to the file in the current working directory
- Return type:
str
- property job_id: int#
Unique id to identify the job in the pyiron database
- Returns:
job id
- Return type:
int
- property job_info_str: str#
Short string to describe the job by it is job_name and job ID - mainly used for logging
- Returns:
job info string
- Return type:
str
- property job_name: str#
Get name of the job, which has to be unique within the project
- Returns:
job name
- Return type:
str
- property job_type: str#
- [‘ExampleJob’, ‘ParallelMaster’, ‘ScriptJob’,
‘ListMaster’]
- Returns:
Job type object
- Return type:
JobTypeChoice
- Type:
Job type object with all the available job types
- property k_mesh_center_shift#
Number of unreduced k-points per Angstrom of the lattice vector
- Returns:
Number of k-points per Angstrom
- Return type:
float
- property k_mesh_spacing#
Number of unreduced k-points per Angstrom of the lattice vector
- Returns:
Number of k-points per Angstrom
- Return type:
float
- kill() None#
Kill the job.
This function is used to terminate the execution of the job. It checks if the job is currently running or submitted, and if so, it removes and resets the job ID. If the job is not running or submitted, a ValueError is raised.
- Returns:
None
- list_all()#
Returns dictionary of :method:`.list_groups()` and :method:`.list_nodes()`.
- Returns:
- results of :method:`.list_groups() under the key "groups"; results of :method:`.list_nodes()` und the
key “nodes”
- Return type:
dict
- list_childs() list#
List child jobs as JobPath objects - not loading the full GenericJob objects for each child
- Returns:
list of child jobs
- Return type:
list
- list_files() list#
List files inside the working directory
- Parameters:
extension (str) – filter by a specific extension
- Returns:
list of file names
- Return type:
list
- list_groups()#
Return a list of names of all nested groups.
- Returns:
group names
- Return type:
list of str
- list_nodes()#
Return a list of names of all nested nodes.
- Returns:
node names
- Return type:
list of str
- list_potentials()[source]#
Lists all the possible POTCAR files for the elements in the structure depending on the XC functional
- Returns:
a list of available potentials
- Return type:
list
- load(job_specifier: str | int, convert_to_object: bool = True) pyiron_base.job.generic.GenericJob | JobCore#
Load an existing pyiron object - most commonly a job - from the database
- Parameters:
job_specifier (str, int) – name of the job or job ID
convert_to_object (bool) – convert the object to an pyiron object or only access the HDF5 file - default=True accessing only the HDF5 file is about an order of magnitude faster, but only provides limited functionality. Compare the GenericJob object to JobCore object.
- Returns:
Either the full GenericJob object or just a reduced JobCore object
- Return type:
GenericJob, JobCore
- property logger#
Get the logger object to monitor the external execution and internal pyiron warnings.
- Returns:
logger object
- Return type:
logging.getLogger()
- map(function, parameter_lst)#
Create
MapMasterwith the current job as reference job.The job name is created as ‘map_{self.name}’
- Parameters:
function (callable) – passed as modify_function to the map master
parameter_list (list) – passed as parameter_list to the map master
- Returns:
newly created master job
- Return type:
- property master_id: int#
Get job id of the master job - a meta job which groups a series of jobs, which are executed either in parallel or in serial.
- Returns:
master id
- Return type:
int
- move_to(project: ProjectHDFio) None#
Move the content of the job including the HDF5 file to a new location
- Parameters:
project (ProjectHDFio) – project to move the job to
- property name: str#
Get name of the job, which has to be unique within the project
- Returns:
job name
- Return type:
str
- nbands_convergence_check()#
Function to check if there are a sufficient number of empty bands in the calculation to ensure electronic convergence.
- Returns:
True if the highest band is unoccupied, False if the highest band is occupied
- Return type:
bool
- property number_of_structures#
maximum iteration_step + 1 that can be passed to
get_structure().- Type:
int
- property parent_id: int#
Get job id of the predecessor job - the job which was executed before the current one in the current job series
- Returns:
parent id
- Return type:
int
- property path: str#
Absolute path of the HDF5 group starting from the system root - combination of the absolute system path plus the absolute path inside the HDF5 file starting from the root group.
- Returns:
absolute path
- Return type:
str
- property plane_wave_cutoff#
Plane wave energy cutoff in eV
- property project: pyiron_base.project.generic.Project#
Project instance the jobs is located in
- Returns:
project the job is located in
- Return type:
- property project_hdf5: ProjectHDFio#
Get the ProjectHDFio instance which points to the HDF5 file the job is stored in
- Returns:
HDF5 project
- Return type:
ProjectHDFio
- property queue_id: int#
Get the queue ID, the ID returned from the queuing system - it is most likely not the same as the job ID.
- Returns:
queue ID
- Return type:
int
- property reduce_kpoint_symmetry#
Number of unreduced k-points per Angstrom of the lattice vector
- Returns:
Number of k-points per Angstrom
- Return type:
float
- refresh_job_status() None#
Refresh job status by updating the job status with the status from the database if a job ID is available.
- relocate_hdf5(h5_path: str | None = None)#
Relocate the hdf file. This function is needed when the child job is spawned by a parent job (cf. pyiron_base.jobs.master.generic)
- remove(_protect_childs: bool = True) None#
Remove the job - this removes the HDF5 file, all data stored in the HDF5 file an the corresponding database entry.
- Parameters:
_protect_childs (bool) – [True/False] by default child jobs can not be deleted, to maintain the consistency - default=True
- remove_and_reset_id(_protect_childs: bool = True) None#
Remove the job and reset its ID.
- Parameters:
_protect_childs (bool) – Flag indicating whether to protect child jobs (default is True).
- Returns:
None
- remove_child() None#
internal function to remove command that removes also child jobs. Do never use this command, since it will destroy the integrity of your project.
- rename(new_job_name: str) None#
Rename the job - by changing the job name
- Parameters:
new_job_name (str) – new job name
- reset_job_id(job_id: int | None = None) None#
Reset the job id sets the job_id to None in the GenericJob as well as all connected modules like JobStatus.
- restart(job_name=None, job_type=None)[source]#
Creates a “restart” job from an existing Vasp calculation. (Default behaviour is to copy CONTCAR -> POSCAR, all other job inputs are copied from original job)
Usage: job.restart().run() restarts the job with job_name: “$(original_job_name)_restart”
- Parameters:
job_name (str) – Job name
job_type (str) – Job type. If not specified a Vasp job type is assumed
- Returns:
New job
- Return type:
new_ham (vasp.vasp.Vasp instance)
- property restart_file_dict: dict#
A dictionary of the new name of the copied restart files
- property restart_file_list: list#
Get the list of files which are used to restart the calculation from these files.
- Returns:
list of files
- Return type:
list
- restart_for_band_structure_calculations(job_name=None)[source]#
Restart a new job created from an existing Vasp calculation by reading the charge density for band structure calculations.
- Parameters:
job_name (str/None) – Job name
- Returns:
New job
- Return type:
new_ham (vasp.vasp.Vasp instance)
- restart_from_charge_density(job_name=None, job_type=None, icharg=None, self_consistent_calc=None)[source]#
Restart a new job created from an existing Vasp calculation by reading the charge density.
- Parameters:
job_name (str/None) – Job name
job_type (str/None) – Job type. If not specified a Vasp job type is assumed
icharg (int/None) – If given, this value will be checked for validity and returned.
self_consistent_calc (bool/None) – If ‘True’ returns 1, if ‘False’ returns 11, if ‘None’ returns based on the job either 1 or 11.
- Returns:
New job
- Return type:
new_ham (vasp.vasp.Vasp instance)
- restart_from_wave_and_charge(job_name=None, job_type=None, icharg=None, self_consistent_calc=None, istart=1)[source]#
Restart a new job created from an existing Vasp calculation by reading the charge density and the wave function.
- Parameters:
job_name (str/None) – Job name
job_type (str/None) – Job type. If not specified a Vasp job type is assumed
icharg (int/None) – If given, this value will be checked for validity and returned.
self_consistent_calc (bool/None) – If ‘True’ returns 1, if ‘False’ returns 11, if ‘None’ returns based on the job either 1 or 11.
istart (int) – Vasp ISTART tag
- Returns:
New job
- Return type:
new_ham (vasp.vasp.Vasp instance)
- restart_from_wave_functions(job_name=None, job_type=None, istart=1)[source]#
Restart a new job created from an existing Vasp calculation by reading the wave functions.
- Parameters:
job_name (str/None) – Job name
job_type (str/None) – Job type. If not specified a Vasp job type is assumed
istart (int) – Vasp ISTART tag
- Returns:
New job
- Return type:
new_ham (vasp.vasp.Vasp instance)
- run(delete_existing_job: bool = False, repair: bool = False, debug: bool = False, run_mode: str | None = None, run_again: bool = False) None#
This is the main run function, depending on the job status [‘initialized’, ‘created’, ‘submitted’, ‘running’, ‘collect’,’finished’, ‘refresh’, ‘suspended’] the corresponding run mode is chosen.
- Parameters:
delete_existing_job (bool) – Delete the existing job and run the simulation again.
repair (bool) – Set the job status to created and run the simulation again.
debug (bool) – Debug Mode - defines the log level of the subprocess the job is executed in.
run_mode (str) – [‘modal’, ‘non_modal’, ‘queue’, ‘manual’] overwrites self.server.run_mode
run_again (bool) – Same as delete_existing_job (deprecated)
- run_if_interactive() None#
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job.
- run_if_interactive_non_modal() None#
For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job.
- run_if_modal() None#
The run if modal function is called by run to execute the simulation, while waiting for the output. For this we use subprocess.check_output()
- run_if_refresh() None#
Internal helper function the run if refresh function is called when the job status is ‘refresh’. If the job was suspended previously, the job is going to be started again, to be continued.
- run_if_scheduler() None | int#
The run if queue function is called by run if the user decides to submit the job to and queing system. The job is submitted to the queuing system using subprocess.Popen() :returns: Returns the queue ID for the job. :rtype: int
- run_static() None | int#
The run static function is called by run to execute the simulation.
- run_time_to_db() None#
Internal helper function to store the run_time in the database
- save()#
Save the object, by writing the content to the HDF5 file and storing an entry in the database.
- Returns:
Job ID stored in the database
- Return type:
(int)
- save_output(output_dict: dict | None = None, shell_output: str | None = None)[source]#
Internal helper function to store the hierarchical output dictionary in the HDF5 file of the pyiron job object
- Parameters:
output_dict (dict) – hierarchical output dictionary
- self_archive() None#
Compress HDF5 file of the job object to tar-archive
- self_unarchive() None#
Decompress HDF5 file of the job object from tar-archive
- property server: Server#
Get the server object to handle the execution environment for the job.
- Returns:
server object
- Return type:
Server
- set_algorithm(algorithm='Fast', ialgo=None)[source]#
Sets the type of electronic minimization algorithm
- Parameters:
algorithm (str) – Algorithm defined by VASP (Fast, Normal etc.)
ialgo (int) – Sets the IALGO tag in VASP. If not none, this overwrites algorithm
- set_convergence_precision(ionic_energy_tolerance=0.001, electronic_energy=1e-07, ionic_force_tolerance=0.01)[source]#
Sets the electronic and ionic convergence precision. For ionic convergence either the energy or the force precision is required
- Parameters:
ionic_energy_tolerance (float) – Ionic energy convergence precision (eV)
electronic_energy (float/NoneType) – Electronic energy convergence precision (eV)
ionic_force_tolerance (float) – Ionic force convergence precision (eV/A)
- set_coulomb_interactions(interaction_type=2, ldau_print=True)[source]#
Write the on-site Coulomb interactions in the INCAR file
- Parameters:
interaction_type (int) – Type of Coulombic interaction 1 - Asimov method 2 - Dudarev method
ldau_print (boolean) – True/False
- set_dipole_correction(direction=2, dipole_center=None)[source]#
Apply a dipole correction using the dipole layer method proposed by Neugebauer & Scheffler
- Parameters:
direction (int) – Direction along which the field has to be applied (0, 1, or 2)
dipole_center (list/numpy.ndarray) – Position of the center of the dipole (not the center of the vacuum) in relative coordinates
- set_eddrmm_handling(status='warn')[source]#
Sets the way, how EDDRMM warning is handled.
- Parameters:
status (str) – new status of EDDRMM handling (can be ‘warn’, ‘ignore’, or ‘restart’)
- set_electric_field(e_field=0.1, direction=2, dipole_center=None)[source]#
Set an external electric field using the dipole layer method proposed by Neugebauer & Scheffler
- Parameters:
e_field (float) – Magnitude of the external electric field (eV/A)
direction (int) – Direction along which the field has to be applied (0, 1, or 2)
dipole_center (list/numpy.ndarray) – Position of the center of the dipole (not the center of the vacuum) in relative coordinates
- set_empty_states(n_empty_states=None)[source]#
Sets the number of empty states in the calculation :param n_empty_states: Required number of empty states :type n_empty_states: int
- set_encut(encut)#
Sets the plane-wave energy cutoff :param encut: The energy cutoff in eV :type encut: float
- set_fft_mesh(nx=None, ny=None, nz=None)[source]#
Set the number of points in the respective directions for the 3D FFT mesh used for computing the charge density or electrostatic potentials. In VASP, using PAW potentials, this refers to the “finer fft mesh”. If no values are set, the default settings from Vasp are used to set the number of grid points.
- Parameters:
nx (int) – Number of points on the x-grid
ny (int) – Number of points on the y-grid
nz (int) – Number of points on the z-grid
- set_for_band_structure_calc(num_points, structure=None, read_charge_density=True)[source]#
Sets up the input for a non self-consistent bandstructure calculation
- Parameters:
num_points (int) – Number of k-points along the total BZ path
structure (atomistics.structure.atoms.Atoms instance) – Structure for which the bandstructure is to be generated. (default is the input structure)
read_charge_density (boolean) – If True, a charge density from a previous SCF run is used (recommended)
- set_input_to_read_only()[source]#
This function enforces read-only mode for the input classes, but it has to be implement in the individual classes.
- set_kpoints(mesh=None, scheme='MP', center_shift=None, symmetry_reduction=True, manual_kpoints=None, weights=None, reciprocal=True, k_mesh_spacing=None, n_path=None, path_name=None)#
Function to setup the k-points
- Parameters:
mesh (list/numpy.ndarray) – Size of the mesh (ignored if scheme is not set to ‘MP’ or kpoints_per_reciprocal_
set) (angstrom is)
scheme (str) – Type of k-point generation scheme (MP/GP(gamma point)/Manual/Line)
center_shift (list/numpy.ndarray/None) – Shifts the center of the mesh from the gamma point by the given vector in relative coordinates
symmetry_reduction (boolean) – Tells if the symmetry reduction is to be applied to the k-points
manual_kpoints (list/numpy.ndarray) – Manual list of k-points
weights (list/numpy.ndarray) – Manually supplied weights to each k-point in case of the manual mode
reciprocal (bool) – Tells if the supplied values are in reciprocal (direct) or cartesian coordinates (in
space) (reciprocal)
k_mesh_spacing (float) – K-point spacing in units of 2 * pi reciprocal Angstrom. (smaller values result in a denser mesh for a given structure).
n_path (int) – Number of points per trace part for line mode
path_name (str) – Name of high symmetry path used for band structure calculations.
- set_mixing_parameters(method=None, n_pulay_steps=None, density_mixing_parameter=None, spin_mixing_parameter=None, density_residual_scaling=None, spin_residual_scaling=None)[source]#
- Parameters:
method (str) – mixing method ‘PULAY’ or ‘KERKER’ (default: PULAY)
n_pulay_steps (int) – number of previous densities to use for the Pulay mixing (default: 7)
density_mixing_parameter (float) – mixing ratio of rho_opt to rho_in
spin_mixing_parameter (float) – linear mixing parameter for spin densities
density_residual_scaling (float) – scaling for the residual contribution of the Kerker mixing. 1 means it takes as much rho_in (input density) as residual (where Kerker preconditioning applies). The lower the value, the smaller the residual contribution becomes.
spin_residual_scaling (float) – scaling for the spin residual (cf. density_residual_scaling)
by (Mixing ratio m is given) – rho^n = (m-1)*rho_in+m*preconditioner*rho_opt
A low value of density mixing parameter may lead to a more stable convergence, but will slow down the calculation if set too low. In systems with bands around the Fermi energy (i.e. metals, e.g. Fe, Mn), the mixing parameters should be small. In insulators (e.g. Al, Si) the mixing parameter should be high.
- set_occupancy_smearing(smearing: str = None, width: float = None, order: int = 1, ismear: int = None) None[source]#
Set how the finite temperature smearing is applied in determining partial occupancies
- Parameters:
smearing (str) – Type of smearing (Fermi, Gaussian, or Methfessel-Paxton)
width (float) – Smearing width (eV)
order (int) – order (int): Smearing order (only for Methfessel-Paxton)
ismear (int) – (Deprecated) Directly sets the ISMEAR tag. Overwrites the smearing tag
- set_rwigs(rwigs_dict)[source]#
Sets the radii of Wigner-Seitz cell. (RWIGS tag)
- Parameters:
rwigs_dict (dict) – Dictionary of species and corresponding radii. (structure has to be defined before)
- set_spin_constraint(lamb, rwigs_dict, direction=False, norm=False)[source]#
Sets spin constrains including ‘LAMBDA’ and ‘RWIGS’.
- Parameters:
lamb (float) – LAMBDA tag
rwigs_dict (dict) – Dictionary of species and corresponding radii. (structure has to be defined before)
direction (bool) – (True/False) constrain spin direction.
norm (bool) – (True/False) constrain spin norm (magnitude).
- show_hdf() None#
Iterating over the HDF5 datastructure and generating a human readable graph.
- signal_intercept(sig) None#
Abort the job and log signal that caused it.
Expected to be called from
pyiron_base.state.signal.catch_signals().- Parameters:
sig (int) – the signal that triggered the abort
- property sorted_indices#
How the original atom indices are ordered in the vasp format (species by species)
- property spin_constraints#
Returns True if the calculation is spin constrained
- property status: str#
- Execution status of the job, can be one of the following [initialized, appended, created, submitted, running,
aborted, collect, suspended, refresh, busy, finished]
- Returns:
status
- Return type:
(str/pyiron_base.job.jobstatus.JobStatus)
- stop_calculation(next_electronic_step=False)[source]#
Call to stop the VASP calculation
- Parameters:
next_electronic_step (bool) – True if the next electronic step should be calculated
- store_structure()#
Create
StructureContainerjob with the initial structure of the job and sets that jobsparent_idfrom this job.- Returns:
job containing initial structure of this job
- Return type:
- property structure#
Returns:
- suspend() None#
Suspend the job by storing the object and its state persistently in HDF5 file and exit it.
- to_dict()[source]#
Reduce the object to a dictionary.
- Returns:
serialized state of this object
- Return type:
dict
- to_hdf(hdf=None, group_name=None)[source]#
Stores the instance attributes into the hdf5 file
- Parameters:
hdf (pyiron_base.generic.hdfio.ProjectHDFio) – The HDF file/path to write the data to
group_name (str) – The name of the group under which the data must be stored as
- to_object(object_type: str | None = None, **qwargs) pyiron_base.job.generic.GenericJob#
Load the full pyiron object from an HDF5 file
- Parameters:
object_type – if the ‘TYPE’ node is not available in the HDF5 file a manual object type can be set - optional
**qwargs – optional parameters [‘job_name’, ‘project’] - to specify the location of the HDF5 path
- Returns:
pyiron object
- Return type:
GenericJob
- trajectory(stride=1, center_of_mass=False, atom_indices=None, snapshot_indices=None, overwrite_positions=None, overwrite_cells=None)#
Returns a Trajectory instance containing the necessary information to describe the evolution of the atomic structure during the atomistic simulation.
- Parameters:
stride (int) – The trajectories are generated with every ‘stride’ steps
center_of_mass (bool) – False (default) if the specified positions are w.r.t. the origin
atom_indices (list/ndarray) – The atom indices for which the trajectory should be generated
snapshot_indices (list/ndarray) – The snapshots for which the trajectory should be generated
overwrite_positions (list/ndarray) – List of positions that are meant to overwrite the existing trajectory. Useful to wrap coordinates for example
overwrite_cells (list/ndarray) – List of cells that are meant to overwrite the existing trajectory. Only used when overwrite_positions is defined. This must have the same length of overwrite_positions
- Returns:
Trajectory instance
- Return type:
- transfer_from_remote() None#
Transfer the job from a remote location to the local machine.
This method transfers the job from a remote location to the local machine. It performs the following steps: 1. Retrieves the job from the remote location using the queue adapter. 2. Transfers the job file to the remote location, with the option to delete the file on the remote location after transfer. 3. Updates the project database if it is disabled, otherwise updates the file table in the database with the job information.
- Parameters:
None
- Returns:
None
- transform_structures(modify) TransformStructure#
Return a modified object by applying a function to each object lazily.
- Parameters:
modify (function) – applied to each structure, has to return the modified structure
- Returns:
a container with the modified structures
- Return type:
- update_master(force_update: bool = False) None#
After a job is finished it checks whether it is linked to any metajob - meaning the master ID is pointing to this jobs job ID. If this is the case and the master job is in status suspended - the child wakes up the master job, sets the status to refresh and execute run on the master job. During the execution the master job is set to status refresh. If another child calls update_master, while the master is in refresh the status of the master is set to busy and if the master is in status busy at the end of the update_master process another update is triggered.
- Parameters:
force_update (bool) – Whether to check run mode for updating master
- property version: str#
Get the version of the hamiltonian, which is also the version of the executable unless a custom executable is used.
- Returns:
version number
- Return type:
str
- view_structure(snapshot=-1, spacefill=True, show_cell=True)#
- Parameters:
snapshot (int) – Snapshot of the trajectory one wants
spacefill (bool)
show_cell (bool)
- Returns:
nglview IPython widget
- Return type:
view
- property working_directory: str#
Get the working directory of the job is executed in - outside the HDF5 file. The working directory equals the path but it is represented by the filesystem:
/absolute/path/to/the/file.h5/path/inside/the/hdf5/file
- becomes:
/absolute/path/to/the/file_hdf5/path/inside/the/hdf5/file
- Returns:
absolute path to the working directory
- Return type:
str
- property write_charge_density#
True if the charge density file CHGCAR file is/should be written
- property write_electrostatic_potential#
True if the local potential or electrostatic potential LOCPOT file is/should be written
- write_input() None#
Call routines that generate the code specific input files Returns:
- property write_resolved_dos#
True if the resolved DOS should be written (in the vasprun.xml file)
- write_traj(filename, file_format=None, parallel=True, append=False, stride=1, center_of_mass=False, atom_indices=None, snapshot_indices=None, overwrite_positions=None, overwrite_cells=None, **kwargs)#
Writes the trajectory in a given file file_format based on the ase.io.write function.
- Parameters:
filename (str) – Filename of the output
file_format (str) – The specific file_format of the output
parallel (bool) – ase parameter
append (bool) – ase parameter
stride (int) – Writes trajectory every stride steps
center_of_mass (bool) – True if the positions are centered on the COM
atom_indices (list/numpy.ndarray) – The atom indices for which the trajectory should be generated
snapshot_indices (list/numpy.ndarray) – The snapshots for which the trajectory should be generated
overwrite_positions (list/numpy.ndarray) – List of positions that are meant to overwrite the existing trajectory. Useful to wrap coordinates for example
overwrite_cells (list/numpy.ndarray) – List of cells that are meant to overwrite the existing trajectory. Only used when overwrite_positions is defined. This must have the same length of overwrite_positions
**kwargs – Additional ase arguments
- property write_wave_funct#
True if the wave function file WAVECAR file is/should be written