jarvis.core.lattice =================== .. py:module:: jarvis.core.lattice .. autoapi-nested-parse:: Modules for handing crystallographic lattice-parameters. Classes ------- .. autoapisummary:: jarvis.core.lattice.Lattice Functions --------- .. autoapisummary:: jarvis.core.lattice.abs_cap jarvis.core.lattice.lattice_coords_transformer jarvis.core.lattice.get_2d_lattice Module Contents --------------- .. py:function:: abs_cap(val, max_abs_val=1) Return the value with its absolute value capped at max_abs_val. Particularly useful in passing values to trignometric functions where numerical errors may result in an argument > 1 being passed in. Args: val (float): Input value. max_abs_val (float): The maximum absolute value for val. Defaults to 1. Returns: val if abs(val) < 1 else sign of val * max_abs_val. .. py:class:: Lattice(lattice_mat=None, round_off=5) Bases: :py:obj:`object` Construct Lattice parameter object. .. py:attribute:: _lat .. py:attribute:: _inv_lat :value: None .. py:attribute:: _lll_matrix_mappings .. py:method:: lat_lengths() Return lattice vectors' lengths. .. py:property:: volume Return volume given a lattice object. .. py:property:: a Return a lattice vector length. .. py:property:: b Return b lattice vector length. .. py:property:: c Return c lattice vector length. .. py:property:: alpha Return alpha lattice vector angle. .. py:property:: beta Return beta lattice vector angle. .. py:property:: gamma Return gamma lattice vector angle. .. py:property:: abc Return lattice vector lengths. .. py:property:: angles Return lattice vector angles. .. py:method:: lat_angles(tol=0.01, radians=False) Return lattice vector angles in radians or degree. .. py:property:: parameters Return lattice vector angles in radians or degree. .. py:method:: from_parameters(a, b, c, alpha, beta, gamma) :staticmethod: Construct Lattice from lattice parameter information. .. py:method:: cubic(a) :staticmethod: Construct cubic Lattice from lattice parameter information. .. py:method:: tetragonal(a, c) :staticmethod: Construct tetragonal Lattice from lattice parameter information. .. py:method:: orthorhombic(a, b, c) :staticmethod: Construct orthorhombic Lattice. .. py:method:: monoclinic(a, b, c, beta) :staticmethod: Construct monoclinic Lattice from lattice parameter information. .. py:method:: hexagonal(a, c) :staticmethod: Construct hexagonal Lattice from lattice parameter information. .. py:method:: rhombohedral(a, alpha) :staticmethod: Construct rhombohedral Lattice. .. py:method:: to_dict() Return lattice parameter information as a dictionary. .. py:method:: from_dict(d) :classmethod: Construct Lattice from lattice matrix dictionary. .. py:property:: matrix Return lattice matrix. .. py:property:: inv_matrix Return inverse lattice matrix. .. py:method:: lattice() Return lattice matrix. .. py:method:: inv_lattice() Return inverse lattice matrix. .. py:method:: cart_coords(frac_coords) Return cartesian coords from fractional coords using Lattice. .. py:method:: frac_coords(cart_coords) Return fractional coords from cartesian coords using Lattice. .. py:method:: reciprocal_lattice() Return reciprocal Lattice. .. py:method:: reciprocal_lattice_crystallographic() Return reciprocal Lattice without 2 * pi. .. py:method:: get_points_in_sphere(frac_points, center, r, distance_vector=False) Find all points within a sphere from the point. Takes into account periodic boundary conditions. This includes sites in other periodic images. Adapted from pymatgen. .. py:method:: find_all_matches(other_lattice, ltol=1e-05, atol=1) Find all lattice mappings, adapted from pymatgen. .. py:method:: find_matches(other_lattice, ltol=1e-05, atol=1) Find matches with length and angle tolerances. .. py:method:: _calculate_lll(delta=0.75) Perform a Lenstra-Lenstra-Lovasz lattice basis reduction. Obtain a c-reduced basis. This method returns a basis which is as "good" as possible, with "good" defined by orthongonality of the lattice vectors. This basis is used for all the periodic boundary condition calcs. Adapted from pymatgen. Args: delta (float): Reduction parameter. Default of 0.75 is usually fine. Returns: Reduced lattice matrix, mapping to get to that lattice. .. py:method:: get_lll_reduced_lattice(delta=0.75) Get LLL reduced lattice. Adpted from pymatgen. Args: delta: Delta parameter. Returns: LLL reduced Lattice. .. py:function:: lattice_coords_transformer(old_lattice_mat=[], new_lattice_mat=[], cart_coords=[]) Transform coords to a new lattice. .. py:function:: get_2d_lattice(atoms={}, round_digits=2) Get 2D lattice type.