jarvis.analysis.structure package

Submodules

jarvis.analysis.structure.neighbors module

This module provides classes to specify atomic structure.

class jarvis.analysis.structure.neighbors.NeighborsAnalysis(atoms=None, max_n=500, rcut1=None, max_cut=10.0, rcut2=None, verbose=False)[source]

Bases: object

Get neighbor informations (RDF,ADF,DDF) for Atoms object.

ang_dist(nbor_info={}, plot=False)[source]

Get angular distribution function upto first neighbor.

Args:

struct_info: struct information

max_n: maximum number of neigbors

c_size: max. cell size

plot: whether to plot distributions

Retruns:

ang_hist1: Angular distribution upto first cut-off

ang_bins1: angle bins

ang_dist_first(plot=False)[source]

Get angular distribution upto first neighbor.

ang_dist_second(plot=False)[source]

Get angular distribution upto second neighbor.

atomwise_angle_dist(rcut=None, nbins=180, c_size=0)[source]

Get angle distribution for each atom.

atomwise_radial_dist(rcut=10.0, c_size=0)[source]

Get pair/radial distribution for each atom.

get_all_distributions

Get all distributions.

get_ddf(plot=False)[source]

Get dihedral distribution upto first neighbor.

get_dist_cutoffs()[source]

Get different distance cut-offs.

Args:

s: Structure object
Returns:

rcut: max-cutoff to ensure all the element-combinations are included, used in calculating angluar distribution upto first neighbor

rcut1: decide first cut-off based on total RDF and a buffer (previously used in dihedrals, but not used now in the code)

rcut2: second neighbor cut-off

rcut_dihed: specialized cut-off for dihedrals to avaoid large bonds such as N-N, uses average bond-distance and standard deviations

get_rdf(plot=False)[source]

Calculate radial distribution function.

get_structure_data(c_size=10.0)[source]

Provide non-repetitive structure information.

nbor_list(rcut=10.0, c_size=12.0)[source]

Generate neighbor info.

jarvis.analysis.structure.neighbors.calc_structure_data(coords, box, all_symbs, c_size)[source]

Calcuate a dictionary of structure data.

Args:

coords: the coordinates for each element

box: the lattic matrix

all_symbs: the elements

c_size: the c size

Returns:
a set of structure data
>>> coords = np.array([[0, 0, 0], [0.25, 0.2, 0.25]])
>>> lat = [[2.715, 2.715, 0], [0, 2.715, 2.715], [2.715, 0, 2.715]]
>>> box = np.array(lat)
>>> elements = ["Si", "Si"]
>>> c_size = 10.0
>>> data = calc_structure_data(coords, box, elements, c_size)
>>> assert len(data['coords']) == 128
>>> assert np.allclose(data['coords'][9], [0.    , 0.5   , 0.25  ])
>>> assert np.all(data['dim'] == [4, 4, 4])
>>> assert len(data['new_symbs']) == 128
jarvis.analysis.structure.neighbors.check_array(arr, type_=None, shape=None)[source]

Check type and shape of np.ndarray.

Follwing arguments are needed. Args:

x: array to check

type_: the type of the array (int, float), None to not check

shape: the shape of the array, None to not check, -1 to ignore a
dimension
jarvis.analysis.structure.neighbors.special_arange(dims)[source]

Multiple dimensional arange.

This could be extended to any dimension. Args:

dims: sequence of ints of length 3
Returns:
an array of shape (np.prod(dims), 3) with each index having a different arrangement of arange.

This function implements the equivalent of a multidimensional for loop, which feels like multidimensional arange (see the test)

>>> dim0, dim1, dim2 = 2, 4, 3
>>> arr_test = np.zeros((dim0 * dim1 * dim2, 3), dtype=int)
>>> counter = 0
>>> for i in np.arange(dim0):
...     for j in np.arange(dim1):
...         for k in np.arange(dim2):
...             arr_test[counter, 0] = i
...             arr_test[counter, 1] = j
...             arr_test[counter, 2] = k
...             counter += 1
>>> arr_actual = special_arange((dim0, dim1, dim2))
>>> print(arr_actual)
[[0 0 0]
 [0 0 1]
 [0 0 2]
 [0 1 0]
 [0 1 1]
 [0 1 2]
 [0 2 0]
 [0 2 1]
 [0 2 2]
 [0 3 0]
 [0 3 1]
 [0 3 2]
 [1 0 0]
 [1 0 1]
 [1 0 2]
 [1 1 0]
 [1 1 1]
 [1 1 2]
 [1 2 0]
 [1 2 1]
 [1 2 2]
 [1 3 0]
 [1 3 1]
 [1 3 2]]
>>> assert np.all(arr_actual == arr_test)

jarvis.analysis.structure.spacegroup module

Modules for handling crystallographic Spacegroup related operations.

class jarvis.analysis.structure.spacegroup.Spacegroup3D(atoms=[], dataset={}, symprec=0.01, angle_tolerance=5)[source]

Bases: object

Provide spacegroup related data for Atoms object.

Currently uses spglib to derive spacegroup related information for 3D materials mainly

conventional_standard_structure

Give a conventional cell according to certain conventions.

The conventionss are defined in Setyawan, W., & Curtarolo, S. (2010). High-throughput electronic band structure calculations: Challenges and tools. Computational Materials Science, 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010 They basically enforce as much as possible norm(a1)<norm(a2)<norm(a3) Returns:

The structure in a conventional standardized cell
crystal_system

Get crystal system.

lattice_system

Get lattice system.

point_group_symbol

Get pointgroup.

primitive_atoms

Get primitive atoms.

refined_atoms

Refine atoms based on spacegroup data.

space_group_number

Get spacegroup number.

space_group_symbol

Get spacegroup symbol.

spacegroup_data()[source]

Provide spacegroup data from spglib.

jarvis.analysis.structure.spacegroup.check_duplicate_coords(coords=[], coord=[])[source]

Check if a coordinate exists.

jarvis.analysis.structure.spacegroup.get_new_coord_for_xyz_sym(frac_coord=[], xyz_string='')[source]

Obtain new coord from xyz string.

jarvis.analysis.structure.spacegroup.get_wyckoff_position_operators(hall_number)[source]

Get all Wyckoff operations for Hall number.

jarvis.analysis.structure.spacegroup.operate_affine(cart_coord=[], affine_matrix=[])[source]

Operate affine method.

jarvis.analysis.structure.spacegroup.parse_wyckoff_csv(wyckoff_file)[source]

Parse Wyckoff.csv from spglib.

There are 530 data sets. For one example: 9:C 1 2 1::::::: ::4:c:1:(x,y,z):(-x,y,-z):: ::2:b:2:(0,y,1/2)::: ::2:a:2:(0,y,0)::

jarvis.analysis.structure.spacegroup.parse_xyz_string(xyz_string)[source]

Convert xyz info to translation and rotation vectors.

Adapted from pymatgen. Args:

xyz_string: string of the form ‘x, y, z’, ‘-x, -y, z’,
‘-2y+1/2, 3x+1/2, z-y+1/2’, etc.
Returns:
translation and rotation vectors.
jarvis.analysis.structure.spacegroup.read_wyckoff_csv(filename)[source]

Read wyckoff_csv file.

jarvis.analysis.structure.spacegroup.symmetrically_distinct_miller_indices(max_index=3, cvn_atoms=None)[source]

Get unique miller indices for max_index.

jarvis.analysis.structure.spacegroup.unique_rows_2(a)[source]

Remove duplicate rows.

Module contents

Modules for crystal structure analysis.