jarvis.core.atoms
¶
This module provides classes to specify atomic structure.
Module Contents¶
Classes¶
Generate Atoms python object. |
|
Adds vaccum padding to make 2D structure or making molecules. |
|
Module to work with optimade. |
Functions¶
|
Use for making Atoms with vacuum. |
|
Add top and bottom Atoms with a distance array. |
|
Get supercell dimensions. |
|
Convert pymatgen structure to Atoms. |
|
Convert ase structure to Atoms. |
|
Crop a sqaur portion from a surface/2D system. |
|
Compare atomic strutures. |
|
Generate POSCAR file for XANES, note the element ordering. |
Attributes¶
- jarvis.core.atoms.amu_gm = 1.66054e-24¶
- jarvis.core.atoms.ang_cm = 1e-08¶
- class jarvis.core.atoms.Atoms(lattice_mat=None, coords=None, elements=None, props=None, cartesian=False, show_props=False)[source]¶
Bases:
object
Generate Atoms python object.
>>> box = [[2.715, 2.715, 0], [0, 2.715, 2.715], [2.715, 0, 2.715]] >>> coords = [[0, 0, 0], [0.25, 0.2, 0.25]] >>> elements = ["Si", "Si"] >>> Si = Atoms(lattice_mat=box, coords=coords, elements=elements) >>> print(round(Si.volume,2)) 40.03 >>> Si.composition {'Si': 2} >>> round(Si.density,2) 2.33 >>> round(Si.packing_fraction,2) 0.28 >>> Si.atomic_numbers [14, 14] >>> Si.num_atoms 2 >>> Si.frac_coords[0][0] 0 >>> Si.cart_coords[0][0] 0.0 >>> coords = [[0, 0, 0], [1.3575 , 1.22175, 1.22175]] >>> round(Si.density,2) 2.33 >>> Si.spacegroup() 'C2/m (12)' >>> Si.pymatgen_converter()!={} True
- property get_xyz_string¶
Get xyz string for atoms.
- property check_polar¶
Check if the surface structure is polar.
Comparing atom types at top and bottom. Applicable for sufcae with vaccums only.
Args:
file:atoms object (surface with vacuum)
- Returns:
polar:True/False
- property get_conventional_atoms¶
Get conventional Atoms using spacegroup information.
- property get_spacegroup¶
Get spacegroup information.
- property get_primitive_atoms¶
Get primitive Atoms using spacegroup information.
- property raw_distance_matrix¶
Provide distance matrix.
- property raw_angle_matrix¶
Provide distance matrix.
- property volume¶
Get volume of the atoms object.
- property composition¶
Get composition of the atoms object.
- property density¶
Get density in g/cm3 of the atoms object.
- property atomic_numbers¶
Get list of atomic numbers of atoms in the atoms object.
- property num_atoms¶
Get number of atoms.
- property uniq_species¶
Get unique elements.
- property packing_fraction¶
Get packing fraction of the atoms object.
- write_cif(filename='atoms.cif', comment=None, with_spg_info=True)[source]¶
Write CIF format file from Atoms object.
Caution: can’t handle fractional occupancies right now
- static read_with_cif2cell(filename='1000000.cif', get_primitive_atoms=False)[source]¶
Use cif2cell package to read cif files.
- static from_pdb_old(filename='abc.pdb')[source]¶
Read PDB file, kept of checking, use from_pdb instead.
- static from_pdb(filename='abc.pdb', max_lat=200)[source]¶
Read pdb/sdf/mol2 etc. file and make Atoms object, using pytraj.
- static from_cif(filename='atoms.cif', from_string='', get_primitive_atoms=True, use_cif2cell=True)[source]¶
Read .cif format file.
- classmethod from_xyz(filename='dsgdb9nsd_057387.xyz', box_size=40)[source]¶
Read XYZ file from to make Atoms object.
- classmethod from_poscar(filename='POSCAR')[source]¶
Read POSCAR/CONTCAR file from to make Atoms object.
- add_site(element='Si', coords=[0.1, 0.1, 0.1], props=[], index=0)[source]¶
Ad an atom, coords in fractional coordinates.
- get_all_neighbors(r=5, bond_tol=0.15)[source]¶
Get neighbors for each atom in the unit cell, out to a distance r.
Contains [index_i, index_j, distance, image] array. Adapted from pymatgen.
- atomwise_angle_and_radial_distribution(r=5, bond_tol=0.15, c_size=10, verbose=False)[source]¶
Get atomwise distributions.
- center(axis=2, vacuum=18.0, about=None)[source]¶
Center structure with vacuum padding.
- Args:
vacuum:vacuum size
axis: direction
- lattice_points_in_supercell(supercell_matrix)[source]¶
Adapted from Pymatgen.
Returns the list of points on the original lattice contained in the supercell in fractional coordinates (with the supercell basis). e.g. [[2,0,0],[0,1,0],[0,0,1]] returns [[0,0,0],[0.5,0,0]]
Args:
supercell_matrix: 3x3 matrix describing the supercell
- Returns:
numpy array of the fractional coordinates
- make_supercell_matrix(scaling_matrix)[source]¶
Adapted from Pymatgen.
Makes a supercell. Allowing to have sites outside the unit cell.
- Args:
scaling_matrix: A scaling matrix for transforming the lattice vectors. Has to be all integers. Several options are possible: a. A full 3x3 scaling matrix defining the linear combination
the old lattice vectors. E.g., [[2,1,0],[0,3,0],[0,0, 1]] generates a new structure with lattice vectors a’ = 2a + b, b’ = 3b, c’ = c where a, b, and c are the lattice vectors of the original structure.
An sequence of three scaling factors. E.g., [2, 1, 1]
specifies that the supercell should have dimensions 2a x b x c.
A number, which simply scales all lattice vectors by the
same factor.
- Returns:
Supercell structure. Note that a Structure is always returned, even if the input structure is a subclass of Structure. This is to avoid different arguments signatures from causing problems. If you prefer a subclass to return its own type, you need to override this method in the subclass.
- class jarvis.core.atoms.VacuumPadding(atoms, vacuum=20.0)[source]¶
Bases:
object
Adds vaccum padding to make 2D structure or making molecules.
- jarvis.core.atoms.add_atoms(top, bottom, distance=[0, 0, 1], apply_strain=False)[source]¶
Add top and bottom Atoms with a distance array.
Bottom Atoms lattice-matrix is chosen as final lattice.
- jarvis.core.atoms.get_supercell_dims(atoms, enforce_c_size=10, extend=1)[source]¶
Get supercell dimensions.
- jarvis.core.atoms.ase_to_atoms(ase_atoms='', cartesian=True)[source]¶
Convert ase structure to Atoms.
- jarvis.core.atoms.crop_square(atoms=None, csize=10)[source]¶
Crop a sqaur portion from a surface/2D system.
- class jarvis.core.atoms.OptimadeAdaptor(atoms=None)[source]¶
Bases:
object
Module to work with optimade.