velocity

py4vasp.calculation.velocity
class py4vasp.calculation._velocity.Velocity(*args, **kwargs)

The velocities describe the ionic motion during an MD simulation.

The velocities of the ions are a metric for the temperature of the system. Most of the time, it is not necessary to consider them explicitly. VASP will set the velocities automatically according to the temperature settings (TEBEG and TEEND) unless you set them explicitly in the POSCAR file. Since the velocities are not something you typically need, VASP will only store them during the simulation if you set VELOCITY = T in the INCAR file. In that case you can read the velocities of each step along the trajectory. If you are only interested in the final velocities, please consider the :data:’~py4vasp.data.CONTCAR` class.

Examples

If you access a method of this class, the result will depend on the steps that you selected with the [] operator. Without any selection the results from the final step will be used.

>>> calc.velocity.read()

To select the results for all steps, you don’t specify the array boundaries.

>>> calc.velocity[:].read()

You can also select specific steps or a subset of steps as follows

>>> calc.velocity[5].read()
>>> calc.velocity[1:6].read()
plot(*args, **kwargs)

Wrapper around to_view() method.

This method will visualize the quantity in the structure. Please refer to the to_view() method for a documentation of the allowed arguments.

Returns:

A visualization of the quantity within the crystal structure.

Return type:

View

print()

Print a string representation of this instance.

read(*args, **kwargs)

Convenient wrapper around to_dict. Check that function for examples and optional arguments.

selections()

Returns possible alternatives for this particular quantity VASP can produce.

The returned dictionary contains a single item with the name of the quantity mapping to all possible selections. Each of these selection may be passed to other functions of this quantity to select which output of VASP is used.

Returns:

The key indicates this quantity and the values possible choices for arguments to other functions of this quantity.

Return type:

dict

to_dict()

Return the structure and ion velocities in a dictionary

Returns:

The dictionary contains the ion velocities as well as the structural information for reference.

Return type:

dict

Examples

If you access this method, the result will depend on the steps of the class that you selected with the [] operator. Without any selection the results from the final step will be used.

>>> calc.velocity.to_dict()

To select the results for all steps, you don’t specify the array boundaries.

>>> calc.velocity[:].to_dict()

You can also select specific steps or a subset of steps as follows

>>> calc.velocity[5].to_dict()
>>> calc.velocity[1:6].to_dict()
to_ngl(*args, **kwargs)

Convert the view to an NGL widget.

This method wraps the to_view() method and converts the resulting View to an NGL widget. The to_view() method documents all the possible arguments of this function.

Returns:

A widget to display the structure and other quantities in the unit cell.

Return type:

NGLWidget

to_view(supercell=None)

Plot the velocities as vectors in the structure.

Parameters:

supercell (int or np.ndarray) – If present the structure is replicated the specified number of times along each direction.

Returns:

Contains all atoms and the velocities are drawn as vectors.

Return type:

View

Examples

If you access this method, the result will depend on the steps of the class that you selected with the [] operator. Without any selection the results from the final step will be used.

>>> calc.velocity.to_view()

To select the results for all steps, you don’t specify the array boundaries.

>>> calc.velocity[:].to_view()

You can also select specific steps or a subset of steps as follows

>>> calc.velocity[5].to_view()
>>> calc.velocity[1:6].to_view()