jarvis.core.lattice
¶
Modules for handing crystallographic lattice-parameters.
Module Contents¶
Classes¶
Construct Lattice parameter object. |
Functions¶
|
Return the value with its absolute value capped at max_abs_val. |
|
Transform coords to a new lattice. |
|
Get 2D lattice type. |
- jarvis.core.lattice.abs_cap(val, max_abs_val=1)[source]¶
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.
- class jarvis.core.lattice.Lattice(lattice_mat=None, round_off=5)[source]¶
Bases:
object
Construct Lattice parameter object.
- property volume¶
Return volume given a lattice object.
- property a¶
Return a lattice vector length.
- property b¶
Return b lattice vector length.
- property c¶
Return c lattice vector length.
- property alpha¶
Return alpha lattice vector angle.
- property beta¶
Return beta lattice vector angle.
- property gamma¶
Return gamma lattice vector angle.
- property abc¶
Return lattice vector lengths.
- property angles¶
Return lattice vector angles.
- property parameters¶
Return lattice vector angles in radians or degree.
- property matrix¶
Return lattice matrix.
- property inv_matrix¶
Return inverse lattice matrix.
- static from_parameters(a, b, c, alpha, beta, gamma)[source]¶
Construct Lattice from lattice parameter information.
- static monoclinic(a, b, c, beta)[source]¶
Construct monoclinic Lattice from lattice parameter information.
- get_points_in_sphere(frac_points, center, r)[source]¶
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.
- find_all_matches(other_lattice, ltol=1e-05, atol=1)[source]¶
Find all lattice mappings, adapted from pymatgen.
- find_matches(other_lattice, ltol=1e-05, atol=1)[source]¶
Find matches with length and angle tolerances.
- _calculate_lll(delta=0.75)[source]¶
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.