partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | VoronoiAnalyzer.analyze_structures | Perform Voronoi analysis on a list of Structures.
Note that this might take a significant amount of time depending on the
size and number of structures.
Args:
structures (list): list of Structures
cutoff (float: cutoff distance around an atom to search for
... | pymatgen/analysis/structure_analyzer.py | def analyze_structures(self, structures, step_freq=10,
most_frequent_polyhedra=15):
"""
Perform Voronoi analysis on a list of Structures.
Note that this might take a significant amount of time depending on the
size and number of structures.
Args:
... | def analyze_structures(self, structures, step_freq=10,
most_frequent_polyhedra=15):
"""
Perform Voronoi analysis on a list of Structures.
Note that this might take a significant amount of time depending on the
size and number of structures.
Args:
... | [
"Perform",
"Voronoi",
"analysis",
"on",
"a",
"list",
"of",
"Structures",
".",
"Note",
"that",
"this",
"might",
"take",
"a",
"significant",
"amount",
"of",
"time",
"depending",
"on",
"the",
"size",
"and",
"number",
"of",
"structures",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L126-L162 | [
"def",
"analyze_structures",
"(",
"self",
",",
"structures",
",",
"step_freq",
"=",
"10",
",",
"most_frequent_polyhedra",
"=",
"15",
")",
":",
"voro_dict",
"=",
"{",
"}",
"step",
"=",
"0",
"for",
"structure",
"in",
"structures",
":",
"step",
"+=",
"1",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | RelaxationAnalyzer.get_percentage_volume_change | Returns the percentage volume change.
Returns:
Volume change in percentage, e.g., 0.055 implies a 5.5% increase. | pymatgen/analysis/structure_analyzer.py | def get_percentage_volume_change(self):
"""
Returns the percentage volume change.
Returns:
Volume change in percentage, e.g., 0.055 implies a 5.5% increase.
"""
initial_vol = self.initial.lattice.volume
final_vol = self.final.lattice.volume
return fin... | def get_percentage_volume_change(self):
"""
Returns the percentage volume change.
Returns:
Volume change in percentage, e.g., 0.055 implies a 5.5% increase.
"""
initial_vol = self.initial.lattice.volume
final_vol = self.final.lattice.volume
return fin... | [
"Returns",
"the",
"percentage",
"volume",
"change",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L205-L214 | [
"def",
"get_percentage_volume_change",
"(",
"self",
")",
":",
"initial_vol",
"=",
"self",
".",
"initial",
".",
"lattice",
".",
"volume",
"final_vol",
"=",
"self",
".",
"final",
".",
"lattice",
".",
"volume",
"return",
"final_vol",
"/",
"initial_vol",
"-",
"1... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | RelaxationAnalyzer.get_percentage_lattice_parameter_changes | Returns the percentage lattice parameter changes.
Returns:
A dict of the percentage change in lattice parameter, e.g.,
{'a': 0.012, 'b': 0.021, 'c': -0.031} implies a change of 1.2%,
2.1% and -3.1% in the a, b and c lattice parameters respectively. | pymatgen/analysis/structure_analyzer.py | def get_percentage_lattice_parameter_changes(self):
"""
Returns the percentage lattice parameter changes.
Returns:
A dict of the percentage change in lattice parameter, e.g.,
{'a': 0.012, 'b': 0.021, 'c': -0.031} implies a change of 1.2%,
2.1% and -3.1% in th... | def get_percentage_lattice_parameter_changes(self):
"""
Returns the percentage lattice parameter changes.
Returns:
A dict of the percentage change in lattice parameter, e.g.,
{'a': 0.012, 'b': 0.021, 'c': -0.031} implies a change of 1.2%,
2.1% and -3.1% in th... | [
"Returns",
"the",
"percentage",
"lattice",
"parameter",
"changes",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L216-L229 | [
"def",
"get_percentage_lattice_parameter_changes",
"(",
"self",
")",
":",
"initial_latt",
"=",
"self",
".",
"initial",
".",
"lattice",
"final_latt",
"=",
"self",
".",
"final",
".",
"lattice",
"d",
"=",
"{",
"l",
":",
"getattr",
"(",
"final_latt",
",",
"l",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | RelaxationAnalyzer.get_percentage_bond_dist_changes | Returns the percentage bond distance changes for each site up to a
maximum radius for nearest neighbors.
Args:
max_radius (float): Maximum radius to search for nearest
neighbors. This radius is applied to the initial structure,
not the final structure.
... | pymatgen/analysis/structure_analyzer.py | def get_percentage_bond_dist_changes(self, max_radius=3.0):
"""
Returns the percentage bond distance changes for each site up to a
maximum radius for nearest neighbors.
Args:
max_radius (float): Maximum radius to search for nearest
neighbors. This radius is ap... | def get_percentage_bond_dist_changes(self, max_radius=3.0):
"""
Returns the percentage bond distance changes for each site up to a
maximum radius for nearest neighbors.
Args:
max_radius (float): Maximum radius to search for nearest
neighbors. This radius is ap... | [
"Returns",
"the",
"percentage",
"bond",
"distance",
"changes",
"for",
"each",
"site",
"up",
"to",
"a",
"maximum",
"radius",
"for",
"nearest",
"neighbors",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L231-L255 | [
"def",
"get_percentage_bond_dist_changes",
"(",
"self",
",",
"max_radius",
"=",
"3.0",
")",
":",
"data",
"=",
"collections",
".",
"defaultdict",
"(",
"dict",
")",
"for",
"inds",
"in",
"itertools",
".",
"combinations",
"(",
"list",
"(",
"range",
"(",
"len",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | VoronoiConnectivity.connectivity_array | Provides connectivity array.
Returns:
connectivity: An array of shape [atomi, atomj, imagej]. atomi is
the index of the atom in the input structure. Since the second
atom can be outside of the unit cell, it must be described
by both an atom index and an image ind... | pymatgen/analysis/structure_analyzer.py | def connectivity_array(self):
"""
Provides connectivity array.
Returns:
connectivity: An array of shape [atomi, atomj, imagej]. atomi is
the index of the atom in the input structure. Since the second
atom can be outside of the unit cell, it must be described
... | def connectivity_array(self):
"""
Provides connectivity array.
Returns:
connectivity: An array of shape [atomi, atomj, imagej]. atomi is
the index of the atom in the input structure. Since the second
atom can be outside of the unit cell, it must be described
... | [
"Provides",
"connectivity",
"array",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L281-L325 | [
"def",
"connectivity_array",
"(",
"self",
")",
":",
"# shape = [site, axis]",
"cart_coords",
"=",
"np",
".",
"array",
"(",
"self",
".",
"s",
".",
"cart_coords",
")",
"# shape = [site, image, axis]",
"all_sites",
"=",
"cart_coords",
"[",
":",
",",
"None",
",",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | VoronoiConnectivity.get_connections | Returns a list of site pairs that are Voronoi Neighbors, along
with their real-space distances. | pymatgen/analysis/structure_analyzer.py | def get_connections(self):
"""
Returns a list of site pairs that are Voronoi Neighbors, along
with their real-space distances.
"""
con = []
maxconn = self.max_connectivity
for ii in range(0, maxconn.shape[0]):
for jj in range(0, maxconn.shape[1]):
... | def get_connections(self):
"""
Returns a list of site pairs that are Voronoi Neighbors, along
with their real-space distances.
"""
con = []
maxconn = self.max_connectivity
for ii in range(0, maxconn.shape[0]):
for jj in range(0, maxconn.shape[1]):
... | [
"Returns",
"a",
"list",
"of",
"site",
"pairs",
"that",
"are",
"Voronoi",
"Neighbors",
"along",
"with",
"their",
"real",
"-",
"space",
"distances",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L336-L348 | [
"def",
"get_connections",
"(",
"self",
")",
":",
"con",
"=",
"[",
"]",
"maxconn",
"=",
"self",
".",
"max_connectivity",
"for",
"ii",
"in",
"range",
"(",
"0",
",",
"maxconn",
".",
"shape",
"[",
"0",
"]",
")",
":",
"for",
"jj",
"in",
"range",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | VoronoiConnectivity.get_sitej | Assuming there is some value in the connectivity array at indices
(1, 3, 12). sitei can be obtained directly from the input structure
(structure[1]). sitej can be obtained by passing 3, 12 to this function
Args:
site_index (int): index of the site (3 in the example)
imag... | pymatgen/analysis/structure_analyzer.py | def get_sitej(self, site_index, image_index):
"""
Assuming there is some value in the connectivity array at indices
(1, 3, 12). sitei can be obtained directly from the input structure
(structure[1]). sitej can be obtained by passing 3, 12 to this function
Args:
site_... | def get_sitej(self, site_index, image_index):
"""
Assuming there is some value in the connectivity array at indices
(1, 3, 12). sitei can be obtained directly from the input structure
(structure[1]). sitej can be obtained by passing 3, 12 to this function
Args:
site_... | [
"Assuming",
"there",
"is",
"some",
"value",
"in",
"the",
"connectivity",
"array",
"at",
"indices",
"(",
"1",
"3",
"12",
")",
".",
"sitei",
"can",
"be",
"obtained",
"directly",
"from",
"the",
"input",
"structure",
"(",
"structure",
"[",
"1",
"]",
")",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L350-L363 | [
"def",
"get_sitej",
"(",
"self",
",",
"site_index",
",",
"image_index",
")",
":",
"atoms_n_occu",
"=",
"self",
".",
"s",
"[",
"site_index",
"]",
".",
"species",
"lattice",
"=",
"self",
".",
"s",
".",
"lattice",
"coords",
"=",
"self",
".",
"s",
"[",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | OxideType.parse_oxide | Determines if an oxide is a peroxide/superoxide/ozonide/normal oxide.
Returns:
oxide_type (str): Type of oxide
ozonide/peroxide/superoxide/hydroxide/None.
nbonds (int): Number of peroxide/superoxide/hydroxide bonds in
structure. | pymatgen/analysis/structure_analyzer.py | def parse_oxide(self):
"""
Determines if an oxide is a peroxide/superoxide/ozonide/normal oxide.
Returns:
oxide_type (str): Type of oxide
ozonide/peroxide/superoxide/hydroxide/None.
nbonds (int): Number of peroxide/superoxide/hydroxide bonds in
st... | def parse_oxide(self):
"""
Determines if an oxide is a peroxide/superoxide/ozonide/normal oxide.
Returns:
oxide_type (str): Type of oxide
ozonide/peroxide/superoxide/hydroxide/None.
nbonds (int): Number of peroxide/superoxide/hydroxide bonds in
st... | [
"Determines",
"if",
"an",
"oxide",
"is",
"a",
"peroxide",
"/",
"superoxide",
"/",
"ozonide",
"/",
"normal",
"oxide",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_analyzer.py#L516-L586 | [
"def",
"parse_oxide",
"(",
"self",
")",
":",
"structure",
"=",
"self",
".",
"structure",
"relative_cutoff",
"=",
"self",
".",
"relative_cutoff",
"o_sites_frac_coords",
"=",
"[",
"]",
"h_sites_frac_coords",
"=",
"[",
"]",
"lattice",
"=",
"structure",
".",
"latt... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | FunctionalGroupExtractor.get_heteroatoms | Identify non-H, non-C atoms in the MoleculeGraph, returning a list of
their node indices.
:param elements: List of elements to identify (if only certain
functional groups are of interest).
:return: set of ints representing node indices | pymatgen/analysis/functional_groups.py | def get_heteroatoms(self, elements=None):
"""
Identify non-H, non-C atoms in the MoleculeGraph, returning a list of
their node indices.
:param elements: List of elements to identify (if only certain
functional groups are of interest).
:return: set of ints representin... | def get_heteroatoms(self, elements=None):
"""
Identify non-H, non-C atoms in the MoleculeGraph, returning a list of
their node indices.
:param elements: List of elements to identify (if only certain
functional groups are of interest).
:return: set of ints representin... | [
"Identify",
"non",
"-",
"H",
"non",
"-",
"C",
"atoms",
"in",
"the",
"MoleculeGraph",
"returning",
"a",
"list",
"of",
"their",
"node",
"indices",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/functional_groups.py#L105-L125 | [
"def",
"get_heteroatoms",
"(",
"self",
",",
"elements",
"=",
"None",
")",
":",
"heteroatoms",
"=",
"set",
"(",
")",
"for",
"node",
"in",
"self",
".",
"molgraph",
".",
"graph",
".",
"nodes",
"(",
")",
":",
"if",
"elements",
"is",
"not",
"None",
":",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | FunctionalGroupExtractor.get_special_carbon | Identify Carbon atoms in the MoleculeGraph that fit the characteristics
defined Ertl (2017), returning a list of their node indices.
The conditions for marking carbon atoms are (quoted from Ertl):
"- atoms connected by non-aromatic double or triple bond to any
heteroatom
... | pymatgen/analysis/functional_groups.py | def get_special_carbon(self, elements=None):
"""
Identify Carbon atoms in the MoleculeGraph that fit the characteristics
defined Ertl (2017), returning a list of their node indices.
The conditions for marking carbon atoms are (quoted from Ertl):
"- atoms connected by non-aro... | def get_special_carbon(self, elements=None):
"""
Identify Carbon atoms in the MoleculeGraph that fit the characteristics
defined Ertl (2017), returning a list of their node indices.
The conditions for marking carbon atoms are (quoted from Ertl):
"- atoms connected by non-aro... | [
"Identify",
"Carbon",
"atoms",
"in",
"the",
"MoleculeGraph",
"that",
"fit",
"the",
"characteristics",
"defined",
"Ertl",
"(",
"2017",
")",
"returning",
"a",
"list",
"of",
"their",
"node",
"indices",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/functional_groups.py#L127-L201 | [
"def",
"get_special_carbon",
"(",
"self",
",",
"elements",
"=",
"None",
")",
":",
"specials",
"=",
"set",
"(",
")",
"# For this function, only carbons are considered",
"carbons",
"=",
"[",
"n",
"for",
"n",
"in",
"self",
".",
"molgraph",
".",
"graph",
".",
"n... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | FunctionalGroupExtractor.link_marked_atoms | Take a list of marked "interesting" atoms (heteroatoms, special carbons)
and attempt to connect them, returning a list of disjoint groups of
special atoms (and their connected hydrogens).
:param atoms: set of marked "interesting" atoms, presumably identified
using other functions in... | pymatgen/analysis/functional_groups.py | def link_marked_atoms(self, atoms):
"""
Take a list of marked "interesting" atoms (heteroatoms, special carbons)
and attempt to connect them, returning a list of disjoint groups of
special atoms (and their connected hydrogens).
:param atoms: set of marked "interesting" atoms, pr... | def link_marked_atoms(self, atoms):
"""
Take a list of marked "interesting" atoms (heteroatoms, special carbons)
and attempt to connect them, returning a list of disjoint groups of
special atoms (and their connected hydrogens).
:param atoms: set of marked "interesting" atoms, pr... | [
"Take",
"a",
"list",
"of",
"marked",
"interesting",
"atoms",
"(",
"heteroatoms",
"special",
"carbons",
")",
"and",
"attempt",
"to",
"connect",
"them",
"returning",
"a",
"list",
"of",
"disjoint",
"groups",
"of",
"special",
"atoms",
"(",
"and",
"their",
"conne... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/functional_groups.py#L203-L236 | [
"def",
"link_marked_atoms",
"(",
"self",
",",
"atoms",
")",
":",
"# We will add hydrogens to functional groups",
"hydrogens",
"=",
"{",
"n",
"for",
"n",
"in",
"self",
".",
"molgraph",
".",
"graph",
".",
"nodes",
"if",
"str",
"(",
"self",
".",
"species",
"[",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | FunctionalGroupExtractor.get_basic_functional_groups | Identify functional groups that cannot be identified by the Ertl method
of get_special_carbon and get_heteroatoms, such as benzene rings, methyl
groups, and ethyl groups.
TODO: Think of other functional groups that are important enough to be
added (ex: do we need ethyl, butyl, propyl?)
... | pymatgen/analysis/functional_groups.py | def get_basic_functional_groups(self, func_groups=None):
"""
Identify functional groups that cannot be identified by the Ertl method
of get_special_carbon and get_heteroatoms, such as benzene rings, methyl
groups, and ethyl groups.
TODO: Think of other functional groups that are... | def get_basic_functional_groups(self, func_groups=None):
"""
Identify functional groups that cannot be identified by the Ertl method
of get_special_carbon and get_heteroatoms, such as benzene rings, methyl
groups, and ethyl groups.
TODO: Think of other functional groups that are... | [
"Identify",
"functional",
"groups",
"that",
"cannot",
"be",
"identified",
"by",
"the",
"Ertl",
"method",
"of",
"get_special_carbon",
"and",
"get_heteroatoms",
"such",
"as",
"benzene",
"rings",
"methyl",
"groups",
"and",
"ethyl",
"groups",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/functional_groups.py#L238-L304 | [
"def",
"get_basic_functional_groups",
"(",
"self",
",",
"func_groups",
"=",
"None",
")",
":",
"strat",
"=",
"OpenBabelNN",
"(",
")",
"hydrogens",
"=",
"{",
"n",
"for",
"n",
"in",
"self",
".",
"molgraph",
".",
"graph",
".",
"nodes",
"if",
"str",
"(",
"s... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | FunctionalGroupExtractor.get_all_functional_groups | Identify all functional groups (or all within a certain subset) in the
molecule, combining the methods described above.
:param elements: List of elements that will qualify a carbon as special
(if only certain functional groups are of interest).
Default None.
:param func_... | pymatgen/analysis/functional_groups.py | def get_all_functional_groups(self, elements=None, func_groups=None,
catch_basic=True):
"""
Identify all functional groups (or all within a certain subset) in the
molecule, combining the methods described above.
:param elements: List of elements that wi... | def get_all_functional_groups(self, elements=None, func_groups=None,
catch_basic=True):
"""
Identify all functional groups (or all within a certain subset) in the
molecule, combining the methods described above.
:param elements: List of elements that wi... | [
"Identify",
"all",
"functional",
"groups",
"(",
"or",
"all",
"within",
"a",
"certain",
"subset",
")",
"in",
"the",
"molecule",
"combining",
"the",
"methods",
"described",
"above",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/functional_groups.py#L306-L330 | [
"def",
"get_all_functional_groups",
"(",
"self",
",",
"elements",
"=",
"None",
",",
"func_groups",
"=",
"None",
",",
"catch_basic",
"=",
"True",
")",
":",
"heteroatoms",
"=",
"self",
".",
"get_heteroatoms",
"(",
"elements",
"=",
"elements",
")",
"special_cs",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | FunctionalGroupExtractor.categorize_functional_groups | Determine classes of functional groups present in a set.
:param groups: Set of functional groups.
:return: dict containing representations of the groups, the indices of
where the group occurs in the MoleculeGraph, and how many of each
type of group there is. | pymatgen/analysis/functional_groups.py | def categorize_functional_groups(self, groups):
"""
Determine classes of functional groups present in a set.
:param groups: Set of functional groups.
:return: dict containing representations of the groups, the indices of
where the group occurs in the MoleculeGraph, and how m... | def categorize_functional_groups(self, groups):
"""
Determine classes of functional groups present in a set.
:param groups: Set of functional groups.
:return: dict containing representations of the groups, the indices of
where the group occurs in the MoleculeGraph, and how m... | [
"Determine",
"classes",
"of",
"functional",
"groups",
"present",
"in",
"a",
"set",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/functional_groups.py#L332-L373 | [
"def",
"categorize_functional_groups",
"(",
"self",
",",
"groups",
")",
":",
"categories",
"=",
"{",
"}",
"em",
"=",
"iso",
".",
"numerical_edge_match",
"(",
"\"weight\"",
",",
"1",
")",
"nm",
"=",
"iso",
".",
"categorical_node_match",
"(",
"\"specie\"",
","... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | raise_error_if_unphysical | Wrapper for functions or properties that should raise an error
if tensor is unphysical. | pymatgen/analysis/elasticity/elastic.py | def raise_error_if_unphysical(f):
"""
Wrapper for functions or properties that should raise an error
if tensor is unphysical.
"""
def wrapper(self, *args, **kwargs):
if self.k_vrh < 0 or self.g_vrh < 0:
raise ValueError("Bulk or shear modulus is negative, property "
... | def raise_error_if_unphysical(f):
"""
Wrapper for functions or properties that should raise an error
if tensor is unphysical.
"""
def wrapper(self, *args, **kwargs):
if self.k_vrh < 0 or self.g_vrh < 0:
raise ValueError("Bulk or shear modulus is negative, property "
... | [
"Wrapper",
"for",
"functions",
"or",
"properties",
"that",
"should",
"raise",
"an",
"error",
"if",
"tensor",
"is",
"unphysical",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L96-L106 | [
"def",
"raise_error_if_unphysical",
"(",
"f",
")",
":",
"def",
"wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"k_vrh",
"<",
"0",
"or",
"self",
".",
"g_vrh",
"<",
"0",
":",
"raise",
"ValueError",
"(",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | diff_fit | nth order elastic constant fitting function based on
central-difference derivatives with respect to distinct
strain states. The algorithm is summarized as follows:
1. Identify distinct strain states as sets of indices
for which nonzero strain values exist, typically
[(0), (1), (2), (3), (4),... | pymatgen/analysis/elasticity/elastic.py | def diff_fit(strains, stresses, eq_stress=None, order=2, tol=1e-10):
"""
nth order elastic constant fitting function based on
central-difference derivatives with respect to distinct
strain states. The algorithm is summarized as follows:
1. Identify distinct strain states as sets of indices
... | def diff_fit(strains, stresses, eq_stress=None, order=2, tol=1e-10):
"""
nth order elastic constant fitting function based on
central-difference derivatives with respect to distinct
strain states. The algorithm is summarized as follows:
1. Identify distinct strain states as sets of indices
... | [
"nth",
"order",
"elastic",
"constant",
"fitting",
"function",
"based",
"on",
"central",
"-",
"difference",
"derivatives",
"with",
"respect",
"to",
"distinct",
"strain",
"states",
".",
"The",
"algorithm",
"is",
"summarized",
"as",
"follows",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L828-L887 | [
"def",
"diff_fit",
"(",
"strains",
",",
"stresses",
",",
"eq_stress",
"=",
"None",
",",
"order",
"=",
"2",
",",
"tol",
"=",
"1e-10",
")",
":",
"strain_state_dict",
"=",
"get_strain_state_dict",
"(",
"strains",
",",
"stresses",
",",
"eq_stress",
"=",
"eq_st... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | find_eq_stress | Finds stress corresponding to zero strain state in stress-strain list
Args:
strains (Nx3x3 array-like): array corresponding to strains
stresses (Nx3x3 array-like): array corresponding to stresses
tol (float): tolerance to find zero strain state | pymatgen/analysis/elasticity/elastic.py | def find_eq_stress(strains, stresses, tol=1e-10):
"""
Finds stress corresponding to zero strain state in stress-strain list
Args:
strains (Nx3x3 array-like): array corresponding to strains
stresses (Nx3x3 array-like): array corresponding to stresses
tol (float): tolerance to find ze... | def find_eq_stress(strains, stresses, tol=1e-10):
"""
Finds stress corresponding to zero strain state in stress-strain list
Args:
strains (Nx3x3 array-like): array corresponding to strains
stresses (Nx3x3 array-like): array corresponding to stresses
tol (float): tolerance to find ze... | [
"Finds",
"stress",
"corresponding",
"to",
"zero",
"strain",
"state",
"in",
"stress",
"-",
"strain",
"list"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L890-L913 | [
"def",
"find_eq_stress",
"(",
"strains",
",",
"stresses",
",",
"tol",
"=",
"1e-10",
")",
":",
"stress_array",
"=",
"np",
".",
"array",
"(",
"stresses",
")",
"strain_array",
"=",
"np",
".",
"array",
"(",
"strains",
")",
"eq_stress",
"=",
"stress_array",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | get_strain_state_dict | Creates a dictionary of voigt-notation stress-strain sets
keyed by "strain state", i. e. a tuple corresponding to
the non-zero entries in ratios to the lowest nonzero value,
e.g. [0, 0.1, 0, 0.2, 0, 0] -> (0,1,0,2,0,0)
This allows strains to be collected in stencils as to
evaluate parameterized fini... | pymatgen/analysis/elasticity/elastic.py | def get_strain_state_dict(strains, stresses, eq_stress=None,
tol=1e-10, add_eq=True, sort=True):
"""
Creates a dictionary of voigt-notation stress-strain sets
keyed by "strain state", i. e. a tuple corresponding to
the non-zero entries in ratios to the lowest nonzero value,
... | def get_strain_state_dict(strains, stresses, eq_stress=None,
tol=1e-10, add_eq=True, sort=True):
"""
Creates a dictionary of voigt-notation stress-strain sets
keyed by "strain state", i. e. a tuple corresponding to
the non-zero entries in ratios to the lowest nonzero value,
... | [
"Creates",
"a",
"dictionary",
"of",
"voigt",
"-",
"notation",
"stress",
"-",
"strain",
"sets",
"keyed",
"by",
"strain",
"state",
"i",
".",
"e",
".",
"a",
"tuple",
"corresponding",
"to",
"the",
"non",
"-",
"zero",
"entries",
"in",
"ratios",
"to",
"the",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L916-L976 | [
"def",
"get_strain_state_dict",
"(",
"strains",
",",
"stresses",
",",
"eq_stress",
"=",
"None",
",",
"tol",
"=",
"1e-10",
",",
"add_eq",
"=",
"True",
",",
"sort",
"=",
"True",
")",
":",
"# Recast stress/strains",
"vstrains",
"=",
"np",
".",
"array",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | generate_pseudo | Generates the pseudoinverse for a given set of strains.
Args:
strain_states (6xN array like): a list of voigt-notation
"strain-states", i. e. perturbed indices of the strain
as a function of the smallest strain e. g. (0, 1, 0, 0, 1, 0)
order (int): order of pseudoinverse to ... | pymatgen/analysis/elasticity/elastic.py | def generate_pseudo(strain_states, order=3):
"""
Generates the pseudoinverse for a given set of strains.
Args:
strain_states (6xN array like): a list of voigt-notation
"strain-states", i. e. perturbed indices of the strain
as a function of the smallest strain e. g. (0, 1, 0,... | def generate_pseudo(strain_states, order=3):
"""
Generates the pseudoinverse for a given set of strains.
Args:
strain_states (6xN array like): a list of voigt-notation
"strain-states", i. e. perturbed indices of the strain
as a function of the smallest strain e. g. (0, 1, 0,... | [
"Generates",
"the",
"pseudoinverse",
"for",
"a",
"given",
"set",
"of",
"strains",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L979-L1017 | [
"def",
"generate_pseudo",
"(",
"strain_states",
",",
"order",
"=",
"3",
")",
":",
"s",
"=",
"sp",
".",
"Symbol",
"(",
"'s'",
")",
"nstates",
"=",
"len",
"(",
"strain_states",
")",
"ni",
"=",
"np",
".",
"array",
"(",
"strain_states",
")",
"*",
"s",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | get_symbol_list | Returns a symbolic representation of the voigt-notation
tensor that places identical symbols for entries related
by index transposition, i. e. C_1121 = C_1211 etc.
Args:
dim (int): dimension of matrix/tensor, e. g. 6 for
voigt notation and 3 for standard
rank (int): rank of tens... | pymatgen/analysis/elasticity/elastic.py | def get_symbol_list(rank, dim=6):
"""
Returns a symbolic representation of the voigt-notation
tensor that places identical symbols for entries related
by index transposition, i. e. C_1121 = C_1211 etc.
Args:
dim (int): dimension of matrix/tensor, e. g. 6 for
voigt notation and 3... | def get_symbol_list(rank, dim=6):
"""
Returns a symbolic representation of the voigt-notation
tensor that places identical symbols for entries related
by index transposition, i. e. C_1121 = C_1211 etc.
Args:
dim (int): dimension of matrix/tensor, e. g. 6 for
voigt notation and 3... | [
"Returns",
"a",
"symbolic",
"representation",
"of",
"the",
"voigt",
"-",
"notation",
"tensor",
"that",
"places",
"identical",
"symbols",
"for",
"entries",
"related",
"by",
"index",
"transposition",
"i",
".",
"e",
".",
"C_1121",
"=",
"C_1211",
"etc",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L1020-L1044 | [
"def",
"get_symbol_list",
"(",
"rank",
",",
"dim",
"=",
"6",
")",
":",
"indices",
"=",
"list",
"(",
"itertools",
".",
"combinations_with_replacement",
"(",
"range",
"(",
"dim",
")",
",",
"r",
"=",
"rank",
")",
")",
"c_vec",
"=",
"np",
".",
"zeros",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | get_diff_coeff | Helper function to find difference coefficients of an
derivative on an arbitrary mesh.
Args:
hvec (1D array-like): sampling stencil
n (int): degree of derivative to find | pymatgen/analysis/elasticity/elastic.py | def get_diff_coeff(hvec, n=1):
"""
Helper function to find difference coefficients of an
derivative on an arbitrary mesh.
Args:
hvec (1D array-like): sampling stencil
n (int): degree of derivative to find
"""
hvec = np.array(hvec, dtype=np.float)
acc = len(hvec)
exp = np... | def get_diff_coeff(hvec, n=1):
"""
Helper function to find difference coefficients of an
derivative on an arbitrary mesh.
Args:
hvec (1D array-like): sampling stencil
n (int): degree of derivative to find
"""
hvec = np.array(hvec, dtype=np.float)
acc = len(hvec)
exp = np... | [
"Helper",
"function",
"to",
"find",
"difference",
"coefficients",
"of",
"an",
"derivative",
"on",
"an",
"arbitrary",
"mesh",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L1066-L1081 | [
"def",
"get_diff_coeff",
"(",
"hvec",
",",
"n",
"=",
"1",
")",
":",
"hvec",
"=",
"np",
".",
"array",
"(",
"hvec",
",",
"dtype",
"=",
"np",
".",
"float",
")",
"acc",
"=",
"len",
"(",
"hvec",
")",
"exp",
"=",
"np",
".",
"column_stack",
"(",
"[",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NthOrderElasticTensor.calculate_stress | Calculate's a given elastic tensor's contribution to the
stress using Einstein summation
Args:
strain (3x3 array-like): matrix corresponding to strain | pymatgen/analysis/elasticity/elastic.py | def calculate_stress(self, strain):
"""
Calculate's a given elastic tensor's contribution to the
stress using Einstein summation
Args:
strain (3x3 array-like): matrix corresponding to strain
"""
strain = np.array(strain)
if strain.shape == (6,):
... | def calculate_stress(self, strain):
"""
Calculate's a given elastic tensor's contribution to the
stress using Einstein summation
Args:
strain (3x3 array-like): matrix corresponding to strain
"""
strain = np.array(strain)
if strain.shape == (6,):
... | [
"Calculate",
"s",
"a",
"given",
"elastic",
"tensor",
"s",
"contribution",
"to",
"the",
"stress",
"using",
"Einstein",
"summation"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L65-L79 | [
"def",
"calculate_stress",
"(",
"self",
",",
"strain",
")",
":",
"strain",
"=",
"np",
".",
"array",
"(",
"strain",
")",
"if",
"strain",
".",
"shape",
"==",
"(",
"6",
",",
")",
":",
"strain",
"=",
"Strain",
".",
"from_voigt",
"(",
"strain",
")",
"as... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NthOrderElasticTensor.energy_density | Calculates the elastic energy density due to a strain | pymatgen/analysis/elasticity/elastic.py | def energy_density(self, strain, convert_GPa_to_eV=True):
"""
Calculates the elastic energy density due to a strain
"""
e_density = np.sum(self.calculate_stress(strain)*strain) / self.order
if convert_GPa_to_eV:
e_density *= self.GPa_to_eV_A3 # Conversion factor for ... | def energy_density(self, strain, convert_GPa_to_eV=True):
"""
Calculates the elastic energy density due to a strain
"""
e_density = np.sum(self.calculate_stress(strain)*strain) / self.order
if convert_GPa_to_eV:
e_density *= self.GPa_to_eV_A3 # Conversion factor for ... | [
"Calculates",
"the",
"elastic",
"energy",
"density",
"due",
"to",
"a",
"strain"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L81-L88 | [
"def",
"energy_density",
"(",
"self",
",",
"strain",
",",
"convert_GPa_to_eV",
"=",
"True",
")",
":",
"e_density",
"=",
"np",
".",
"sum",
"(",
"self",
".",
"calculate_stress",
"(",
"strain",
")",
"*",
"strain",
")",
"/",
"self",
".",
"order",
"if",
"co... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.compliance_tensor | returns the Voigt-notation compliance tensor,
which is the matrix inverse of the
Voigt-notation elastic tensor | pymatgen/analysis/elasticity/elastic.py | def compliance_tensor(self):
"""
returns the Voigt-notation compliance tensor,
which is the matrix inverse of the
Voigt-notation elastic tensor
"""
s_voigt = np.linalg.inv(self.voigt)
return ComplianceTensor.from_voigt(s_voigt) | def compliance_tensor(self):
"""
returns the Voigt-notation compliance tensor,
which is the matrix inverse of the
Voigt-notation elastic tensor
"""
s_voigt = np.linalg.inv(self.voigt)
return ComplianceTensor.from_voigt(s_voigt) | [
"returns",
"the",
"Voigt",
"-",
"notation",
"compliance",
"tensor",
"which",
"is",
"the",
"matrix",
"inverse",
"of",
"the",
"Voigt",
"-",
"notation",
"elastic",
"tensor"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L138-L145 | [
"def",
"compliance_tensor",
"(",
"self",
")",
":",
"s_voigt",
"=",
"np",
".",
"linalg",
".",
"inv",
"(",
"self",
".",
"voigt",
")",
"return",
"ComplianceTensor",
".",
"from_voigt",
"(",
"s_voigt",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.g_voigt | returns the G_v shear modulus | pymatgen/analysis/elasticity/elastic.py | def g_voigt(self):
"""
returns the G_v shear modulus
"""
return (2. * self.voigt[:3, :3].trace() -
np.triu(self.voigt[:3, :3]).sum() +
3 * self.voigt[3:, 3:].trace()) / 15. | def g_voigt(self):
"""
returns the G_v shear modulus
"""
return (2. * self.voigt[:3, :3].trace() -
np.triu(self.voigt[:3, :3]).sum() +
3 * self.voigt[3:, 3:].trace()) / 15. | [
"returns",
"the",
"G_v",
"shear",
"modulus"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L155-L161 | [
"def",
"g_voigt",
"(",
"self",
")",
":",
"return",
"(",
"2.",
"*",
"self",
".",
"voigt",
"[",
":",
"3",
",",
":",
"3",
"]",
".",
"trace",
"(",
")",
"-",
"np",
".",
"triu",
"(",
"self",
".",
"voigt",
"[",
":",
"3",
",",
":",
"3",
"]",
")",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.g_reuss | returns the G_r shear modulus | pymatgen/analysis/elasticity/elastic.py | def g_reuss(self):
"""
returns the G_r shear modulus
"""
return 15. / (8. * self.compliance_tensor.voigt[:3, :3].trace() -
4. * np.triu(self.compliance_tensor.voigt[:3, :3]).sum() +
3. * self.compliance_tensor.voigt[3:, 3:].trace()) | def g_reuss(self):
"""
returns the G_r shear modulus
"""
return 15. / (8. * self.compliance_tensor.voigt[:3, :3].trace() -
4. * np.triu(self.compliance_tensor.voigt[:3, :3]).sum() +
3. * self.compliance_tensor.voigt[3:, 3:].trace()) | [
"returns",
"the",
"G_r",
"shear",
"modulus"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L171-L177 | [
"def",
"g_reuss",
"(",
"self",
")",
":",
"return",
"15.",
"/",
"(",
"8.",
"*",
"self",
".",
"compliance_tensor",
".",
"voigt",
"[",
":",
"3",
",",
":",
"3",
"]",
".",
"trace",
"(",
")",
"-",
"4.",
"*",
"np",
".",
"triu",
"(",
"self",
".",
"co... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.y_mod | Calculates Young's modulus (in SI units) using the
Voigt-Reuss-Hill averages of bulk and shear moduli | pymatgen/analysis/elasticity/elastic.py | def y_mod(self):
"""
Calculates Young's modulus (in SI units) using the
Voigt-Reuss-Hill averages of bulk and shear moduli
"""
return 9.e9 * self.k_vrh * self.g_vrh / (3. * self.k_vrh + self.g_vrh) | def y_mod(self):
"""
Calculates Young's modulus (in SI units) using the
Voigt-Reuss-Hill averages of bulk and shear moduli
"""
return 9.e9 * self.k_vrh * self.g_vrh / (3. * self.k_vrh + self.g_vrh) | [
"Calculates",
"Young",
"s",
"modulus",
"(",
"in",
"SI",
"units",
")",
"using",
"the",
"Voigt",
"-",
"Reuss",
"-",
"Hill",
"averages",
"of",
"bulk",
"and",
"shear",
"moduli"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L194-L199 | [
"def",
"y_mod",
"(",
"self",
")",
":",
"return",
"9.e9",
"*",
"self",
".",
"k_vrh",
"*",
"self",
".",
"g_vrh",
"/",
"(",
"3.",
"*",
"self",
".",
"k_vrh",
"+",
"self",
".",
"g_vrh",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.directional_poisson_ratio | Calculates the poisson ratio for a specific direction
relative to a second, orthogonal direction
Args:
n (3-d vector): principal direction
m (3-d vector): secondary direction orthogonal to n
tol (float): tolerance for testing of orthogonality | pymatgen/analysis/elasticity/elastic.py | def directional_poisson_ratio(self, n, m, tol=1e-8):
"""
Calculates the poisson ratio for a specific direction
relative to a second, orthogonal direction
Args:
n (3-d vector): principal direction
m (3-d vector): secondary direction orthogonal to n
tol... | def directional_poisson_ratio(self, n, m, tol=1e-8):
"""
Calculates the poisson ratio for a specific direction
relative to a second, orthogonal direction
Args:
n (3-d vector): principal direction
m (3-d vector): secondary direction orthogonal to n
tol... | [
"Calculates",
"the",
"poisson",
"ratio",
"for",
"a",
"specific",
"direction",
"relative",
"to",
"a",
"second",
"orthogonal",
"direction"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L201-L216 | [
"def",
"directional_poisson_ratio",
"(",
"self",
",",
"n",
",",
"m",
",",
"tol",
"=",
"1e-8",
")",
":",
"n",
",",
"m",
"=",
"get_uvec",
"(",
"n",
")",
",",
"get_uvec",
"(",
"m",
")",
"if",
"not",
"np",
".",
"abs",
"(",
"np",
".",
"dot",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.trans_v | Calculates transverse sound velocity (in SI units) using the
Voigt-Reuss-Hill average bulk modulus
Args:
structure: pymatgen structure object
Returns: transverse sound velocity (in SI units) | pymatgen/analysis/elasticity/elastic.py | def trans_v(self, structure):
"""
Calculates transverse sound velocity (in SI units) using the
Voigt-Reuss-Hill average bulk modulus
Args:
structure: pymatgen structure object
Returns: transverse sound velocity (in SI units)
"""
nsites = structure.n... | def trans_v(self, structure):
"""
Calculates transverse sound velocity (in SI units) using the
Voigt-Reuss-Hill average bulk modulus
Args:
structure: pymatgen structure object
Returns: transverse sound velocity (in SI units)
"""
nsites = structure.n... | [
"Calculates",
"transverse",
"sound",
"velocity",
"(",
"in",
"SI",
"units",
")",
"using",
"the",
"Voigt",
"-",
"Reuss",
"-",
"Hill",
"average",
"bulk",
"modulus"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L226-L245 | [
"def",
"trans_v",
"(",
"self",
",",
"structure",
")",
":",
"nsites",
"=",
"structure",
".",
"num_sites",
"volume",
"=",
"structure",
".",
"volume",
"natoms",
"=",
"structure",
".",
"composition",
".",
"num_atoms",
"weight",
"=",
"float",
"(",
"structure",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.snyder_ac | Calculates Snyder's acoustic sound velocity (in SI units)
Args:
structure: pymatgen structure object
Returns: Snyder's acoustic sound velocity (in SI units) | pymatgen/analysis/elasticity/elastic.py | def snyder_ac(self, structure):
"""
Calculates Snyder's acoustic sound velocity (in SI units)
Args:
structure: pymatgen structure object
Returns: Snyder's acoustic sound velocity (in SI units)
"""
nsites = structure.num_sites
volume = structure.volu... | def snyder_ac(self, structure):
"""
Calculates Snyder's acoustic sound velocity (in SI units)
Args:
structure: pymatgen structure object
Returns: Snyder's acoustic sound velocity (in SI units)
"""
nsites = structure.num_sites
volume = structure.volu... | [
"Calculates",
"Snyder",
"s",
"acoustic",
"sound",
"velocity",
"(",
"in",
"SI",
"units",
")"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L270-L288 | [
"def",
"snyder_ac",
"(",
"self",
",",
"structure",
")",
":",
"nsites",
"=",
"structure",
".",
"num_sites",
"volume",
"=",
"structure",
".",
"volume",
"natoms",
"=",
"structure",
".",
"composition",
".",
"num_atoms",
"num_density",
"=",
"1e30",
"*",
"nsites",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.snyder_opt | Calculates Snyder's optical sound velocity (in SI units)
Args:
structure: pymatgen structure object
Returns: Snyder's optical sound velocity (in SI units) | pymatgen/analysis/elasticity/elastic.py | def snyder_opt(self, structure):
"""
Calculates Snyder's optical sound velocity (in SI units)
Args:
structure: pymatgen structure object
Returns: Snyder's optical sound velocity (in SI units)
"""
nsites = structure.num_sites
volume = structure.volum... | def snyder_opt(self, structure):
"""
Calculates Snyder's optical sound velocity (in SI units)
Args:
structure: pymatgen structure object
Returns: Snyder's optical sound velocity (in SI units)
"""
nsites = structure.num_sites
volume = structure.volum... | [
"Calculates",
"Snyder",
"s",
"optical",
"sound",
"velocity",
"(",
"in",
"SI",
"units",
")"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L291-L306 | [
"def",
"snyder_opt",
"(",
"self",
",",
"structure",
")",
":",
"nsites",
"=",
"structure",
".",
"num_sites",
"volume",
"=",
"structure",
".",
"volume",
"num_density",
"=",
"1e30",
"*",
"nsites",
"/",
"volume",
"return",
"1.66914e-23",
"*",
"(",
"self",
".",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.clarke_thermalcond | Calculates Clarke's thermal conductivity (in SI units)
Args:
structure: pymatgen structure object
Returns: Clarke's thermal conductivity (in SI units) | pymatgen/analysis/elasticity/elastic.py | def clarke_thermalcond(self, structure):
"""
Calculates Clarke's thermal conductivity (in SI units)
Args:
structure: pymatgen structure object
Returns: Clarke's thermal conductivity (in SI units)
"""
nsites = structure.num_sites
volume = structure.v... | def clarke_thermalcond(self, structure):
"""
Calculates Clarke's thermal conductivity (in SI units)
Args:
structure: pymatgen structure object
Returns: Clarke's thermal conductivity (in SI units)
"""
nsites = structure.num_sites
volume = structure.v... | [
"Calculates",
"Clarke",
"s",
"thermal",
"conductivity",
"(",
"in",
"SI",
"units",
")"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L322-L340 | [
"def",
"clarke_thermalcond",
"(",
"self",
",",
"structure",
")",
":",
"nsites",
"=",
"structure",
".",
"num_sites",
"volume",
"=",
"structure",
".",
"volume",
"tot_mass",
"=",
"sum",
"(",
"[",
"e",
".",
"atomic_mass",
"for",
"e",
"in",
"structure",
".",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.debye_temperature | Estimates the debye temperature from longitudinal and
transverse sound velocities
Args:
structure: pymatgen structure object
Returns: debye temperature (in SI units) | pymatgen/analysis/elasticity/elastic.py | def debye_temperature(self, structure):
"""
Estimates the debye temperature from longitudinal and
transverse sound velocities
Args:
structure: pymatgen structure object
Returns: debye temperature (in SI units)
"""
v0 = (structure.volume * 1e-30 / st... | def debye_temperature(self, structure):
"""
Estimates the debye temperature from longitudinal and
transverse sound velocities
Args:
structure: pymatgen structure object
Returns: debye temperature (in SI units)
"""
v0 = (structure.volume * 1e-30 / st... | [
"Estimates",
"the",
"debye",
"temperature",
"from",
"longitudinal",
"and",
"transverse",
"sound",
"velocities"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L360-L375 | [
"def",
"debye_temperature",
"(",
"self",
",",
"structure",
")",
":",
"v0",
"=",
"(",
"structure",
".",
"volume",
"*",
"1e-30",
"/",
"structure",
".",
"num_sites",
")",
"vl",
",",
"vt",
"=",
"self",
".",
"long_v",
"(",
"structure",
")",
",",
"self",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.universal_anisotropy | returns the universal anisotropy value | pymatgen/analysis/elasticity/elastic.py | def universal_anisotropy(self):
"""
returns the universal anisotropy value
"""
return 5. * self.g_voigt / self.g_reuss + \
self.k_voigt / self.k_reuss - 6. | def universal_anisotropy(self):
"""
returns the universal anisotropy value
"""
return 5. * self.g_voigt / self.g_reuss + \
self.k_voigt / self.k_reuss - 6. | [
"returns",
"the",
"universal",
"anisotropy",
"value"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L387-L392 | [
"def",
"universal_anisotropy",
"(",
"self",
")",
":",
"return",
"5.",
"*",
"self",
".",
"g_voigt",
"/",
"self",
".",
"g_reuss",
"+",
"self",
".",
"k_voigt",
"/",
"self",
".",
"k_reuss",
"-",
"6."
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.homogeneous_poisson | returns the homogeneous poisson ratio | pymatgen/analysis/elasticity/elastic.py | def homogeneous_poisson(self):
"""
returns the homogeneous poisson ratio
"""
return (1. - 2. / 3. * self.g_vrh / self.k_vrh) / \
(2. + 2. / 3. * self.g_vrh / self.k_vrh) | def homogeneous_poisson(self):
"""
returns the homogeneous poisson ratio
"""
return (1. - 2. / 3. * self.g_vrh / self.k_vrh) / \
(2. + 2. / 3. * self.g_vrh / self.k_vrh) | [
"returns",
"the",
"homogeneous",
"poisson",
"ratio"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L395-L400 | [
"def",
"homogeneous_poisson",
"(",
"self",
")",
":",
"return",
"(",
"1.",
"-",
"2.",
"/",
"3.",
"*",
"self",
".",
"g_vrh",
"/",
"self",
".",
"k_vrh",
")",
"/",
"(",
"2.",
"+",
"2.",
"/",
"3.",
"*",
"self",
".",
"g_vrh",
"/",
"self",
".",
"k_vrh... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.get_structure_property_dict | returns a dictionary of properties derived from the elastic tensor
and an associated structure
Args:
structure (Structure): structure object for which to calculate
associated properties
include_base_props (bool): whether to include base properties,
... | pymatgen/analysis/elasticity/elastic.py | def get_structure_property_dict(self, structure, include_base_props=True,
ignore_errors=False):
"""
returns a dictionary of properties derived from the elastic tensor
and an associated structure
Args:
structure (Structure): structure objec... | def get_structure_property_dict(self, structure, include_base_props=True,
ignore_errors=False):
"""
returns a dictionary of properties derived from the elastic tensor
and an associated structure
Args:
structure (Structure): structure objec... | [
"returns",
"a",
"dictionary",
"of",
"properties",
"derived",
"from",
"the",
"elastic",
"tensor",
"and",
"an",
"associated",
"structure"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L417-L441 | [
"def",
"get_structure_property_dict",
"(",
"self",
",",
"structure",
",",
"include_base_props",
"=",
"True",
",",
"ignore_errors",
"=",
"False",
")",
":",
"s_props",
"=",
"[",
"\"trans_v\"",
",",
"\"long_v\"",
",",
"\"snyder_ac\"",
",",
"\"snyder_opt\"",
",",
"\... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.from_pseudoinverse | Class method to fit an elastic tensor from stress/strain
data. Method uses Moore-Penrose pseudoinverse to invert
the s = C*e equation with elastic tensor, stress, and
strain in voigt notation
Args:
stresses (Nx3x3 array-like): list or array of stresses
strains (... | pymatgen/analysis/elasticity/elastic.py | def from_pseudoinverse(cls, strains, stresses):
"""
Class method to fit an elastic tensor from stress/strain
data. Method uses Moore-Penrose pseudoinverse to invert
the s = C*e equation with elastic tensor, stress, and
strain in voigt notation
Args:
stresses... | def from_pseudoinverse(cls, strains, stresses):
"""
Class method to fit an elastic tensor from stress/strain
data. Method uses Moore-Penrose pseudoinverse to invert
the s = C*e equation with elastic tensor, stress, and
strain in voigt notation
Args:
stresses... | [
"Class",
"method",
"to",
"fit",
"an",
"elastic",
"tensor",
"from",
"stress",
"/",
"strain",
"data",
".",
"Method",
"uses",
"Moore",
"-",
"Penrose",
"pseudoinverse",
"to",
"invert",
"the",
"s",
"=",
"C",
"*",
"e",
"equation",
"with",
"elastic",
"tensor",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L444-L463 | [
"def",
"from_pseudoinverse",
"(",
"cls",
",",
"strains",
",",
"stresses",
")",
":",
"# convert the stress/strain to Nx6 arrays of voigt-notation",
"warnings",
".",
"warn",
"(",
"\"Pseudoinverse fitting of Strain/Stress lists may yield \"",
"\"questionable results from vasp data, use ... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensor.from_independent_strains | Constructs the elastic tensor least-squares fit of independent strains
Args:
strains (list of Strains): list of strain objects to fit
stresses (list of Stresses): list of stress objects to use in fit
corresponding to the list of strains
eq_stress (Stress): equ... | pymatgen/analysis/elasticity/elastic.py | def from_independent_strains(cls, strains, stresses, eq_stress=None,
vasp=False, tol=1e-10):
"""
Constructs the elastic tensor least-squares fit of independent strains
Args:
strains (list of Strains): list of strain objects to fit
stresses... | def from_independent_strains(cls, strains, stresses, eq_stress=None,
vasp=False, tol=1e-10):
"""
Constructs the elastic tensor least-squares fit of independent strains
Args:
strains (list of Strains): list of strain objects to fit
stresses... | [
"Constructs",
"the",
"elastic",
"tensor",
"least",
"-",
"squares",
"fit",
"of",
"independent",
"strains",
"Args",
":",
"strains",
"(",
"list",
"of",
"Strains",
")",
":",
"list",
"of",
"strain",
"objects",
"to",
"fit",
"stresses",
"(",
"list",
"of",
"Stress... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L466-L498 | [
"def",
"from_independent_strains",
"(",
"cls",
",",
"strains",
",",
"stresses",
",",
"eq_stress",
"=",
"None",
",",
"vasp",
"=",
"False",
",",
"tol",
"=",
"1e-10",
")",
":",
"strain_states",
"=",
"[",
"tuple",
"(",
"ss",
")",
"for",
"ss",
"in",
"np",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.from_diff_fit | Generates an elastic tensor expansion via the fitting function
defined below in diff_fit | pymatgen/analysis/elasticity/elastic.py | def from_diff_fit(cls, strains, stresses, eq_stress=None,
tol=1e-10, order=3):
"""
Generates an elastic tensor expansion via the fitting function
defined below in diff_fit
"""
c_list = diff_fit(strains, stresses, eq_stress, order, tol)
return cls(c_l... | def from_diff_fit(cls, strains, stresses, eq_stress=None,
tol=1e-10, order=3):
"""
Generates an elastic tensor expansion via the fitting function
defined below in diff_fit
"""
c_list = diff_fit(strains, stresses, eq_stress, order, tol)
return cls(c_l... | [
"Generates",
"an",
"elastic",
"tensor",
"expansion",
"via",
"the",
"fitting",
"function",
"defined",
"below",
"in",
"diff_fit"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L538-L545 | [
"def",
"from_diff_fit",
"(",
"cls",
",",
"strains",
",",
"stresses",
",",
"eq_stress",
"=",
"None",
",",
"tol",
"=",
"1e-10",
",",
"order",
"=",
"3",
")",
":",
"c_list",
"=",
"diff_fit",
"(",
"strains",
",",
"stresses",
",",
"eq_stress",
",",
"order",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.energy_density | Calculates the elastic energy density due to a strain | pymatgen/analysis/elasticity/elastic.py | def energy_density(self, strain, convert_GPa_to_eV=True):
"""
Calculates the elastic energy density due to a strain
"""
return sum([c.energy_density(strain, convert_GPa_to_eV)
for c in self]) | def energy_density(self, strain, convert_GPa_to_eV=True):
"""
Calculates the elastic energy density due to a strain
"""
return sum([c.energy_density(strain, convert_GPa_to_eV)
for c in self]) | [
"Calculates",
"the",
"elastic",
"energy",
"density",
"due",
"to",
"a",
"strain"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L562-L567 | [
"def",
"energy_density",
"(",
"self",
",",
"strain",
",",
"convert_GPa_to_eV",
"=",
"True",
")",
":",
"return",
"sum",
"(",
"[",
"c",
".",
"energy_density",
"(",
"strain",
",",
"convert_GPa_to_eV",
")",
"for",
"c",
"in",
"self",
"]",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_ggt | Gets the Generalized Gruneisen tensor for a given
third-order elastic tensor expansion.
Args:
n (3x1 array-like): normal mode direction
u (3x1 array-like): polarization direction | pymatgen/analysis/elasticity/elastic.py | def get_ggt(self, n, u):
"""
Gets the Generalized Gruneisen tensor for a given
third-order elastic tensor expansion.
Args:
n (3x1 array-like): normal mode direction
u (3x1 array-like): polarization direction
"""
gk = self[0].einsum_sequence([n, u,... | def get_ggt(self, n, u):
"""
Gets the Generalized Gruneisen tensor for a given
third-order elastic tensor expansion.
Args:
n (3x1 array-like): normal mode direction
u (3x1 array-like): polarization direction
"""
gk = self[0].einsum_sequence([n, u,... | [
"Gets",
"the",
"Generalized",
"Gruneisen",
"tensor",
"for",
"a",
"given",
"third",
"-",
"order",
"elastic",
"tensor",
"expansion",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L569-L581 | [
"def",
"get_ggt",
"(",
"self",
",",
"n",
",",
"u",
")",
":",
"gk",
"=",
"self",
"[",
"0",
"]",
".",
"einsum_sequence",
"(",
"[",
"n",
",",
"u",
",",
"n",
",",
"u",
"]",
")",
"result",
"=",
"-",
"(",
"2",
"*",
"gk",
"*",
"np",
".",
"outer"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_tgt | Gets the thermodynamic Gruneisen tensor (TGT) by via an
integration of the GGT weighted by the directional heat
capacity.
See refs:
R. N. Thurston and K. Brugger, Phys. Rev. 113, A1604 (1964).
K. Brugger Phys. Rev. 137, A1826 (1965).
Args:
temperatur... | pymatgen/analysis/elasticity/elastic.py | def get_tgt(self, temperature=None, structure=None, quad=None):
"""
Gets the thermodynamic Gruneisen tensor (TGT) by via an
integration of the GGT weighted by the directional heat
capacity.
See refs:
R. N. Thurston and K. Brugger, Phys. Rev. 113, A1604 (1964).
... | def get_tgt(self, temperature=None, structure=None, quad=None):
"""
Gets the thermodynamic Gruneisen tensor (TGT) by via an
integration of the GGT weighted by the directional heat
capacity.
See refs:
R. N. Thurston and K. Brugger, Phys. Rev. 113, A1604 (1964).
... | [
"Gets",
"the",
"thermodynamic",
"Gruneisen",
"tensor",
"(",
"TGT",
")",
"by",
"via",
"an",
"integration",
"of",
"the",
"GGT",
"weighted",
"by",
"the",
"directional",
"heat",
"capacity",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L583-L621 | [
"def",
"get_tgt",
"(",
"self",
",",
"temperature",
"=",
"None",
",",
"structure",
"=",
"None",
",",
"quad",
"=",
"None",
")",
":",
"if",
"temperature",
"and",
"not",
"structure",
":",
"raise",
"ValueError",
"(",
"\"If using temperature input, you must also \"",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_gruneisen_parameter | Gets the single average gruneisen parameter from the TGT.
Args:
temperature (float): Temperature in kelvin, if not specified
will return non-cv-normalized value
structure (float): Structure to be used in directional heat
capacity determination, only neces... | pymatgen/analysis/elasticity/elastic.py | def get_gruneisen_parameter(self, temperature=None, structure=None,
quad=None):
"""
Gets the single average gruneisen parameter from the TGT.
Args:
temperature (float): Temperature in kelvin, if not specified
will return non-cv-normali... | def get_gruneisen_parameter(self, temperature=None, structure=None,
quad=None):
"""
Gets the single average gruneisen parameter from the TGT.
Args:
temperature (float): Temperature in kelvin, if not specified
will return non-cv-normali... | [
"Gets",
"the",
"single",
"average",
"gruneisen",
"parameter",
"from",
"the",
"TGT",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L623-L638 | [
"def",
"get_gruneisen_parameter",
"(",
"self",
",",
"temperature",
"=",
"None",
",",
"structure",
"=",
"None",
",",
"quad",
"=",
"None",
")",
":",
"return",
"np",
".",
"trace",
"(",
"self",
".",
"get_tgt",
"(",
"temperature",
",",
"structure",
",",
"quad... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_heat_capacity | Gets the directional heat capacity for a higher order tensor
expansion as a function of direction and polarization.
Args:
temperature (float): Temperature in kelvin
structure (float): Structure to be used in directional heat
capacity determination
n (... | pymatgen/analysis/elasticity/elastic.py | def get_heat_capacity(self, temperature, structure, n, u, cutoff=1e2):
"""
Gets the directional heat capacity for a higher order tensor
expansion as a function of direction and polarization.
Args:
temperature (float): Temperature in kelvin
structure (float): Stru... | def get_heat_capacity(self, temperature, structure, n, u, cutoff=1e2):
"""
Gets the directional heat capacity for a higher order tensor
expansion as a function of direction and polarization.
Args:
temperature (float): Temperature in kelvin
structure (float): Stru... | [
"Gets",
"the",
"directional",
"heat",
"capacity",
"for",
"a",
"higher",
"order",
"tensor",
"expansion",
"as",
"a",
"function",
"of",
"direction",
"and",
"polarization",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L640-L662 | [
"def",
"get_heat_capacity",
"(",
"self",
",",
"temperature",
",",
"structure",
",",
"n",
",",
"u",
",",
"cutoff",
"=",
"1e2",
")",
":",
"k",
"=",
"1.38065e-23",
"kt",
"=",
"k",
"*",
"temperature",
"hbar_w",
"=",
"1.05457e-34",
"*",
"self",
".",
"omega"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.omega | Finds directional frequency contribution to the heat
capacity from direction and polarization
Args:
structure (Structure): Structure to be used in directional heat
capacity determination
n (3x1 array-like): direction for Cv determination
u (3x1 array-... | pymatgen/analysis/elasticity/elastic.py | def omega(self, structure, n, u):
"""
Finds directional frequency contribution to the heat
capacity from direction and polarization
Args:
structure (Structure): Structure to be used in directional heat
capacity determination
n (3x1 array-like): di... | def omega(self, structure, n, u):
"""
Finds directional frequency contribution to the heat
capacity from direction and polarization
Args:
structure (Structure): Structure to be used in directional heat
capacity determination
n (3x1 array-like): di... | [
"Finds",
"directional",
"frequency",
"contribution",
"to",
"the",
"heat",
"capacity",
"from",
"direction",
"and",
"polarization"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L664-L682 | [
"def",
"omega",
"(",
"self",
",",
"structure",
",",
"n",
",",
"u",
")",
":",
"l0",
"=",
"np",
".",
"dot",
"(",
"np",
".",
"sum",
"(",
"structure",
".",
"lattice",
".",
"matrix",
",",
"axis",
"=",
"0",
")",
",",
"n",
")",
"l0",
"*=",
"1e-10",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.thermal_expansion_coeff | Gets thermal expansion coefficient from third-order constants.
Args:
temperature (float): Temperature in kelvin, if not specified
will return non-cv-normalized value
structure (Structure): Structure to be used in directional heat
capacity determination, o... | pymatgen/analysis/elasticity/elastic.py | def thermal_expansion_coeff(self, structure, temperature, mode="debye"):
"""
Gets thermal expansion coefficient from third-order constants.
Args:
temperature (float): Temperature in kelvin, if not specified
will return non-cv-normalized value
structure (S... | def thermal_expansion_coeff(self, structure, temperature, mode="debye"):
"""
Gets thermal expansion coefficient from third-order constants.
Args:
temperature (float): Temperature in kelvin, if not specified
will return non-cv-normalized value
structure (S... | [
"Gets",
"thermal",
"expansion",
"coefficient",
"from",
"third",
"-",
"order",
"constants",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L684-L711 | [
"def",
"thermal_expansion_coeff",
"(",
"self",
",",
"structure",
",",
"temperature",
",",
"mode",
"=",
"\"debye\"",
")",
":",
"soec",
"=",
"ElasticTensor",
"(",
"self",
"[",
"0",
"]",
")",
"v0",
"=",
"(",
"structure",
".",
"volume",
"*",
"1e-30",
"/",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_compliance_expansion | Gets a compliance tensor expansion from the elastic
tensor expansion. | pymatgen/analysis/elasticity/elastic.py | def get_compliance_expansion(self):
"""
Gets a compliance tensor expansion from the elastic
tensor expansion.
"""
# TODO: this might have a general form
if not self.order <= 4:
raise ValueError("Compliance tensor expansion only "
"... | def get_compliance_expansion(self):
"""
Gets a compliance tensor expansion from the elastic
tensor expansion.
"""
# TODO: this might have a general form
if not self.order <= 4:
raise ValueError("Compliance tensor expansion only "
"... | [
"Gets",
"a",
"compliance",
"tensor",
"expansion",
"from",
"the",
"elastic",
"tensor",
"expansion",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L713-L737 | [
"def",
"get_compliance_expansion",
"(",
"self",
")",
":",
"# TODO: this might have a general form",
"if",
"not",
"self",
".",
"order",
"<=",
"4",
":",
"raise",
"ValueError",
"(",
"\"Compliance tensor expansion only \"",
"\"supported for fourth-order and lower\"",
")",
"ce_e... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_strain_from_stress | Gets the strain from a stress state according
to the compliance expansion corresponding to the
tensor expansion. | pymatgen/analysis/elasticity/elastic.py | def get_strain_from_stress(self, stress):
"""
Gets the strain from a stress state according
to the compliance expansion corresponding to the
tensor expansion.
"""
compl_exp = self.get_compliance_expansion()
strain = 0
for n, compl in enumerate(compl_exp):
... | def get_strain_from_stress(self, stress):
"""
Gets the strain from a stress state according
to the compliance expansion corresponding to the
tensor expansion.
"""
compl_exp = self.get_compliance_expansion()
strain = 0
for n, compl in enumerate(compl_exp):
... | [
"Gets",
"the",
"strain",
"from",
"a",
"stress",
"state",
"according",
"to",
"the",
"compliance",
"expansion",
"corresponding",
"to",
"the",
"tensor",
"expansion",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L739-L749 | [
"def",
"get_strain_from_stress",
"(",
"self",
",",
"stress",
")",
":",
"compl_exp",
"=",
"self",
".",
"get_compliance_expansion",
"(",
")",
"strain",
"=",
"0",
"for",
"n",
",",
"compl",
"in",
"enumerate",
"(",
"compl_exp",
")",
":",
"strain",
"+=",
"compl"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_effective_ecs | Returns the effective elastic constants
from the elastic tensor expansion.
Args:
strain (Strain or 3x3 array-like): strain condition
under which to calculate the effective constants
order (int): order of the ecs to be returned | pymatgen/analysis/elasticity/elastic.py | def get_effective_ecs(self, strain, order=2):
"""
Returns the effective elastic constants
from the elastic tensor expansion.
Args:
strain (Strain or 3x3 array-like): strain condition
under which to calculate the effective constants
order (int): or... | def get_effective_ecs(self, strain, order=2):
"""
Returns the effective elastic constants
from the elastic tensor expansion.
Args:
strain (Strain or 3x3 array-like): strain condition
under which to calculate the effective constants
order (int): or... | [
"Returns",
"the",
"effective",
"elastic",
"constants",
"from",
"the",
"elastic",
"tensor",
"expansion",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L751-L764 | [
"def",
"get_effective_ecs",
"(",
"self",
",",
"strain",
",",
"order",
"=",
"2",
")",
":",
"ec_sum",
"=",
"0",
"for",
"n",
",",
"ecs",
"in",
"enumerate",
"(",
"self",
"[",
"order",
"-",
"2",
":",
"]",
")",
":",
"ec_sum",
"+=",
"ecs",
".",
"einsum_... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_wallace_tensor | Gets the Wallace Tensor for determining yield strength
criteria.
Args:
tau (3x3 array-like): stress at which to evaluate
the wallace tensor | pymatgen/analysis/elasticity/elastic.py | def get_wallace_tensor(self, tau):
"""
Gets the Wallace Tensor for determining yield strength
criteria.
Args:
tau (3x3 array-like): stress at which to evaluate
the wallace tensor
"""
b = 0.5 * (np.einsum("ml,kn->klmn", tau, np.eye(3)) +
... | def get_wallace_tensor(self, tau):
"""
Gets the Wallace Tensor for determining yield strength
criteria.
Args:
tau (3x3 array-like): stress at which to evaluate
the wallace tensor
"""
b = 0.5 * (np.einsum("ml,kn->klmn", tau, np.eye(3)) +
... | [
"Gets",
"the",
"Wallace",
"Tensor",
"for",
"determining",
"yield",
"strength",
"criteria",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L766-L782 | [
"def",
"get_wallace_tensor",
"(",
"self",
",",
"tau",
")",
":",
"b",
"=",
"0.5",
"*",
"(",
"np",
".",
"einsum",
"(",
"\"ml,kn->klmn\"",
",",
"tau",
",",
"np",
".",
"eye",
"(",
"3",
")",
")",
"+",
"np",
".",
"einsum",
"(",
"\"km,ln->klmn\"",
",",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_symmetric_wallace_tensor | Gets the symmetrized wallace tensor for determining
yield strength criteria.
Args:
tau (3x3 array-like): stress at which to evaluate
the wallace tensor. | pymatgen/analysis/elasticity/elastic.py | def get_symmetric_wallace_tensor(self, tau):
"""
Gets the symmetrized wallace tensor for determining
yield strength criteria.
Args:
tau (3x3 array-like): stress at which to evaluate
the wallace tensor.
"""
wallace = self.get_wallace_tensor(tau... | def get_symmetric_wallace_tensor(self, tau):
"""
Gets the symmetrized wallace tensor for determining
yield strength criteria.
Args:
tau (3x3 array-like): stress at which to evaluate
the wallace tensor.
"""
wallace = self.get_wallace_tensor(tau... | [
"Gets",
"the",
"symmetrized",
"wallace",
"tensor",
"for",
"determining",
"yield",
"strength",
"criteria",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L784-L794 | [
"def",
"get_symmetric_wallace_tensor",
"(",
"self",
",",
"tau",
")",
":",
"wallace",
"=",
"self",
".",
"get_wallace_tensor",
"(",
"tau",
")",
"return",
"Tensor",
"(",
"0.5",
"*",
"(",
"wallace",
"+",
"np",
".",
"transpose",
"(",
"wallace",
",",
"[",
"2",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_stability_criteria | Gets the stability criteria from the symmetric
Wallace tensor from an input vector and stress
value.
Args:
s (float): Stress value at which to evaluate
the stability criteria
n (3x1 array-like): direction of the applied
stress | pymatgen/analysis/elasticity/elastic.py | def get_stability_criteria(self, s, n):
"""
Gets the stability criteria from the symmetric
Wallace tensor from an input vector and stress
value.
Args:
s (float): Stress value at which to evaluate
the stability criteria
n (3x1 array-like): ... | def get_stability_criteria(self, s, n):
"""
Gets the stability criteria from the symmetric
Wallace tensor from an input vector and stress
value.
Args:
s (float): Stress value at which to evaluate
the stability criteria
n (3x1 array-like): ... | [
"Gets",
"the",
"stability",
"criteria",
"from",
"the",
"symmetric",
"Wallace",
"tensor",
"from",
"an",
"input",
"vector",
"and",
"stress",
"value",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L796-L811 | [
"def",
"get_stability_criteria",
"(",
"self",
",",
"s",
",",
"n",
")",
":",
"n",
"=",
"get_uvec",
"(",
"n",
")",
"stress",
"=",
"s",
"*",
"np",
".",
"outer",
"(",
"n",
",",
"n",
")",
"sym_wallace",
"=",
"self",
".",
"get_symmetric_wallace_tensor",
"(... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | ElasticTensorExpansion.get_yield_stress | Gets the yield stress for a given direction
Args:
n (3x1 array-like): direction for which to find the
yield stress | pymatgen/analysis/elasticity/elastic.py | def get_yield_stress(self, n):
"""
Gets the yield stress for a given direction
Args:
n (3x1 array-like): direction for which to find the
yield stress
"""
# TODO: root finding could be more robust
comp = root(self.get_stability_criteria, -1, ar... | def get_yield_stress(self, n):
"""
Gets the yield stress for a given direction
Args:
n (3x1 array-like): direction for which to find the
yield stress
"""
# TODO: root finding could be more robust
comp = root(self.get_stability_criteria, -1, ar... | [
"Gets",
"the",
"yield",
"stress",
"for",
"a",
"given",
"direction"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/elasticity/elastic.py#L813-L824 | [
"def",
"get_yield_stress",
"(",
"self",
",",
"n",
")",
":",
"# TODO: root finding could be more robust",
"comp",
"=",
"root",
"(",
"self",
".",
"get_stability_criteria",
",",
"-",
"1",
",",
"args",
"=",
"n",
")",
"tens",
"=",
"root",
"(",
"self",
".",
"get... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | symmetry_measure | Computes the continuous symmetry measure of the (distorted) set of points "points_distorted" with respect to the
(perfect) set of points "points_perfect".
:param points_distorted: List of points describing a given (distorted) polyhedron for which the symmetry measure
has to be compu... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def symmetry_measure(points_distorted, points_perfect):
"""
Computes the continuous symmetry measure of the (distorted) set of points "points_distorted" with respect to the
(perfect) set of points "points_perfect".
:param points_distorted: List of points describing a given (distorted) polyhedron for whi... | def symmetry_measure(points_distorted, points_perfect):
"""
Computes the continuous symmetry measure of the (distorted) set of points "points_distorted" with respect to the
(perfect) set of points "points_perfect".
:param points_distorted: List of points describing a given (distorted) polyhedron for whi... | [
"Computes",
"the",
"continuous",
"symmetry",
"measure",
"of",
"the",
"(",
"distorted",
")",
"set",
"of",
"points",
"points_distorted",
"with",
"respect",
"to",
"the",
"(",
"perfect",
")",
"set",
"of",
"points",
"points_perfect",
".",
":",
"param",
"points_dist... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L232-L257 | [
"def",
"symmetry_measure",
"(",
"points_distorted",
",",
"points_perfect",
")",
":",
"# When there is only one point, the symmetry measure is 0.0 by definition",
"if",
"len",
"(",
"points_distorted",
")",
"==",
"1",
":",
"return",
"{",
"'symmetry_measure'",
":",
"0.0",
",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | find_rotation | This finds the rotation matrix that aligns the (distorted) set of points "points_distorted" with respect to the
(perfect) set of points "points_perfect" in a least-square sense.
:param points_distorted: List of points describing a given (distorted) polyhedron for which the rotation that
... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def find_rotation(points_distorted, points_perfect):
"""
This finds the rotation matrix that aligns the (distorted) set of points "points_distorted" with respect to the
(perfect) set of points "points_perfect" in a least-square sense.
:param points_distorted: List of points describing a given (distorted... | def find_rotation(points_distorted, points_perfect):
"""
This finds the rotation matrix that aligns the (distorted) set of points "points_distorted" with respect to the
(perfect) set of points "points_perfect" in a least-square sense.
:param points_distorted: List of points describing a given (distorted... | [
"This",
"finds",
"the",
"rotation",
"matrix",
"that",
"aligns",
"the",
"(",
"distorted",
")",
"set",
"of",
"points",
"points_distorted",
"with",
"respect",
"to",
"the",
"(",
"perfect",
")",
"set",
"of",
"points",
"points_perfect",
"in",
"a",
"least",
"-",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L260-L272 | [
"def",
"find_rotation",
"(",
"points_distorted",
",",
"points_perfect",
")",
":",
"H",
"=",
"np",
".",
"matmul",
"(",
"points_distorted",
".",
"T",
",",
"points_perfect",
")",
"[",
"U",
",",
"S",
",",
"Vt",
"]",
"=",
"svd",
"(",
"H",
")",
"rot",
"=",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | find_scaling_factor | This finds the scaling factor between the (distorted) set of points "points_distorted" and the
(perfect) set of points "points_perfect" in a least-square sense.
:param points_distorted: List of points describing a given (distorted) polyhedron for which the scaling factor has
to be o... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def find_scaling_factor(points_distorted, points_perfect, rot):
"""
This finds the scaling factor between the (distorted) set of points "points_distorted" and the
(perfect) set of points "points_perfect" in a least-square sense.
:param points_distorted: List of points describing a given (distorted) poly... | def find_scaling_factor(points_distorted, points_perfect, rot):
"""
This finds the scaling factor between the (distorted) set of points "points_distorted" and the
(perfect) set of points "points_perfect" in a least-square sense.
:param points_distorted: List of points describing a given (distorted) poly... | [
"This",
"finds",
"the",
"scaling",
"factor",
"between",
"the",
"(",
"distorted",
")",
"set",
"of",
"points",
"points_distorted",
"and",
"the",
"(",
"perfect",
")",
"set",
"of",
"points",
"points_perfect",
"in",
"a",
"least",
"-",
"square",
"sense",
".",
":... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L275-L288 | [
"def",
"find_scaling_factor",
"(",
"points_distorted",
",",
"points_perfect",
",",
"rot",
")",
":",
"rotated_coords",
"=",
"np",
".",
"matmul",
"(",
"rot",
",",
"points_distorted",
".",
"T",
")",
".",
"T",
"num",
"=",
"np",
".",
"tensordot",
"(",
"rotated_... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_parameters | Setup of the parameters for the coordination geometry finder. A reference point for the geometries has to be
chosen. This can be the centroid of the structure (including or excluding the atom for which the coordination
geometry is looked for) or the atom itself. In the 'standard' centering_type, the ref... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_parameters(self, centering_type='standard',
include_central_site_in_centroid=False,
bva_distance_scale_factor=None,
structure_refinement=STRUCTURE_REFINEMENT_REFINED,
spg_analyzer_options=None):
"""
... | def setup_parameters(self, centering_type='standard',
include_central_site_in_centroid=False,
bva_distance_scale_factor=None,
structure_refinement=STRUCTURE_REFINEMENT_REFINED,
spg_analyzer_options=None):
"""
... | [
"Setup",
"of",
"the",
"parameters",
"for",
"the",
"coordination",
"geometry",
"finder",
".",
"A",
"reference",
"point",
"for",
"the",
"geometries",
"has",
"to",
"be",
"chosen",
".",
"This",
"can",
"be",
"the",
"centroid",
"of",
"the",
"structure",
"(",
"in... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L333-L364 | [
"def",
"setup_parameters",
"(",
"self",
",",
"centering_type",
"=",
"'standard'",
",",
"include_central_site_in_centroid",
"=",
"False",
",",
"bva_distance_scale_factor",
"=",
"None",
",",
"structure_refinement",
"=",
"STRUCTURE_REFINEMENT_REFINED",
",",
"spg_analyzer_optio... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_structure | Sets up the structure for which the coordination geometries have to be identified. The structure is analyzed
with the space group analyzer and a refined structure is used
:param structure: A pymatgen Structure
:param | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_structure(self, structure):
"""
Sets up the structure for which the coordination geometries have to be identified. The structure is analyzed
with the space group analyzer and a refined structure is used
:param structure: A pymatgen Structure
:param
"""
s... | def setup_structure(self, structure):
"""
Sets up the structure for which the coordination geometries have to be identified. The structure is analyzed
with the space group analyzer and a refined structure is used
:param structure: A pymatgen Structure
:param
"""
s... | [
"Sets",
"up",
"the",
"structure",
"for",
"which",
"the",
"coordination",
"geometries",
"have",
"to",
"be",
"identified",
".",
"The",
"structure",
"is",
"analyzed",
"with",
"the",
"space",
"group",
"analyzer",
"and",
"a",
"refined",
"structure",
"is",
"used",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L375-L408 | [
"def",
"setup_structure",
"(",
"self",
",",
"structure",
")",
":",
"self",
".",
"initial_structure",
"=",
"structure",
".",
"copy",
"(",
")",
"if",
"self",
".",
"structure_refinement",
"==",
"self",
".",
"STRUCTURE_REFINEMENT_NONE",
":",
"self",
".",
"structur... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.set_structure | Sets up the pymatgen structure for which the coordination geometries have to be identified starting from the
lattice, the species and the coordinates
:param lattice: The lattice of the structure
:param species: The species on the sites
:param coords: The coordinates of the sites
... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def set_structure(self, lattice, species, coords, coords_are_cartesian):
"""
Sets up the pymatgen structure for which the coordination geometries have to be identified starting from the
lattice, the species and the coordinates
:param lattice: The lattice of the structure
:param s... | def set_structure(self, lattice, species, coords, coords_are_cartesian):
"""
Sets up the pymatgen structure for which the coordination geometries have to be identified starting from the
lattice, the species and the coordinates
:param lattice: The lattice of the structure
:param s... | [
"Sets",
"up",
"the",
"pymatgen",
"structure",
"for",
"which",
"the",
"coordination",
"geometries",
"have",
"to",
"be",
"identified",
"starting",
"from",
"the",
"lattice",
"the",
"species",
"and",
"the",
"coordinates",
":",
"param",
"lattice",
":",
"The",
"latt... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L419-L429 | [
"def",
"set_structure",
"(",
"self",
",",
"lattice",
",",
"species",
",",
"coords",
",",
"coords_are_cartesian",
")",
":",
"self",
".",
"setup_structure",
"(",
"Structure",
"(",
"lattice",
",",
"species",
",",
"coords",
",",
"coords_are_cartesian",
")",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.compute_structure_environments | Computes and returns the StructureEnvironments object containing all the information about the coordination
environments in the structure
:param excluded_atoms: Atoms for which the coordination geometries does not have to be identified
:param only_atoms: If not set to None, atoms for which the c... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def compute_structure_environments(self,
excluded_atoms=None,
only_atoms=None,
only_cations=True,
only_indices=None,
maximum_... | def compute_structure_environments(self,
excluded_atoms=None,
only_atoms=None,
only_cations=True,
only_indices=None,
maximum_... | [
"Computes",
"and",
"returns",
"the",
"StructureEnvironments",
"object",
"containing",
"all",
"the",
"information",
"about",
"the",
"coordination",
"environments",
"in",
"the",
"structure",
":",
"param",
"excluded_atoms",
":",
"Atoms",
"for",
"which",
"the",
"coordin... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L453-L725 | [
"def",
"compute_structure_environments",
"(",
"self",
",",
"excluded_atoms",
"=",
"None",
",",
"only_atoms",
"=",
"None",
",",
"only_cations",
"=",
"True",
",",
"only_indices",
"=",
"None",
",",
"maximum_distance_factor",
"=",
"PRESETS",
"[",
"'DEFAULT'",
"]",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_local_geometry | Sets up the AbstractGeometry for the local geometry of site with index isite.
:param isite: Index of the site for which the local geometry has to be set up
:param coords: The coordinates of the (local) neighbors | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_local_geometry(self, isite, coords, optimization=None):
"""
Sets up the AbstractGeometry for the local geometry of site with index isite.
:param isite: Index of the site for which the local geometry has to be set up
:param coords: The coordinates of the (local) neighbors
... | def setup_local_geometry(self, isite, coords, optimization=None):
"""
Sets up the AbstractGeometry for the local geometry of site with index isite.
:param isite: Index of the site for which the local geometry has to be set up
:param coords: The coordinates of the (local) neighbors
... | [
"Sets",
"up",
"the",
"AbstractGeometry",
"for",
"the",
"local",
"geometry",
"of",
"site",
"with",
"index",
"isite",
".",
":",
"param",
"isite",
":",
"Index",
"of",
"the",
"site",
"for",
"which",
"the",
"local",
"geometry",
"has",
"to",
"be",
"set",
"up",... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L786-L798 | [
"def",
"setup_local_geometry",
"(",
"self",
",",
"isite",
",",
"coords",
",",
"optimization",
"=",
"None",
")",
":",
"self",
".",
"local_geometry",
"=",
"AbstractGeometry",
"(",
"central_site",
"=",
"self",
".",
"structure",
".",
"cart_coords",
"[",
"isite",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_random_structure | Sets up a purely random structure with a given coordination.
:param coordination: coordination number for the random structure | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_random_structure(self, coordination):
"""
Sets up a purely random structure with a given coordination.
:param coordination: coordination number for the random structure
"""
aa = 0.4
bb = -0.2
coords = list()
for ii in range(coordination + 1):
... | def setup_random_structure(self, coordination):
"""
Sets up a purely random structure with a given coordination.
:param coordination: coordination number for the random structure
"""
aa = 0.4
bb = -0.2
coords = list()
for ii in range(coordination + 1):
... | [
"Sets",
"up",
"a",
"purely",
"random",
"structure",
"with",
"a",
"given",
"coordination",
".",
":",
"param",
"coordination",
":",
"coordination",
"number",
"for",
"the",
"random",
"structure"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L912-L927 | [
"def",
"setup_random_structure",
"(",
"self",
",",
"coordination",
")",
":",
"aa",
"=",
"0.4",
"bb",
"=",
"-",
"0.2",
"coords",
"=",
"list",
"(",
")",
"for",
"ii",
"in",
"range",
"(",
"coordination",
"+",
"1",
")",
":",
"coords",
".",
"append",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_random_indices_local_geometry | Sets up random indices for the local geometry, for testing purposes
:param coordination: coordination of the local geometry | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_random_indices_local_geometry(self, coordination):
"""
Sets up random indices for the local geometry, for testing purposes
:param coordination: coordination of the local geometry
"""
self.icentral_site = 0
self.indices = list(range(1, coordination + 1))
... | def setup_random_indices_local_geometry(self, coordination):
"""
Sets up random indices for the local geometry, for testing purposes
:param coordination: coordination of the local geometry
"""
self.icentral_site = 0
self.indices = list(range(1, coordination + 1))
... | [
"Sets",
"up",
"random",
"indices",
"for",
"the",
"local",
"geometry",
"for",
"testing",
"purposes",
":",
"param",
"coordination",
":",
"coordination",
"of",
"the",
"local",
"geometry"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L929-L936 | [
"def",
"setup_random_indices_local_geometry",
"(",
"self",
",",
"coordination",
")",
":",
"self",
".",
"icentral_site",
"=",
"0",
"self",
".",
"indices",
"=",
"list",
"(",
"range",
"(",
"1",
",",
"coordination",
"+",
"1",
")",
")",
"np",
".",
"random",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_ordered_indices_local_geometry | Sets up ordered indices for the local geometry, for testing purposes
:param coordination: coordination of the local geometry | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_ordered_indices_local_geometry(self, coordination):
"""
Sets up ordered indices for the local geometry, for testing purposes
:param coordination: coordination of the local geometry
"""
self.icentral_site = 0
self.indices = list(range(1, coordination + 1)) | def setup_ordered_indices_local_geometry(self, coordination):
"""
Sets up ordered indices for the local geometry, for testing purposes
:param coordination: coordination of the local geometry
"""
self.icentral_site = 0
self.indices = list(range(1, coordination + 1)) | [
"Sets",
"up",
"ordered",
"indices",
"for",
"the",
"local",
"geometry",
"for",
"testing",
"purposes",
":",
"param",
"coordination",
":",
"coordination",
"of",
"the",
"local",
"geometry"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L938-L944 | [
"def",
"setup_ordered_indices_local_geometry",
"(",
"self",
",",
"coordination",
")",
":",
"self",
".",
"icentral_site",
"=",
"0",
"self",
".",
"indices",
"=",
"list",
"(",
"range",
"(",
"1",
",",
"coordination",
"+",
"1",
")",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.setup_explicit_indices_local_geometry | Sets up explicit indices for the local geometry, for testing purposes
:param explicit_indices: explicit indices for the neighbors (set of numbers
from 0 to CN-1 in a given order) | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def setup_explicit_indices_local_geometry(self, explicit_indices):
"""
Sets up explicit indices for the local geometry, for testing purposes
:param explicit_indices: explicit indices for the neighbors (set of numbers
from 0 to CN-1 in a given order)
"""
self.icentral_site... | def setup_explicit_indices_local_geometry(self, explicit_indices):
"""
Sets up explicit indices for the local geometry, for testing purposes
:param explicit_indices: explicit indices for the neighbors (set of numbers
from 0 to CN-1 in a given order)
"""
self.icentral_site... | [
"Sets",
"up",
"explicit",
"indices",
"for",
"the",
"local",
"geometry",
"for",
"testing",
"purposes",
":",
"param",
"explicit_indices",
":",
"explicit",
"indices",
"for",
"the",
"neighbors",
"(",
"set",
"of",
"numbers",
"from",
"0",
"to",
"CN",
"-",
"1",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L946-L953 | [
"def",
"setup_explicit_indices_local_geometry",
"(",
"self",
",",
"explicit_indices",
")",
":",
"self",
".",
"icentral_site",
"=",
"0",
"self",
".",
"indices",
"=",
"[",
"ii",
"+",
"1",
"for",
"ii",
"in",
"explicit_indices",
"]"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.get_coordination_symmetry_measures | Returns the continuous symmetry measures of the current local geometry in a dictionary.
:return: the continuous symmetry measures of the current local geometry in a dictionary. | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def get_coordination_symmetry_measures(self, only_minimum=True,
all_csms=True, optimization=None):
"""
Returns the continuous symmetry measures of the current local geometry in a dictionary.
:return: the continuous symmetry measures of the current local... | def get_coordination_symmetry_measures(self, only_minimum=True,
all_csms=True, optimization=None):
"""
Returns the continuous symmetry measures of the current local geometry in a dictionary.
:return: the continuous symmetry measures of the current local... | [
"Returns",
"the",
"continuous",
"symmetry",
"measures",
"of",
"the",
"current",
"local",
"geometry",
"in",
"a",
"dictionary",
".",
":",
"return",
":",
"the",
"continuous",
"symmetry",
"measures",
"of",
"the",
"current",
"local",
"geometry",
"in",
"a",
"diction... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L955-L1016 | [
"def",
"get_coordination_symmetry_measures",
"(",
"self",
",",
"only_minimum",
"=",
"True",
",",
"all_csms",
"=",
"True",
",",
"optimization",
"=",
"None",
")",
":",
"test_geometries",
"=",
"self",
".",
"allcg",
".",
"get_implemented_geometries",
"(",
"len",
"("... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.get_coordination_symmetry_measures_optim | Returns the continuous symmetry measures of the current local geometry in a dictionary.
:return: the continuous symmetry measures of the current local geometry in a dictionary. | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def get_coordination_symmetry_measures_optim(self, only_minimum=True,
all_csms=True, nb_set=None, optimization=None):
"""
Returns the continuous symmetry measures of the current local geometry in a dictionary.
:return: the continuous symmetry meas... | def get_coordination_symmetry_measures_optim(self, only_minimum=True,
all_csms=True, nb_set=None, optimization=None):
"""
Returns the continuous symmetry measures of the current local geometry in a dictionary.
:return: the continuous symmetry meas... | [
"Returns",
"the",
"continuous",
"symmetry",
"measures",
"of",
"the",
"current",
"local",
"geometry",
"in",
"a",
"dictionary",
".",
":",
"return",
":",
"the",
"continuous",
"symmetry",
"measures",
"of",
"the",
"current",
"local",
"geometry",
"in",
"a",
"diction... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1095-L1145 | [
"def",
"get_coordination_symmetry_measures_optim",
"(",
"self",
",",
"only_minimum",
"=",
"True",
",",
"all_csms",
"=",
"True",
",",
"nb_set",
"=",
"None",
",",
"optimization",
"=",
"None",
")",
":",
"cn",
"=",
"len",
"(",
"self",
".",
"local_geometry",
".",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.coordination_geometry_symmetry_measures | Returns the symmetry measures of a given coordination_geometry for a set of permutations depending on
the permutation setup. Depending on the parameters of the LocalGeometryFinder and on the coordination
geometry, different methods are called.
:param coordination_geometry: Coordination geometry... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def coordination_geometry_symmetry_measures(self, coordination_geometry,
tested_permutations=False,
points_perfect=None,
optimization=None):
"""
Returns the sym... | def coordination_geometry_symmetry_measures(self, coordination_geometry,
tested_permutations=False,
points_perfect=None,
optimization=None):
"""
Returns the sym... | [
"Returns",
"the",
"symmetry",
"measures",
"of",
"a",
"given",
"coordination_geometry",
"for",
"a",
"set",
"of",
"permutations",
"depending",
"on",
"the",
"permutation",
"setup",
".",
"Depending",
"on",
"the",
"parameters",
"of",
"the",
"LocalGeometryFinder",
"and"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1147-L1187 | [
"def",
"coordination_geometry_symmetry_measures",
"(",
"self",
",",
"coordination_geometry",
",",
"tested_permutations",
"=",
"False",
",",
"points_perfect",
"=",
"None",
",",
"optimization",
"=",
"None",
")",
":",
"if",
"tested_permutations",
":",
"tested_permutations"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.coordination_geometry_symmetry_measures_sepplane_optim | Returns the symmetry measures of a given coordination_geometry for a set of permutations depending on
the permutation setup. Depending on the parameters of the LocalGeometryFinder and on the coordination
geometry, different methods are called.
:param coordination_geometry: Coordination geometry... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def coordination_geometry_symmetry_measures_sepplane_optim(self, coordination_geometry,
points_perfect=None,
nb_set=None, optimization=None):
"""
Returns the symmetry measures of... | def coordination_geometry_symmetry_measures_sepplane_optim(self, coordination_geometry,
points_perfect=None,
nb_set=None, optimization=None):
"""
Returns the symmetry measures of... | [
"Returns",
"the",
"symmetry",
"measures",
"of",
"a",
"given",
"coordination_geometry",
"for",
"a",
"set",
"of",
"permutations",
"depending",
"on",
"the",
"permutation",
"setup",
".",
"Depending",
"on",
"the",
"parameters",
"of",
"the",
"LocalGeometryFinder",
"and"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1189-L1220 | [
"def",
"coordination_geometry_symmetry_measures_sepplane_optim",
"(",
"self",
",",
"coordination_geometry",
",",
"points_perfect",
"=",
"None",
",",
"nb_set",
"=",
"None",
",",
"optimization",
"=",
"None",
")",
":",
"csms",
"=",
"[",
"]",
"permutations",
"=",
"[",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.coordination_geometry_symmetry_measures_standard | Returns the symmetry measures for a set of permutations (whose setup depends on the coordination geometry)
for the coordination geometry "coordination_geometry". Standard implementation looking for the symmetry
measures of each permutation
:param coordination_geometry: The coordination geometry... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def coordination_geometry_symmetry_measures_standard(self,
coordination_geometry,
algo,
points_perfect=None,
... | def coordination_geometry_symmetry_measures_standard(self,
coordination_geometry,
algo,
points_perfect=None,
... | [
"Returns",
"the",
"symmetry",
"measures",
"for",
"a",
"set",
"of",
"permutations",
"(",
"whose",
"setup",
"depends",
"on",
"the",
"coordination",
"geometry",
")",
"for",
"the",
"coordination",
"geometry",
"coordination_geometry",
".",
"Standard",
"implementation",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1222-L1290 | [
"def",
"coordination_geometry_symmetry_measures_standard",
"(",
"self",
",",
"coordination_geometry",
",",
"algo",
",",
"points_perfect",
"=",
"None",
",",
"optimization",
"=",
"None",
")",
":",
"# permutations_symmetry_measures = np.zeros(len(algo.permutations),",
"# ... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.coordination_geometry_symmetry_measures_separation_plane | Returns the symmetry measures of the given coordination geometry "coordination_geometry" using separation
facets to reduce the complexity of the system. Caller to the refined 2POINTS, 3POINTS and other ...
:param coordination_geometry: The coordination geometry to be investigated
:return: The sy... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def coordination_geometry_symmetry_measures_separation_plane(self,
coordination_geometry,
separation_plane_algo,
testing=Fals... | def coordination_geometry_symmetry_measures_separation_plane(self,
coordination_geometry,
separation_plane_algo,
testing=Fals... | [
"Returns",
"the",
"symmetry",
"measures",
"of",
"the",
"given",
"coordination",
"geometry",
"coordination_geometry",
"using",
"separation",
"facets",
"to",
"reduce",
"the",
"complexity",
"of",
"the",
"system",
".",
"Caller",
"to",
"the",
"refined",
"2POINTS",
"3PO... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1292-L1374 | [
"def",
"coordination_geometry_symmetry_measures_separation_plane",
"(",
"self",
",",
"coordination_geometry",
",",
"separation_plane_algo",
",",
"testing",
"=",
"False",
",",
"tested_permutations",
"=",
"False",
",",
"points_perfect",
"=",
"None",
")",
":",
"permutations"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.coordination_geometry_symmetry_measures_separation_plane_optim | Returns the symmetry measures of the given coordination geometry "coordination_geometry" using separation
facets to reduce the complexity of the system. Caller to the refined 2POINTS, 3POINTS and other ...
:param coordination_geometry: The coordination geometry to be investigated
:return: The sy... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def coordination_geometry_symmetry_measures_separation_plane_optim(self,
coordination_geometry,
separation_plane_algo,
... | def coordination_geometry_symmetry_measures_separation_plane_optim(self,
coordination_geometry,
separation_plane_algo,
... | [
"Returns",
"the",
"symmetry",
"measures",
"of",
"the",
"given",
"coordination",
"geometry",
"coordination_geometry",
"using",
"separation",
"facets",
"to",
"reduce",
"the",
"complexity",
"of",
"the",
"system",
".",
"Caller",
"to",
"the",
"refined",
"2POINTS",
"3PO... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1376-L1504 | [
"def",
"coordination_geometry_symmetry_measures_separation_plane_optim",
"(",
"self",
",",
"coordination_geometry",
",",
"separation_plane_algo",
",",
"points_perfect",
"=",
"None",
",",
"nb_set",
"=",
"None",
",",
"optimization",
"=",
"None",
")",
":",
"if",
"optimizat... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | LocalGeometryFinder.coordination_geometry_symmetry_measures_fallback_random | Returns the symmetry measures for a random set of permutations for the coordination geometry
"coordination_geometry". Fallback implementation for the plane separation algorithms measures
of each permutation
:param coordination_geometry: The coordination geometry to be investigated
:para... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py | def coordination_geometry_symmetry_measures_fallback_random(self,
coordination_geometry,
NRANDOM=10,
points_perfect=None):
... | def coordination_geometry_symmetry_measures_fallback_random(self,
coordination_geometry,
NRANDOM=10,
points_perfect=None):
... | [
"Returns",
"the",
"symmetry",
"measures",
"for",
"a",
"random",
"set",
"of",
"permutations",
"for",
"the",
"coordination",
"geometry",
"coordination_geometry",
".",
"Fallback",
"implementation",
"for",
"the",
"plane",
"separation",
"algorithms",
"measures",
"of",
"e... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py#L1759-L1797 | [
"def",
"coordination_geometry_symmetry_measures_fallback_random",
"(",
"self",
",",
"coordination_geometry",
",",
"NRANDOM",
"=",
"10",
",",
"points_perfect",
"=",
"None",
")",
":",
"permutations_symmetry_measures",
"=",
"[",
"None",
"]",
"*",
"NRANDOM",
"permutations",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_fermi_surface | Plot the Fermi surface at specific energy value.
Args:
data: energy values in a 3D grid from a CUBE file
via read_cube_file function, or from a
BoltztrapAnalyzer.fermi_surface_data
structure: structure object of the material
energy_levels: list of energy value ... | pymatgen/electronic_structure/plotter.py | def plot_fermi_surface(data, structure, cbm, energy_levels=[],
multiple_figure=True,
mlab_figure=None, kpoints_dict={}, color=(0, 0, 1),
transparency_factor=[], labels_scale_factor=0.05,
points_scale_factor=0.02, interative=True... | def plot_fermi_surface(data, structure, cbm, energy_levels=[],
multiple_figure=True,
mlab_figure=None, kpoints_dict={}, color=(0, 0, 1),
transparency_factor=[], labels_scale_factor=0.05,
points_scale_factor=0.02, interative=True... | [
"Plot",
"the",
"Fermi",
"surface",
"at",
"specific",
"energy",
"value",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L3678-L3814 | [
"def",
"plot_fermi_surface",
"(",
"data",
",",
"structure",
",",
"cbm",
",",
"energy_levels",
"=",
"[",
"]",
",",
"multiple_figure",
"=",
"True",
",",
"mlab_figure",
"=",
"None",
",",
"kpoints_dict",
"=",
"{",
"}",
",",
"color",
"=",
"(",
"0",
",",
"0"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_wigner_seitz | Adds the skeleton of the Wigner-Seitz cell of the lattice to a matplotlib Axes
Args:
lattice: Lattice object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
kwargs: kwargs passed to the matplotlib function 'plot'. Color defaults to black
and linewidth to ... | pymatgen/electronic_structure/plotter.py | def plot_wigner_seitz(lattice, ax=None, **kwargs):
"""
Adds the skeleton of the Wigner-Seitz cell of the lattice to a matplotlib Axes
Args:
lattice: Lattice object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
kwargs: kwargs passed to the matplotlib functio... | def plot_wigner_seitz(lattice, ax=None, **kwargs):
"""
Adds the skeleton of the Wigner-Seitz cell of the lattice to a matplotlib Axes
Args:
lattice: Lattice object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
kwargs: kwargs passed to the matplotlib functio... | [
"Adds",
"the",
"skeleton",
"of",
"the",
"Wigner",
"-",
"Seitz",
"cell",
"of",
"the",
"lattice",
"to",
"a",
"matplotlib",
"Axes"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L3817-L3847 | [
"def",
"plot_wigner_seitz",
"(",
"lattice",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax3d_fig_plt",
"(",
"ax",
")",
"if",
"\"color\"",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"\"color\"",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_lattice_vectors | Adds the basis vectors of the lattice provided to a matplotlib Axes
Args:
lattice: Lattice object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
kwargs: kwargs passed to the matplotlib function 'plot'. Color defaults to green
and linewidth to 3.
Ret... | pymatgen/electronic_structure/plotter.py | def plot_lattice_vectors(lattice, ax=None, **kwargs):
"""
Adds the basis vectors of the lattice provided to a matplotlib Axes
Args:
lattice: Lattice object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
kwargs: kwargs passed to the matplotlib function 'plot'... | def plot_lattice_vectors(lattice, ax=None, **kwargs):
"""
Adds the basis vectors of the lattice provided to a matplotlib Axes
Args:
lattice: Lattice object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
kwargs: kwargs passed to the matplotlib function 'plot'... | [
"Adds",
"the",
"basis",
"vectors",
"of",
"the",
"lattice",
"provided",
"to",
"a",
"matplotlib",
"Axes"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L3850-L3878 | [
"def",
"plot_lattice_vectors",
"(",
"lattice",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax3d_fig_plt",
"(",
"ax",
")",
"if",
"\"color\"",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"\"color\"",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_path | Adds a line passing through the coordinates listed in 'line' to a matplotlib Axes
Args:
line: list of coordinates.
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartesian: Set to True if you are providing
coordinates in cartesian coo... | pymatgen/electronic_structure/plotter.py | def plot_path(line, lattice=None, coords_are_cartesian=False, ax=None,
**kwargs):
"""
Adds a line passing through the coordinates listed in 'line' to a matplotlib Axes
Args:
line: list of coordinates.
lattice: Lattice object used to convert from reciprocal to cartesian coordin... | def plot_path(line, lattice=None, coords_are_cartesian=False, ax=None,
**kwargs):
"""
Adds a line passing through the coordinates listed in 'line' to a matplotlib Axes
Args:
line: list of coordinates.
lattice: Lattice object used to convert from reciprocal to cartesian coordin... | [
"Adds",
"a",
"line",
"passing",
"through",
"the",
"coordinates",
"listed",
"in",
"line",
"to",
"a",
"matplotlib",
"Axes"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L3881-L3918 | [
"def",
"plot_path",
"(",
"line",
",",
"lattice",
"=",
"None",
",",
"coords_are_cartesian",
"=",
"False",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax3d_fig_plt",
"(",
"ax",
")",
"if",
"\"color\... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_labels | Adds labels to a matplotlib Axes
Args:
labels: dict containing the label as a key and the coordinates as value.
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartesian: Set to True if you are providing.
coordinates in cartesian coord... | pymatgen/electronic_structure/plotter.py | def plot_labels(labels, lattice=None, coords_are_cartesian=False, ax=None,
**kwargs):
"""
Adds labels to a matplotlib Axes
Args:
labels: dict containing the label as a key and the coordinates as value.
lattice: Lattice object used to convert from reciprocal to cartesian coor... | def plot_labels(labels, lattice=None, coords_are_cartesian=False, ax=None,
**kwargs):
"""
Adds labels to a matplotlib Axes
Args:
labels: dict containing the label as a key and the coordinates as value.
lattice: Lattice object used to convert from reciprocal to cartesian coor... | [
"Adds",
"labels",
"to",
"a",
"matplotlib",
"Axes"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L3921-L3960 | [
"def",
"plot_labels",
"(",
"labels",
",",
"lattice",
"=",
"None",
",",
"coords_are_cartesian",
"=",
"False",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax3d_fig_plt",
"(",
"ax",
")",
"if",
"\"co... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | fold_point | Folds a point with coordinates p inside the first Brillouin zone of the lattice.
Args:
p: coordinates of one point
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartesian: Set to True if you are providing
coordinates in cartesian coo... | pymatgen/electronic_structure/plotter.py | def fold_point(p, lattice, coords_are_cartesian=False):
"""
Folds a point with coordinates p inside the first Brillouin zone of the lattice.
Args:
p: coordinates of one point
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartesian: Set t... | def fold_point(p, lattice, coords_are_cartesian=False):
"""
Folds a point with coordinates p inside the first Brillouin zone of the lattice.
Args:
p: coordinates of one point
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartesian: Set t... | [
"Folds",
"a",
"point",
"with",
"coordinates",
"p",
"inside",
"the",
"first",
"Brillouin",
"zone",
"of",
"the",
"lattice",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L3963-L3999 | [
"def",
"fold_point",
"(",
"p",
",",
"lattice",
",",
"coords_are_cartesian",
"=",
"False",
")",
":",
"if",
"coords_are_cartesian",
":",
"p",
"=",
"lattice",
".",
"get_fractional_coords",
"(",
"p",
")",
"else",
":",
"p",
"=",
"np",
".",
"array",
"(",
"p",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_points | Adds Points to a matplotlib Axes
Args:
points: list of coordinates
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartesian: Set to True if you are providing
coordinates in cartesian coordinates. Defaults to False.
Require... | pymatgen/electronic_structure/plotter.py | def plot_points(points, lattice=None, coords_are_cartesian=False, fold=False,
ax=None, **kwargs):
"""
Adds Points to a matplotlib Axes
Args:
points: list of coordinates
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartes... | def plot_points(points, lattice=None, coords_are_cartesian=False, fold=False,
ax=None, **kwargs):
"""
Adds Points to a matplotlib Axes
Args:
points: list of coordinates
lattice: Lattice object used to convert from reciprocal to cartesian coordinates
coords_are_cartes... | [
"Adds",
"Points",
"to",
"a",
"matplotlib",
"Axes"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L4002-L4041 | [
"def",
"plot_points",
"(",
"points",
",",
"lattice",
"=",
"None",
",",
"coords_are_cartesian",
"=",
"False",
",",
"fold",
"=",
"False",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax3d_fig_plt",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_brillouin_zone_from_kpath | Gives the plot (as a matplotlib object) of the symmetry line path in
the Brillouin Zone.
Args:
kpath (HighSymmKpath): a HighSymmKPath object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
**kwargs: provided by add_fig_kwargs decorator
Returns:
m... | pymatgen/electronic_structure/plotter.py | def plot_brillouin_zone_from_kpath(kpath, ax=None, **kwargs):
"""
Gives the plot (as a matplotlib object) of the symmetry line path in
the Brillouin Zone.
Args:
kpath (HighSymmKpath): a HighSymmKPath object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
... | def plot_brillouin_zone_from_kpath(kpath, ax=None, **kwargs):
"""
Gives the plot (as a matplotlib object) of the symmetry line path in
the Brillouin Zone.
Args:
kpath (HighSymmKpath): a HighSymmKPath object
ax: matplotlib :class:`Axes` or None if a new figure should be created.
... | [
"Gives",
"the",
"plot",
"(",
"as",
"a",
"matplotlib",
"object",
")",
"of",
"the",
"symmetry",
"line",
"path",
"in",
"the",
"Brillouin",
"Zone",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L4045-L4062 | [
"def",
"plot_brillouin_zone_from_kpath",
"(",
"kpath",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"lines",
"=",
"[",
"[",
"kpath",
".",
"kpath",
"[",
"'kpoints'",
"]",
"[",
"k",
"]",
"for",
"k",
"in",
"p",
"]",
"for",
"p",
"in",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_brillouin_zone | Plots a 3D representation of the Brillouin zone of the structure.
Can add to the plot paths, labels and kpoints
Args:
bz_lattice: Lattice object of the Brillouin zone
lines: list of lists of coordinates. Each list represent a different path
labels: dict containing the label as a key and... | pymatgen/electronic_structure/plotter.py | def plot_brillouin_zone(bz_lattice, lines=None, labels=None, kpoints=None,
fold=False, coords_are_cartesian=False,
ax=None, **kwargs):
"""
Plots a 3D representation of the Brillouin zone of the structure.
Can add to the plot paths, labels and kpoints
Args... | def plot_brillouin_zone(bz_lattice, lines=None, labels=None, kpoints=None,
fold=False, coords_are_cartesian=False,
ax=None, **kwargs):
"""
Plots a 3D representation of the Brillouin zone of the structure.
Can add to the plot paths, labels and kpoints
Args... | [
"Plots",
"a",
"3D",
"representation",
"of",
"the",
"Brillouin",
"zone",
"of",
"the",
"structure",
".",
"Can",
"add",
"to",
"the",
"plot",
"paths",
"labels",
"and",
"kpoints"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L4066-L4115 | [
"def",
"plot_brillouin_zone",
"(",
"bz_lattice",
",",
"lines",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"kpoints",
"=",
"None",
",",
"fold",
"=",
"False",
",",
"coords_are_cartesian",
"=",
"False",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | plot_ellipsoid | Plots a 3D ellipsoid rappresenting the Hessian matrix in input.
Useful to get a graphical visualization of the effective mass
of a band in a single k-point.
Args:
hessian: the Hessian matrix
center: the center of the ellipsoid in reciprocal coords (Default)
lattice: Lattice obje... | pymatgen/electronic_structure/plotter.py | def plot_ellipsoid(hessian, center, lattice=None, rescale=1.0, ax=None,
coords_are_cartesian=False, arrows=False, **kwargs):
"""
Plots a 3D ellipsoid rappresenting the Hessian matrix in input.
Useful to get a graphical visualization of the effective mass
of a band in a single k-point.... | def plot_ellipsoid(hessian, center, lattice=None, rescale=1.0, ax=None,
coords_are_cartesian=False, arrows=False, **kwargs):
"""
Plots a 3D ellipsoid rappresenting the Hessian matrix in input.
Useful to get a graphical visualization of the effective mass
of a band in a single k-point.... | [
"Plots",
"a",
"3D",
"ellipsoid",
"rappresenting",
"the",
"Hessian",
"matrix",
"in",
"input",
".",
"Useful",
"to",
"get",
"a",
"graphical",
"visualization",
"of",
"the",
"effective",
"mass",
"of",
"a",
"band",
"in",
"a",
"single",
"k",
"-",
"point",
".",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L4118-L4190 | [
"def",
"plot_ellipsoid",
"(",
"hessian",
",",
"center",
",",
"lattice",
"=",
"None",
",",
"rescale",
"=",
"1.0",
",",
"ax",
"=",
"None",
",",
"coords_are_cartesian",
"=",
"False",
",",
"arrows",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | DosPlotter.add_dos | Adds a dos for plotting.
Args:
label:
label for the DOS. Must be unique.
dos:
Dos object | pymatgen/electronic_structure/plotter.py | def add_dos(self, label, dos):
"""
Adds a dos for plotting.
Args:
label:
label for the DOS. Must be unique.
dos:
Dos object
"""
energies = dos.energies - dos.efermi if self.zero_at_efermi \
else dos.energies
... | def add_dos(self, label, dos):
"""
Adds a dos for plotting.
Args:
label:
label for the DOS. Must be unique.
dos:
Dos object
"""
energies = dos.energies - dos.efermi if self.zero_at_efermi \
else dos.energies
... | [
"Adds",
"a",
"dos",
"for",
"plotting",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L74-L90 | [
"def",
"add_dos",
"(",
"self",
",",
"label",
",",
"dos",
")",
":",
"energies",
"=",
"dos",
".",
"energies",
"-",
"dos",
".",
"efermi",
"if",
"self",
".",
"zero_at_efermi",
"else",
"dos",
".",
"energies",
"densities",
"=",
"dos",
".",
"get_smeared_densiti... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | DosPlotter.get_plot | Get a matplotlib plot showing the DOS.
Args:
xlim: Specifies the x-axis limits. Set to None for automatic
determination.
ylim: Specifies the y-axis limits. | pymatgen/electronic_structure/plotter.py | def get_plot(self, xlim=None, ylim=None):
"""
Get a matplotlib plot showing the DOS.
Args:
xlim: Specifies the x-axis limits. Set to None for automatic
determination.
ylim: Specifies the y-axis limits.
"""
ncolors = max(3, len(self._doses... | def get_plot(self, xlim=None, ylim=None):
"""
Get a matplotlib plot showing the DOS.
Args:
xlim: Specifies the x-axis limits. Set to None for automatic
determination.
ylim: Specifies the y-axis limits.
"""
ncolors = max(3, len(self._doses... | [
"Get",
"a",
"matplotlib",
"plot",
"showing",
"the",
"DOS",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L120-L214 | [
"def",
"get_plot",
"(",
"self",
",",
"xlim",
"=",
"None",
",",
"ylim",
"=",
"None",
")",
":",
"ncolors",
"=",
"max",
"(",
"3",
",",
"len",
"(",
"self",
".",
"_doses",
")",
")",
"ncolors",
"=",
"min",
"(",
"9",
",",
"ncolors",
")",
"import",
"pa... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotter.bs_plot_data | Get the data nicely formatted for a plot
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from the
eigenvalues and plot.
Returns:
dict: A dictionary of the following format:
ticks: A dict with the 'distances' at which there is a kpoi... | pymatgen/electronic_structure/plotter.py | def bs_plot_data(self, zero_to_efermi=True):
"""
Get the data nicely formatted for a plot
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from the
eigenvalues and plot.
Returns:
dict: A dictionary of the following format:
... | def bs_plot_data(self, zero_to_efermi=True):
"""
Get the data nicely formatted for a plot
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from the
eigenvalues and plot.
Returns:
dict: A dictionary of the following format:
... | [
"Get",
"the",
"data",
"nicely",
"formatted",
"for",
"a",
"plot"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L310-L399 | [
"def",
"bs_plot_data",
"(",
"self",
",",
"zero_to_efermi",
"=",
"True",
")",
":",
"distance",
"=",
"[",
"]",
"energy",
"=",
"[",
"]",
"if",
"self",
".",
"_bs",
".",
"is_metal",
"(",
")",
":",
"zero_energy",
"=",
"self",
".",
"_bs",
".",
"efermi",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotter.get_plot | Get a matplotlib object for the bandstructure plot.
Blue lines are up spin, red lines are down
spin.
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from
the eigenvalues and plot (E-Ef).
ylim: Specify the y-axis (energy) limits; by defau... | pymatgen/electronic_structure/plotter.py | def get_plot(self, zero_to_efermi=True, ylim=None, smooth=False,
vbm_cbm_marker=False, smooth_tol=None):
"""
Get a matplotlib object for the bandstructure plot.
Blue lines are up spin, red lines are down
spin.
Args:
zero_to_efermi: Automatically subt... | def get_plot(self, zero_to_efermi=True, ylim=None, smooth=False,
vbm_cbm_marker=False, smooth_tol=None):
"""
Get a matplotlib object for the bandstructure plot.
Blue lines are up spin, red lines are down
spin.
Args:
zero_to_efermi: Automatically subt... | [
"Get",
"a",
"matplotlib",
"object",
"for",
"the",
"bandstructure",
"plot",
".",
"Blue",
"lines",
"are",
"up",
"spin",
"red",
"lines",
"are",
"down",
"spin",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L401-L556 | [
"def",
"get_plot",
"(",
"self",
",",
"zero_to_efermi",
"=",
"True",
",",
"ylim",
"=",
"None",
",",
"smooth",
"=",
"False",
",",
"vbm_cbm_marker",
"=",
"False",
",",
"smooth_tol",
"=",
"None",
")",
":",
"plt",
"=",
"pretty_plot",
"(",
"12",
",",
"8",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotter.show | Show the plot using matplotlib.
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from
the eigenvalues and plot (E-Ef).
ylim: Specify the y-axis (energy) limits; by default None let
the code choose. It is vbm-4 and cbm+4 if insulator
... | pymatgen/electronic_structure/plotter.py | def show(self, zero_to_efermi=True, ylim=None, smooth=False,
smooth_tol=None):
"""
Show the plot using matplotlib.
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from
the eigenvalues and plot (E-Ef).
ylim: Specify the y-axi... | def show(self, zero_to_efermi=True, ylim=None, smooth=False,
smooth_tol=None):
"""
Show the plot using matplotlib.
Args:
zero_to_efermi: Automatically subtract off the Fermi energy from
the eigenvalues and plot (E-Ef).
ylim: Specify the y-axi... | [
"Show",
"the",
"plot",
"using",
"matplotlib",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L558-L574 | [
"def",
"show",
"(",
"self",
",",
"zero_to_efermi",
"=",
"True",
",",
"ylim",
"=",
"None",
",",
"smooth",
"=",
"False",
",",
"smooth_tol",
"=",
"None",
")",
":",
"plt",
"=",
"self",
".",
"get_plot",
"(",
"zero_to_efermi",
",",
"ylim",
",",
"smooth",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotter.save_plot | Save matplotlib plot to a file.
Args:
filename: Filename to write to.
img_format: Image format to use. Defaults to EPS.
ylim: Specifies the y-axis limits. | pymatgen/electronic_structure/plotter.py | def save_plot(self, filename, img_format="eps", ylim=None,
zero_to_efermi=True, smooth=False):
"""
Save matplotlib plot to a file.
Args:
filename: Filename to write to.
img_format: Image format to use. Defaults to EPS.
ylim: Specifies the y-... | def save_plot(self, filename, img_format="eps", ylim=None,
zero_to_efermi=True, smooth=False):
"""
Save matplotlib plot to a file.
Args:
filename: Filename to write to.
img_format: Image format to use. Defaults to EPS.
ylim: Specifies the y-... | [
"Save",
"matplotlib",
"plot",
"to",
"a",
"file",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L576-L589 | [
"def",
"save_plot",
"(",
"self",
",",
"filename",
",",
"img_format",
"=",
"\"eps\"",
",",
"ylim",
"=",
"None",
",",
"zero_to_efermi",
"=",
"True",
",",
"smooth",
"=",
"False",
")",
":",
"plt",
"=",
"self",
".",
"get_plot",
"(",
"ylim",
"=",
"ylim",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotter.plot_compare | plot two band structure for comparison. One is in red the other in blue
(no difference in spins). The two band structures need to be defined
on the same symmetry lines! and the distance between symmetry lines is
the one of the band structure used to build the BSPlotter
Args:
... | pymatgen/electronic_structure/plotter.py | def plot_compare(self, other_plotter, legend=True):
"""
plot two band structure for comparison. One is in red the other in blue
(no difference in spins). The two band structures need to be defined
on the same symmetry lines! and the distance between symmetry lines is
the one of t... | def plot_compare(self, other_plotter, legend=True):
"""
plot two band structure for comparison. One is in red the other in blue
(no difference in spins). The two band structures need to be defined
on the same symmetry lines! and the distance between symmetry lines is
the one of t... | [
"plot",
"two",
"band",
"structure",
"for",
"comparison",
".",
"One",
"is",
"in",
"red",
"the",
"other",
"in",
"blue",
"(",
"no",
"difference",
"in",
"spins",
")",
".",
"The",
"two",
"band",
"structures",
"need",
"to",
"be",
"defined",
"on",
"the",
"sam... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L632-L674 | [
"def",
"plot_compare",
"(",
"self",
",",
"other_plotter",
",",
"legend",
"=",
"True",
")",
":",
"# TODO: add exception if the band structures are not compatible",
"import",
"matplotlib",
".",
"lines",
"as",
"mlines",
"plt",
"=",
"self",
".",
"get_plot",
"(",
")",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotter.plot_brillouin | plot the Brillouin zone | pymatgen/electronic_structure/plotter.py | def plot_brillouin(self):
"""
plot the Brillouin zone
"""
# get labels and lines
labels = {}
for k in self._bs.kpoints:
if k.label:
labels[k.label] = k.frac_coords
lines = []
for b in self._bs.branches:
lines.appen... | def plot_brillouin(self):
"""
plot the Brillouin zone
"""
# get labels and lines
labels = {}
for k in self._bs.kpoints:
if k.label:
labels[k.label] = k.frac_coords
lines = []
for b in self._bs.branches:
lines.appen... | [
"plot",
"the",
"Brillouin",
"zone"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L676-L692 | [
"def",
"plot_brillouin",
"(",
"self",
")",
":",
"# get labels and lines",
"labels",
"=",
"{",
"}",
"for",
"k",
"in",
"self",
".",
"_bs",
".",
"kpoints",
":",
"if",
"k",
".",
"label",
":",
"labels",
"[",
"k",
".",
"label",
"]",
"=",
"k",
".",
"frac_... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotterProjected.get_projected_plots_dots | Method returning a plot composed of subplots along different elements
and orbitals.
Args:
dictio: The element and orbitals you want a projection on. The
format is {Element:[Orbitals]} for instance
{'Cu':['d','s'],'O':['p']} will give projections for Cu on
... | pymatgen/electronic_structure/plotter.py | def get_projected_plots_dots(self, dictio, zero_to_efermi=True, ylim=None,
vbm_cbm_marker=False):
"""
Method returning a plot composed of subplots along different elements
and orbitals.
Args:
dictio: The element and orbitals you want a projec... | def get_projected_plots_dots(self, dictio, zero_to_efermi=True, ylim=None,
vbm_cbm_marker=False):
"""
Method returning a plot composed of subplots along different elements
and orbitals.
Args:
dictio: The element and orbitals you want a projec... | [
"Method",
"returning",
"a",
"plot",
"composed",
"of",
"subplots",
"along",
"different",
"elements",
"and",
"orbitals",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L738-L828 | [
"def",
"get_projected_plots_dots",
"(",
"self",
",",
"dictio",
",",
"zero_to_efermi",
"=",
"True",
",",
"ylim",
"=",
"None",
",",
"vbm_cbm_marker",
"=",
"False",
")",
":",
"band_linewidth",
"=",
"1.0",
"fig_number",
"=",
"sum",
"(",
"[",
"len",
"(",
"v",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotterProjected.get_elt_projected_plots | Method returning a plot composed of subplots along different elements
Returns:
a pylab object with different subfigures for each projection
The blue and red colors are for spin up and spin down
The bigger the red or blue dot in the band structure the higher
chara... | pymatgen/electronic_structure/plotter.py | def get_elt_projected_plots(self, zero_to_efermi=True, ylim=None,
vbm_cbm_marker=False):
"""
Method returning a plot composed of subplots along different elements
Returns:
a pylab object with different subfigures for each projection
The bl... | def get_elt_projected_plots(self, zero_to_efermi=True, ylim=None,
vbm_cbm_marker=False):
"""
Method returning a plot composed of subplots along different elements
Returns:
a pylab object with different subfigures for each projection
The bl... | [
"Method",
"returning",
"a",
"plot",
"composed",
"of",
"subplots",
"along",
"different",
"elements"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L830-L915 | [
"def",
"get_elt_projected_plots",
"(",
"self",
",",
"zero_to_efermi",
"=",
"True",
",",
"ylim",
"=",
"None",
",",
"vbm_cbm_marker",
"=",
"False",
")",
":",
"band_linewidth",
"=",
"1.0",
"proj",
"=",
"self",
".",
"_get_projections_by_branches",
"(",
"{",
"e",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotterProjected.get_elt_projected_plots_color | returns a pylab plot object with one plot where the band structure
line color depends on the character of the band (along different
elements). Each element is associated with red, green or blue
and the corresponding rgb color depending on the character of the band
is used. The method can... | pymatgen/electronic_structure/plotter.py | def get_elt_projected_plots_color(self, zero_to_efermi=True,
elt_ordered=None):
"""
returns a pylab plot object with one plot where the band structure
line color depends on the character of the band (along different
elements). Each element is associa... | def get_elt_projected_plots_color(self, zero_to_efermi=True,
elt_ordered=None):
"""
returns a pylab plot object with one plot where the band structure
line color depends on the character of the band (along different
elements). Each element is associa... | [
"returns",
"a",
"pylab",
"plot",
"object",
"with",
"one",
"plot",
"where",
"the",
"band",
"structure",
"line",
"color",
"depends",
"on",
"the",
"character",
"of",
"the",
"band",
"(",
"along",
"different",
"elements",
")",
".",
"Each",
"element",
"is",
"ass... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L917-L990 | [
"def",
"get_elt_projected_plots_color",
"(",
"self",
",",
"zero_to_efermi",
"=",
"True",
",",
"elt_ordered",
"=",
"None",
")",
":",
"band_linewidth",
"=",
"3.0",
"if",
"len",
"(",
"self",
".",
"_bs",
".",
"structure",
".",
"composition",
".",
"elements",
")"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotterProjected.get_projected_plots_dots_patom_pmorb | Method returns a plot composed of subplots for different atoms and
orbitals (subshell orbitals such as 's', 'p', 'd' and 'f' defined by
azimuthal quantum numbers l = 0, 1, 2 and 3, respectively or
individual orbitals like 'px', 'py' and 'pz' defined by magnetic
quantum numbers m = -1, 1 ... | pymatgen/electronic_structure/plotter.py | def get_projected_plots_dots_patom_pmorb(self, dictio, dictpa,
sum_atoms=None, sum_morbs=None,
zero_to_efermi=True, ylim=None,
vbm_cbm_marker=False,
... | def get_projected_plots_dots_patom_pmorb(self, dictio, dictpa,
sum_atoms=None, sum_morbs=None,
zero_to_efermi=True, ylim=None,
vbm_cbm_marker=False,
... | [
"Method",
"returns",
"a",
"plot",
"composed",
"of",
"subplots",
"for",
"different",
"atoms",
"and",
"orbitals",
"(",
"subshell",
"orbitals",
"such",
"as",
"s",
"p",
"d",
"and",
"f",
"defined",
"by",
"azimuthal",
"quantum",
"numbers",
"l",
"=",
"0",
"1",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L1338-L1536 | [
"def",
"get_projected_plots_dots_patom_pmorb",
"(",
"self",
",",
"dictio",
",",
"dictpa",
",",
"sum_atoms",
"=",
"None",
",",
"sum_morbs",
"=",
"None",
",",
"zero_to_efermi",
"=",
"True",
",",
"ylim",
"=",
"None",
",",
"vbm_cbm_marker",
"=",
"False",
",",
"s... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSPlotterProjected._maketicks_selected | utility private method to add ticks to a band structure with selected branches | pymatgen/electronic_structure/plotter.py | def _maketicks_selected(self, plt, branches):
"""
utility private method to add ticks to a band structure with selected branches
"""
ticks = self.get_ticks()
distance = []
label = []
rm_elems = []
for i in range(1, len(ticks['distance'])):
if t... | def _maketicks_selected(self, plt, branches):
"""
utility private method to add ticks to a band structure with selected branches
"""
ticks = self.get_ticks()
distance = []
label = []
rm_elems = []
for i in range(1, len(ticks['distance'])):
if t... | [
"utility",
"private",
"method",
"to",
"add",
"ticks",
"to",
"a",
"band",
"structure",
"with",
"selected",
"branches"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L1989-L2095 | [
"def",
"_maketicks_selected",
"(",
"self",
",",
"plt",
",",
"branches",
")",
":",
"ticks",
"=",
"self",
".",
"get_ticks",
"(",
")",
"distance",
"=",
"[",
"]",
"label",
"=",
"[",
"]",
"rm_elems",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"1",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSDOSPlotter.get_plot | Get a matplotlib plot object.
Args:
bs (BandStructureSymmLine): the bandstructure to plot. Projection
data must exist for projected plots.
dos (Dos): the Dos to plot. Projection data must exist (i.e.,
CompleteDos) for projected plots.
Returns:
... | pymatgen/electronic_structure/plotter.py | def get_plot(self, bs, dos=None):
"""
Get a matplotlib plot object.
Args:
bs (BandStructureSymmLine): the bandstructure to plot. Projection
data must exist for projected plots.
dos (Dos): the Dos to plot. Projection data must exist (i.e.,
... | def get_plot(self, bs, dos=None):
"""
Get a matplotlib plot object.
Args:
bs (BandStructureSymmLine): the bandstructure to plot. Projection
data must exist for projected plots.
dos (Dos): the Dos to plot. Projection data must exist (i.e.,
... | [
"Get",
"a",
"matplotlib",
"plot",
"object",
".",
"Args",
":",
"bs",
"(",
"BandStructureSymmLine",
")",
":",
"the",
"bandstructure",
"to",
"plot",
".",
"Projection",
"data",
"must",
"exist",
"for",
"projected",
"plots",
".",
"dos",
"(",
"Dos",
")",
":",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L2148-L2392 | [
"def",
"get_plot",
"(",
"self",
",",
"bs",
",",
"dos",
"=",
"None",
")",
":",
"import",
"matplotlib",
".",
"lines",
"as",
"mlines",
"from",
"matplotlib",
".",
"gridspec",
"import",
"GridSpec",
"import",
"matplotlib",
".",
"pyplot",
"as",
"mplt",
"# make su... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSDOSPlotter._rgbline | An RGB colored line for plotting.
creation of segments based on:
http://nbviewer.ipython.org/urls/raw.github.com/dpsanders/matplotlib-examples/master/colorline.ipynb
Args:
ax: matplotlib axis
k: x-axis data (k-points)
e: y-axis data (energies)
red:... | pymatgen/electronic_structure/plotter.py | def _rgbline(ax, k, e, red, green, blue, alpha=1, linestyles="solid"):
"""
An RGB colored line for plotting.
creation of segments based on:
http://nbviewer.ipython.org/urls/raw.github.com/dpsanders/matplotlib-examples/master/colorline.ipynb
Args:
ax: matplotlib axis
... | def _rgbline(ax, k, e, red, green, blue, alpha=1, linestyles="solid"):
"""
An RGB colored line for plotting.
creation of segments based on:
http://nbviewer.ipython.org/urls/raw.github.com/dpsanders/matplotlib-examples/master/colorline.ipynb
Args:
ax: matplotlib axis
... | [
"An",
"RGB",
"colored",
"line",
"for",
"plotting",
".",
"creation",
"of",
"segments",
"based",
"on",
":",
"http",
":",
"//",
"nbviewer",
".",
"ipython",
".",
"org",
"/",
"urls",
"/",
"raw",
".",
"github",
".",
"com",
"/",
"dpsanders",
"/",
"matplotlib"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L2395-L2422 | [
"def",
"_rgbline",
"(",
"ax",
",",
"k",
",",
"e",
",",
"red",
",",
"green",
",",
"blue",
",",
"alpha",
"=",
"1",
",",
"linestyles",
"=",
"\"solid\"",
")",
":",
"from",
"matplotlib",
".",
"collections",
"import",
"LineCollection",
"pts",
"=",
"np",
".... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSDOSPlotter._get_colordata | Get color data, including projected band structures
Args:
bs: Bandstructure object
elements: elements (in desired order) for setting to blue, red, green
bs_projection: None for no projection, "elements" for element projection
Returns: | pymatgen/electronic_structure/plotter.py | def _get_colordata(bs, elements, bs_projection):
"""
Get color data, including projected band structures
Args:
bs: Bandstructure object
elements: elements (in desired order) for setting to blue, red, green
bs_projection: None for no projection, "elements" for ... | def _get_colordata(bs, elements, bs_projection):
"""
Get color data, including projected band structures
Args:
bs: Bandstructure object
elements: elements (in desired order) for setting to blue, red, green
bs_projection: None for no projection, "elements" for ... | [
"Get",
"color",
"data",
"including",
"projected",
"band",
"structures",
"Args",
":",
"bs",
":",
"Bandstructure",
"object",
"elements",
":",
"elements",
"(",
"in",
"desired",
"order",
")",
"for",
"setting",
"to",
"blue",
"red",
"green",
"bs_projection",
":",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L2425-L2472 | [
"def",
"_get_colordata",
"(",
"bs",
",",
"elements",
",",
"bs_projection",
")",
":",
"contribs",
"=",
"{",
"}",
"if",
"bs_projection",
"and",
"bs_projection",
".",
"lower",
"(",
")",
"==",
"\"elements\"",
":",
"projections",
"=",
"bs",
".",
"get_projection_o... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSDOSPlotter._rgb_triangle | Draw an RGB triangle legend on the desired axis | pymatgen/electronic_structure/plotter.py | def _rgb_triangle(ax, r_label, g_label, b_label, loc):
"""
Draw an RGB triangle legend on the desired axis
"""
if not loc in range(1, 11):
loc = 2
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
inset_ax = inset_axes(ax, width=1, height=1, loc=lo... | def _rgb_triangle(ax, r_label, g_label, b_label, loc):
"""
Draw an RGB triangle legend on the desired axis
"""
if not loc in range(1, 11):
loc = 2
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
inset_ax = inset_axes(ax, width=1, height=1, loc=lo... | [
"Draw",
"an",
"RGB",
"triangle",
"legend",
"on",
"the",
"desired",
"axis"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/plotter.py#L2475-L2521 | [
"def",
"_rgb_triangle",
"(",
"ax",
",",
"r_label",
",",
"g_label",
",",
"b_label",
",",
"loc",
")",
":",
"if",
"not",
"loc",
"in",
"range",
"(",
"1",
",",
"11",
")",
":",
"loc",
"=",
"2",
"from",
"mpl_toolkits",
".",
"axes_grid1",
".",
"inset_locator... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.