INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Plot respect to the chemical potential of the Seebeck effective mass calculated as explained in Ref. Gibbs Z. M. et al. Effective mass and fermi surface complexity factor from ab initio band structure calculations. npj Computational Materials 3 8 ( 2017 ). | def plot_seebeck_eff_mass_mu(self, temps=[300], output='average',
Lambda=0.5):
"""
Plot respect to the chemical potential of the Seebeck effective mass
calculated as explained in Ref.
Gibbs, Z. M. et al., Effective mass and fermi surface complexity factor... |
Plot respect to the chemical potential of the Fermi surface complexity factor calculated as explained in Ref. Gibbs Z. M. et al. Effective mass and fermi surface complexity factor from ab initio band structure calculations. npj Computational Materials 3 8 ( 2017 ). Args: output: average returns the complexity factor ca... | def plot_complexity_factor_mu(self, temps=[300], output='average',
Lambda=0.5):
"""
Plot respect to the chemical potential of the Fermi surface complexity
factor calculated as explained in Ref.
Gibbs, Z. M. et al., Effective mass and fermi surface compl... |
Plot the seebeck coefficient in function of Fermi level | def plot_seebeck_mu(self, temp=600, output='eig', xlim=None):
"""
Plot the seebeck coefficient in function of Fermi level
Args:
temp:
the temperature
xlim:
a list of min and max fermi energy by default (0, and band gap)
Returns:
... |
Plot the conductivity in function of Fermi level. Semi - log plot | def plot_conductivity_mu(self, temp=600, output='eig',
relaxation_time=1e-14, xlim=None):
"""
Plot the conductivity in function of Fermi level. Semi-log plot
Args:
temp: the temperature
xlim: a list of min and max fermi energy by default (0, ... |
Plot the power factor in function of Fermi level. Semi - log plot | def plot_power_factor_mu(self, temp=600, output='eig',
relaxation_time=1e-14, xlim=None):
"""
Plot the power factor in function of Fermi level. Semi-log plot
Args:
temp: the temperature
xlim: a list of min and max fermi energy by default (0, ... |
Plot the ZT in function of Fermi level. | def plot_zt_mu(self, temp=600, output='eig', relaxation_time=1e-14,
xlim=None):
"""
Plot the ZT in function of Fermi level.
Args:
temp: the temperature
xlim: a list of min and max fermi energy by default (0, and band
gap)
ta... |
Plot the Seebeck coefficient in function of temperature for different doping levels. | def plot_seebeck_temp(self, doping='all', output='average'):
"""
Plot the Seebeck coefficient in function of temperature for different
doping levels.
Args:
dopings: the default 'all' plots all the doping levels in the analyzer.
Specify a list of doping ... |
Plot the Power Factor in function of doping levels for different temperatures. | def plot_power_factor_dop(self, temps='all', output='average',
relaxation_time=1e-14):
"""
Plot the Power Factor in function of doping levels for different temperatures.
Args:
temps: the default 'all' plots all the temperatures in the analyzer.
... |
Plot the figure of merit zT in function of doping levels for different temperatures. | def plot_zt_dop(self, temps='all', output='average', relaxation_time=1e-14):
"""
Plot the figure of merit zT in function of doping levels for different
temperatures.
Args:
temps: the default 'all' plots all the temperatures in the analyzer.
Specify a list ... |
plot dos | def plot_dos(self, sigma=0.05):
"""
plot dos
Args:
sigma: a smearing
Returns:
a matplotlib object
"""
plotter = DosPlotter(sigma=sigma)
plotter.add_dos("t", self._bz.dos)
return plotter.get_plot() |
Plot the carrier concentration in function of Fermi level | def plot_carriers(self, temp=300):
"""
Plot the carrier concentration in function of Fermi level
Args:
temp: the temperature
Returns:
a matplotlib object
"""
import matplotlib.pyplot as plt
plt.semilogy(self._bz.mu_steps,
... |
Plot the Hall carrier concentration in function of Fermi level | def plot_hall_carriers(self, temp=300):
"""
Plot the Hall carrier concentration in function of Fermi level
Args:
temp: the temperature
Returns:
a matplotlib object
"""
import matplotlib.pyplot as plt
hall_carriers = [abs(i) for i in
... |
Adds a COHP for plotting. | def add_cohp(self, label, cohp):
"""
Adds a COHP for plotting.
Args:
label: Label for the COHP. Must be unique.
cohp: COHP object.
"""
energies = cohp.energies - cohp.efermi if self.zero_at_efermi \
else cohp.energies
populations = co... |
Adds a dictionary of COHPs with an optional sorting function for the keys. | def add_cohp_dict(self, cohp_dict, key_sort_func=None):
"""
Adds a dictionary of COHPs with an optional sorting function
for the keys.
Args:
cohp_dict: dict of the form {label: Cohp}
key_sort_func: function used to sort the cohp_dict keys.
"""
if... |
Get a matplotlib plot showing the COHP. | def get_plot(self, xlim=None, ylim=None, plot_negative=None,
integrated=False, invert_axes=True):
"""
Get a matplotlib plot showing the COHP.
Args:
xlim: Specifies the x-axis limits. Defaults to None for
automatic determination.
ylim: Sp... |
Get dopant suggestions based on substitution probabilities. | def get_dopants_from_substitution_probabilities(structure, num_dopants=5,
threshold=0.001,
match_oxi_sign=False):
"""
Get dopant suggestions based on substitution probabilities.
Args:
structure (Structur... |
Get dopant suggestions based on Shannon radii differences. | def get_dopants_from_shannon_radii(bonded_structure, num_dopants=5,
match_oxi_sign=False):
"""
Get dopant suggestions based on Shannon radii differences.
Args:
bonded_structure (StructureGraph): A pymatgen structure graph
decorated with oxidation state... |
Utility method to get n - and p - type dopants from a list of substitutions. | def _get_dopants(substitutions, num_dopants, match_oxi_sign):
"""
Utility method to get n- and p-type dopants from a list of substitutions.
"""
n_type = [pred for pred in substitutions
if pred['dopant_species'].oxi_state >
pred['original_species'].oxi_state
and ... |
Utility func to get Shannon radii for a particular coordination number. | def _shannon_radii_from_cn(species_list, cn_roman, radius_to_compare=0):
"""
Utility func to get Shannon radii for a particular coordination number.
As the Shannon radii depends on charge state and coordination number,
species without an entry for a particular coordination number will
be skipped.
... |
Utility method to convert an int ( less than 20 ) to a roman numeral. | def _int_to_roman(number):
"""Utility method to convert an int (less than 20) to a roman numeral."""
roman_conv = [(10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I")]
result = []
for (arabic, roman) in roman_conv:
(factor, number) = divmod(number, arabic)
result.append(roman * factor)
... |
Helper method to calculate the solid angle of a set of coords from the center. | def solid_angle(center, coords):
"""
Helper method to calculate the solid angle of a set of coords from the
center.
Args:
center (3x1 array): Center to measure solid angle from.
coords (Nx3 array): List of coords to determine solid angle.
Returns:
The solid angle.
"""
... |
Calculate the volume of a tetrahedron given the four vertices of vt1 vt2 vt3 and vt4. Args: vt1 ( array - like ): coordinates of vertex 1. vt2 ( array - like ): coordinates of vertex 2. vt3 ( array - like ): coordinates of vertex 3. vt4 ( array - like ): coordinates of vertex 4. Returns: ( float ): volume of the tetrah... | def vol_tetra(vt1, vt2, vt3, vt4):
"""
Calculate the volume of a tetrahedron, given the four vertices of vt1,
vt2, vt3 and vt4.
Args:
vt1 (array-like): coordinates of vertex 1.
vt2 (array-like): coordinates of vertex 2.
vt3 (array-like): coordinates of vertex 3.
vt4 (arra... |
Returns the elemental parameters related to atom size and electronegativity which are used for estimating bond - valence parameters ( bond length ) of pairs of atoms on the basis of data provided in Atoms Sizes and Bond Lengths in Molecules and Crystals ( O Keeffe & Brese 1991 ). | def get_okeeffe_params(el_symbol):
"""
Returns the elemental parameters related to atom size and
electronegativity which are used for estimating bond-valence
parameters (bond length) of pairs of atoms on the basis of data
provided in 'Atoms Sizes and Bond Lengths in Molecules and Crystals'
(O'Ke... |
Returns an estimate of the bond valence parameter ( bond length ) using the derived parameters from Atoms Sizes and Bond Lengths in Molecules and Crystals ( O Keeffe & Brese 1991 ). The estimate is based on two experimental parameters: r and c. The value for r is based off radius while c is ( usually ) the Allred - Roc... | def get_okeeffe_distance_prediction(el1, el2):
"""
Returns an estimate of the bond valence parameter (bond length) using
the derived parameters from 'Atoms Sizes and Bond Lengths in Molecules
and Crystals' (O'Keeffe & Brese, 1991). The estimate is based on two
experimental parameters: r and c. The v... |
Returns the neighbors of a given site using a specific neighbor - finding method. | def get_neighbors_of_site_with_index(struct, n, approach="min_dist", delta=0.1, \
cutoff=10.0):
"""
Returns the neighbors of a given site using a specific neighbor-finding
method.
Args:
struct (Structure): input structure.
n (int): index of site in S... |
Returns the motif type of the site with index n in structure struct ; currently featuring tetrahedral octahedral bcc and cp ( close - packed: fcc and hcp ) as well as square pyramidal and trigonal bipyramidal. If the site is not recognized unrecognized is returned. If a site should be assigned to two different motifs m... | def site_is_of_motif_type(struct, n, approach="min_dist", delta=0.1, \
cutoff=10.0, thresh=None):
"""
Returns the motif type of the site with index n in structure struct;
currently featuring "tetrahedral", "octahedral", "bcc", and "cp"
(close-packed: fcc and hcp) as well as "sq... |
Returns that part of the first input vector that is orthogonal to the second input vector. The output vector is not normalized. | def gramschmidt(vin, uin):
"""
Returns that part of the first input vector
that is orthogonal to the second input vector.
The output vector is not normalized.
Args:
vin (numpy array):
first input vector
uin (numpy array):
second input vector
"""
vin_... |
Returns the weighted average bond length given by Hoppe s effective coordination number formula. | def calculate_weighted_avg(bonds):
"""
Returns the weighted average bond length given by
Hoppe's effective coordination number formula.
Args:
bonds (list): list of floats that are the
bond distances between a cation and its
peripheral ions
"""
minimum_bond = min(bonds)
... |
List of ionic radii of elements in the order of sites. | def radii(self):
"""
List of ionic radii of elements in the order of sites.
"""
el = [site.species_string for site in self._structure.sites]
radii_dict = dict(zip(el, self._ionic_radii))
# print radii_dict
return radii_dict |
List of oxidation states of elements in the order of sites. | def valences(self):
"""
List of oxidation states of elements in the order of sites.
"""
el = [site.species_string for site in self._structure.sites]
valence_dict = dict(zip(el, self._valences))
return valence_dict |
Computes ionic radii of elements for all sites in the structure. If valence is zero atomic radius is used. | def _get_ionic_radii(self):
"""
Computes ionic radii of elements for all sites in the structure.
If valence is zero, atomic radius is used.
"""
radii = []
vnn = VoronoiNN()
def nearest_key(sorted_vals, key):
i = bisect_left(sorted_vals, key)
... |
Computes ionic valences of elements for all sites in the structure. | def _get_valences(self):
"""
Computes ionic valences of elements for all sites in the structure.
"""
try:
bv = BVAnalyzer()
self._structure = bv.get_oxi_state_decorated_structure(
self._structure)
valences = bv.get_valences(self._struct... |
Get coordination number CN of site with index n in structure. | def get_cn(self, structure, n, use_weights=False):
"""
Get coordination number, CN, of site with index n in structure.
Args:
structure (Structure): input structure.
n (integer): index of site for which to determine CN.
use_weights (boolean): flag indicating w... |
Get coordination number CN of each element bonded to site with index n in structure | def get_cn_dict(self, structure, n, use_weights=False):
"""
Get coordination number, CN, of each element bonded to site with index n in structure
Args:
structure (Structure): input structure
n (integer): index of site for which to determine CN.
use_weights (b... |
Get near neighbors of site with index n in structure. | def get_nn(self, structure, n):
"""
Get near neighbors of site with index n in structure.
Args:
structure (Structure): input structure.
n (integer): index of site in structure for which to determine
neighbors.
Returns:
sites (list ... |
Get weight associated with each near neighbor of site with index n in structure. | def get_weights_of_nn_sites(self, structure, n):
"""
Get weight associated with each near neighbor of site with
index n in structure.
Args:
structure (Structure): input structure.
n (integer): index of site for which to determine the weights.
Returns:
... |
Get image location of all near neighbors of site with index n in structure. | def get_nn_images(self, structure, n):
"""
Get image location of all near neighbors of site with index n in
structure.
Args:
structure (Structure): input structure.
n (integer): index of site for which to determine the image
location of near neigh... |
Get a listing of all neighbors for all sites in a structure | def get_all_nn_info(self, structure):
"""Get a listing of all neighbors for all sites in a structure
Args:
structure (Structure): Input structure
Return:
List of NN site information for each site in the structure. Each
entry has the same format as `get_nn... |
Get a certain nearest neighbor shell for a certain site. | def get_nn_shell_info(self, structure, site_idx, shell):
"""Get a certain nearest neighbor shell for a certain site.
Determines all non-backtracking paths through the neighbor network
computed by `get_nn_info`. The weight is determined by multiplying
the weight of the neighbor at each h... |
Private method for computing the neighbor shell information | def _get_nn_shell_info(self, structure, all_nn_info, site_idx, shell,
_previous_steps=frozenset(), _cur_image=(0, 0, 0)):
"""Private method for computing the neighbor shell information
Args:
structure (Structure) - Structure being assessed
all_nn_info ... |
Private convenience method for get_nn_info gives lattice image from provided PeriodicSite and Structure. | def _get_image(structure, site):
"""Private convenience method for get_nn_info,
gives lattice image from provided PeriodicSite and Structure.
Image is defined as displacement from original site in structure to a given site.
i.e. if structure has a site at (-0.1, 1.0, 0.3), then (0.9, 0,... |
Private convenience method for get_nn_info gives original site index from ProvidedPeriodicSite. | def _get_original_site(structure, site):
"""Private convenience method for get_nn_info,
gives original site index from ProvidedPeriodicSite."""
for i, s in enumerate(structure):
if site.is_periodic_image(s):
return i
raise Exception('Site not found!') |
Obtain a StructureGraph object using this NearNeighbor class. Requires the optional dependency networkx ( pip install networkx ). | def get_bonded_structure(self, structure, decorate=False):
"""
Obtain a StructureGraph object using this NearNeighbor
class. Requires the optional dependency networkx
(pip install networkx).
Args:
structure: Structure object.
decorate (bool): whether to a... |
Calculate those local structure order parameters for the given site whose ideal CN corresponds to the underlying motif ( e. g. CN = 4 then calculate the square planar tetrahedral see - saw - like rectangular see - saw - like order paramters ). | def get_local_order_parameters(self, structure, n):
"""
Calculate those local structure order parameters for
the given site whose ideal CN corresponds to the
underlying motif (e.g., CN=4, then calculate the
square planar, tetrahedral, see-saw-like,
rectangular see-saw-lik... |
Gives a weighted polyhedra around a site. | def get_voronoi_polyhedra(self, structure, n):
"""
Gives a weighted polyhedra around a site.
See ref: A Proposed Rigorous Definition of Coordination Number,
M. O'Keeffe, Acta Cryst. (1979). A35, 772-775
Args:
structure (Structure): structure for which to evaluate th... |
Get the Voronoi polyhedra for all site in a simulation cell | def get_all_voronoi_polyhedra(self, structure):
"""Get the Voronoi polyhedra for all site in a simulation cell
Args:
structure (Structure): Structure to be evaluated
Returns:
A dict of sites sharing a common Voronoi facet with the site
n mapped to a directory... |
Get the list of elements for a Site | def _get_elements(self, site):
"""
Get the list of elements for a Site
Args:
site (Site): Site to assess
Returns:
[Element]: List of elements
"""
try:
if isinstance(site.specie, Element):
return [site.specie]
... |
Test whether a site contains elements in the target list | def _is_in_targets(self, site, targets):
"""
Test whether a site contains elements in the target list
Args:
site (Site): Site to assess
targets ([Element]) List of elements
Returns:
(boolean) Whether this site contains a certain list of elements
... |
Get the information about a certain atom from the results of a tessellation | def _extract_cell_info(self, structure, site_idx, sites, targets, voro,
compute_adj_neighbors=False):
"""Get the information about a certain atom from the results of a tessellation
Args:
structure (Structure) - Structure being assessed
site_idx (int) -... |
Get all near - neighbor sites as well as the associated image locations and weights of the site with index n in structure using Voronoi decomposition. | def get_nn_info(self, structure, n):
""""
Get all near-neighbor sites as well as the associated image locations
and weights of the site with index n in structure
using Voronoi decomposition.
Args:
structure (Structure): input structure.
n (integer): index... |
Given Voronoi NNs extract the NN info in the form needed by NearestNeighbors | def _extract_nn_info(self, structure, nns):
"""Given Voronoi NNs, extract the NN info in the form needed by NearestNeighbors
Args:
structure (Structure): Structure being evaluated
nns ([dicts]): Nearest neighbor information for a structure
Returns:
(list of t... |
Use Jmol algorithm to determine bond length from atomic parameters Args: el1_sym: ( str ) symbol of atom 1 el2_sym: ( str ) symbol of atom 2 | def get_max_bond_distance(self, el1_sym, el2_sym):
"""
Use Jmol algorithm to determine bond length from atomic parameters
Args:
el1_sym: (str) symbol of atom 1
el2_sym: (str) symbol of atom 2
Returns: (float) max bond length
"""
return sqrt(
... |
Get all near - neighbor sites as well as the associated image locations and weights of the site with index n using the bond identification algorithm underlying Jmol. | def get_nn_info(self, structure, n):
"""
Get all near-neighbor sites as well as the associated image locations
and weights of the site with index n using the bond identification
algorithm underlying Jmol.
Args:
structure (Structure): input structure.
n (i... |
Get all near - neighbor sites as well as the associated image locations and weights of the site with index n using the closest neighbor distance - based method. | def get_nn_info(self, structure, n):
"""
Get all near-neighbor sites as well as the associated image locations
and weights of the site with index n using the closest neighbor
distance-based method.
Args:
structure (Structure): input structure.
n (integer)... |
Get all near - neighbor sites and weights ( orders ) of bonds for a given atom. | def get_nn_info(self, structure, n):
"""
Get all near-neighbor sites and weights (orders) of bonds for a given
atom.
:param molecule: input Molecule.
:param n: index of site for which to determine near neighbors.
:return: [dict] representing a neighboring site and the ty... |
Obtain a MoleculeGraph object using this NearNeighbor class. Requires the optional dependency networkx ( pip install networkx ). | def get_bonded_structure(self, structure, decorate=False):
"""
Obtain a MoleculeGraph object using this NearNeighbor
class. Requires the optional dependency networkx
(pip install networkx).
Args:
structure: Molecule object.
decorate (bool): whether to ann... |
Get a certain nearest neighbor shell for a certain site. | def get_nn_shell_info(self, structure, site_idx, shell):
"""Get a certain nearest neighbor shell for a certain site.
Determines all non-backtracking paths through the neighbor network
computed by `get_nn_info`. The weight is determined by multiplying
the weight of the neighbor at each h... |
Get all near - neighbor sites and weights ( orders ) of bonds for a given atom. | def get_nn_info(self, structure, n):
"""
Get all near-neighbor sites and weights (orders) of bonds for a given
atom.
:param structure: input Molecule.
:param n: index of site for which to determine near neighbors.
:return: [dict] representing a neighboring site and the t... |
Get all near - neighbor sites as well as the associated image locations and weights of the site with index n using the closest relative neighbor distance - based method with O Keeffe parameters. | def get_nn_info(self, structure, n):
"""
Get all near-neighbor sites as well as the associated image locations
and weights of the site with index n using the closest relative
neighbor distance-based method with O'Keeffe parameters.
Args:
structure (Structure): input ... |
Get all near - neighbor sites as well as the associated image locations and weights of the site with index n using the closest relative neighbor distance - based method with VIRE atomic/ ionic radii. | def get_nn_info(self, structure, n):
"""
Get all near-neighbor sites as well as the associated image locations
and weights of the site with index n using the closest relative
neighbor distance-based method with VIRE atomic/ionic radii.
Args:
structure (Structure): in... |
Computes trigonometric terms that are required to calculate bond orientational order parameters using internal variables. | def compute_trigonometric_terms(self, thetas, phis):
""""
Computes trigonometric terms that are required to
calculate bond orientational order parameters using
internal variables.
Args:
thetas ([float]): polar angles of all neighbors in radians.
phis ([f... |
Calculates the value of the bond orientational order parameter of weight l = 2. If the function is called with non - empty lists of polar and azimuthal angles the corresponding trigonometric terms are computed afresh. Otherwise it is expected that the compute_trigonometric_terms function has been just called. | def get_q2(self, thetas=None, phis=None):
"""
Calculates the value of the bond orientational order parameter of
weight l=2. If the function is called with non-empty lists of
polar and azimuthal angles the corresponding trigonometric terms
are computed afresh. Otherwise, it is ... |
Calculates the value of the bond orientational order parameter of weight l = 4. If the function is called with non - empty lists of polar and azimuthal angles the corresponding trigonometric terms are computed afresh. Otherwise it is expected that the compute_trigonometric_terms function has been just called. | def get_q4(self, thetas=None, phis=None):
"""
Calculates the value of the bond orientational order parameter of
weight l=4. If the function is called with non-empty lists of
polar and azimuthal angles the corresponding trigonometric terms
are computed afresh. Otherwise, it is ... |
Calculates the value of the bond orientational order parameter of weight l = 6. If the function is called with non - empty lists of polar and azimuthal angles the corresponding trigonometric terms are computed afresh. Otherwise it is expected that the compute_trigonometric_terms function has been just called. | def get_q6(self, thetas=None, phis=None):
"""
Calculates the value of the bond orientational order parameter of
weight l=6. If the function is called with non-empty lists of
polar and azimuthal angles the corresponding trigonometric terms
are computed afresh. Otherwise, it is ... |
Return type of order parameter at the index provided and represented by a short string. | def get_type(self, index):
"""
Return type of order parameter at the index provided and
represented by a short string.
Args:
index (int): index of order parameter for which type is
to be returned.
Returns:
str: OP type.
"""
... |
Returns list of floats that represents the parameters associated with calculation of the order parameter that was defined at the index provided. Attention: the parameters do not need to equal those originally inputted because of processing out of efficiency reasons. | def get_parameters(self, index):
"""
Returns list of floats that represents
the parameters associated
with calculation of the order
parameter that was defined at the index provided.
Attention: the parameters do not need to equal those originally
inputted because ... |
Compute all order parameters of site n. | def get_order_parameters(self, structure, n, indices_neighs=None, \
tol=0.0, target_spec=None):
"""
Compute all order parameters of site n.
Args:
structure (Structure): input structure.
n (int): index of site in input structure,
... |
Get all near - neighbor information. Args: structure: ( Structure ) pymatgen Structure n: ( int ) index of target site | def get_nn_info(self, structure, n):
"""
Get all near-neighbor information.
Args:
structure: (Structure) pymatgen Structure
n: (int) index of target site
Returns:
siw (list of dicts): each dictionary provides information
about a single... |
The main logic of the method to compute near neighbor. | def get_nn_data(self, structure, n, length=None):
"""
The main logic of the method to compute near neighbor.
Args:
structure: (Structure) enclosing structure object
n: (int) index of target site to get NN info for
length: (int) if set, will return a fixed ran... |
Get coordination number CN of site with index n in structure. | def get_cn(self, structure, n, use_weights=False):
"""
Get coordination number, CN, of site with index n in structure.
Args:
structure (Structure): input structure.
n (integer): index of site for which to determine CN.
use_weights (boolean): flag indicating w... |
An internal method to get an integral between two bounds of a unit semicircle. Used in algorithm to determine bond probabilities. Args: dist_bins: ( float ) list of all possible bond weights idx: ( float ) index of starting bond weight | def _semicircle_integral(dist_bins, idx):
"""
An internal method to get an integral between two bounds of a unit
semicircle. Used in algorithm to determine bond probabilities.
Args:
dist_bins: (float) list of all possible bond weights
idx: (float) index of startin... |
An internal method to get a default covalent/ element radius | def _get_default_radius(site):
"""
An internal method to get a "default" covalent/element radius
Args:
site: (Site)
Returns:
Covalent radius of element on site, or Atomic radius if unavailable
"""
try:
return CovalentRadius.radius[sit... |
An internal method to get the expected radius for a site with oxidation state. Args: site: ( Site ) | def _get_radius(site):
"""
An internal method to get the expected radius for a site with
oxidation state.
Args:
site: (Site)
Returns:
Oxidation-state dependent radius: ionic, covalent, or atomic.
Returns 0 if no oxidation state or appropriate ... |
Given NNData transforms data to the specified fingerprint length Args: nndata: ( NNData ) length: ( int ) desired length of NNData | def transform_to_length(nndata, length):
"""
Given NNData, transforms data to the specified fingerprint length
Args:
nndata: (NNData)
length: (int) desired length of NNData
"""
if length is None:
return nndata
if length:
f... |
Initialise a CutOffDictNN according to a preset set of cut - offs. | def from_preset(preset):
"""
Initialise a CutOffDictNN according to a preset set of cut-offs.
Args:
preset (str): A preset name. The list of supported presets are:
- "vesta_2019": The distance cut-offs used by the VESTA
visualisation program.
... |
Returns a structure in mcsqs rndstr. in format.: return ( str ): | def to_string(self):
"""
Returns a structure in mcsqs rndstr.in format.
:return (str):
"""
# define coord system, use Cartesian
output = ["1.0 0.0 0.0",
"0.0 1.0 0.0",
"0.0 0.0 1.0"]
# add lattice vectors
m = self.struct... |
Parses a rndstr. in or lat. in file into pymatgen s Structure format. | def structure_from_string(data):
"""
Parses a rndstr.in or lat.in file into pymatgen's
Structure format.
:param data: contents of a rndstr.in or lat.in file
:return: Structure object
"""
data = data.splitlines()
data = [x.split() for x in data if x] # r... |
Analyze the void space in the input structure using voronoi decomposition Calls Zeo ++ for Voronoi decomposition. | def get_voronoi_nodes(structure, rad_dict=None, probe_rad=0.1):
"""
Analyze the void space in the input structure using voronoi decomposition
Calls Zeo++ for Voronoi decomposition.
Args:
structure: pymatgen.core.structure.Structure
rad_dict (optional): Dictionary of radii of elements in... |
Analyze the void space in the input structure using high accuracy voronoi decomposition. Calls Zeo ++ for Voronoi decomposition. | def get_high_accuracy_voronoi_nodes(structure, rad_dict, probe_rad=0.1):
"""
Analyze the void space in the input structure using high accuracy
voronoi decomposition.
Calls Zeo++ for Voronoi decomposition.
Args:
structure: pymatgen.core.structure.Structure
rad_dict (optional): Dictio... |
Analyze the void space in the input structure using voronoi decomposition Calls Zeo ++ for Voronoi decomposition. | def get_free_sphere_params(structure, rad_dict=None, probe_rad=0.1):
"""
Analyze the void space in the input structure using voronoi decomposition
Calls Zeo++ for Voronoi decomposition.
Args:
structure: pymatgen.core.structure.Structure
rad_dict (optional): Dictionary of radii of elemen... |
Computes the volume and surface area of isolated void using Zeo ++. Useful to compute the volume and surface area of vacant site. | def get_void_volume_surfarea(structure, rad_dict=None, chan_rad=0.3,
probe_rad=0.1):
"""
Computes the volume and surface area of isolated void using Zeo++.
Useful to compute the volume and surface area of vacant site.
Args:
structure: pymatgen Structure containing v... |
Reads a string representation to a ZeoCssr object. | def from_string(string):
"""
Reads a string representation to a ZeoCssr object.
Args:
string: A string representation of a ZeoCSSR.
Returns:
ZeoCssr object.
"""
lines = string.split("\n")
toks = lines[0].split()
lengths = [float(i... |
Creates Zeo ++ Voronoi XYZ object from a string. from_string method of XYZ class is being redefined. | def from_string(contents):
"""
Creates Zeo++ Voronoi XYZ object from a string.
from_string method of XYZ class is being redefined.
Args:
contents: String representing Zeo++ Voronoi XYZ file.
Returns:
ZeoVoronoiXYZ object
"""
lines = conte... |
: param velocities ( au ): list of list of atom velocities: return: | def set_velocities(self, velocities):
"""
:param velocities (au): list of list of atom velocities
:return:
"""
assert len(velocities) == len(self.mol)
self.params["velocity"] = velocities |
Set the maxium allowed memory. | def set_memory(self, total=None, static=None):
"""
Set the maxium allowed memory.
Args:
total: The total memory. Integer. Unit: MBytes. If set to None,
this parameter will be neglected.
static: The static memory. Integer. Unit MBytes. If set to None,
... |
Set algorithm used for converging SCF and max number of SCF iterations. | def set_scf_algorithm_and_iterations(self, algorithm="diis",
iterations=50):
"""
Set algorithm used for converging SCF and max number of SCF iterations.
Args:
algorithm: The algorithm used for converging SCF. (str)
iterations: The... |
Set the grid for DFT numerical integrations. | def set_dft_grid(self, radical_points=128, angular_points=302,
grid_type="Lebedev"):
"""
Set the grid for DFT numerical integrations.
Args:
radical_points: Radical points. (Integer)
angular_points: Angular points. (Integer)
grid_type: The... |
Set initial guess method to be used for SCF | def set_scf_initial_guess(self, guess="SAD"):
"""
Set initial guess method to be used for SCF
Args:
guess: The initial guess method. (str)
"""
availabel_guesses = {"core", "sad", "gwh", "read", "fragmo"}
if guess.lower() not in availabel_guesses:
... |
Set the coordinates system used in geometry optimization. cartesian --- always cartesian coordinates. internal --- always internal coordinates. internal - switch --- try internal coordinates first if fails switch to cartesian coordinates. z - matrix --- always z - matrix coordinates. z - matrix - switch --- try z - mat... | def set_geom_opt_coords_type(self, coords_type="internal_switch"):
"""
Set the coordinates system used in geometry optimization.
"cartesian" --- always cartesian coordinates.
"internal" --- always internal coordinates.
"internal-switch" --- try internal coordinates f... |
Adjust the convergence criteria of geometry optimization. | def scale_geom_opt_threshold(self, gradient=0.1, displacement=0.1,
energy=0.1):
"""
Adjust the convergence criteria of geometry optimization.
Args:
gradient: the scale factor for gradient criteria. If less than
1.0, you are tightening... |
Set the solvent model to PCM. Default parameters are trying to comply to gaussian default value | def use_pcm(self, pcm_params=None, solvent_key="solvent", solvent_params=None,
radii_force_field=None):
"""
Set the solvent model to PCM. Default parameters are trying to comply to
gaussian default value
Args:
pcm_params (dict): The parameters of "$pcm" secti... |
Creates QcInput from a string. | def from_string(cls, contents):
"""
Creates QcInput from a string.
Args:
contents: String representing a QChem input file.
Returns:
QcInput object
"""
mol = None
charge = None
spin_multiplicity = None
params = dict()
... |
Calculates magnetic deformation proxy a measure of deformation ( norm of finite strain ) between non - magnetic ( non - spin - polarized ) and ferromagnetic structures. | def magnetic_deformation(structure_A, structure_B):
"""
Calculates 'magnetic deformation proxy',
a measure of deformation (norm of finite strain)
between 'non-magnetic' (non-spin-polarized) and
ferromagnetic structures.
Adapted from Bocarsly et al. 2017,
doi: 10.1021/acs.chemmater.6b04729
... |
If round_magmoms_mode is an integer simply round to that number of decimal places else if set to a float will try and round intelligently by grouping magmoms. | def _round_magmoms(magmoms, round_magmoms_mode: Union[int, float]):
"""
If round_magmoms_mode is an integer, simply round to that number
of decimal places, else if set to a float will try and round
intelligently by grouping magmoms.
"""
if isinstance(round_magmoms_mode, ... |
Returns a Structure with species decorated with spin values instead of using magmom site properties.: return: Structure | def get_structure_with_spin(self):
"""
Returns a Structure with species decorated with spin values instead
of using magmom site properties.
:return: Structure
"""
structure = self.structure.copy()
structure.add_spin_by_site(structure.site_properties["magmom"])
... |
Returns a Structure with only magnetic atoms present.: return: Structure | def get_structure_with_only_magnetic_atoms(self, make_primitive=True):
"""
Returns a Structure with only magnetic atoms present.
:return: Structure
"""
sites = [site for site in self.structure if abs(site.properties["magmom"]) > 0]
structure = Structure.from_sites(sites... |
Returns a Structure without magnetic moments defined.: param make_primitive ( bool ): Return a primitive structure defaults to True.: return: Structure | def get_nonmagnetic_structure(self, make_primitive=True):
"""
Returns a Structure without magnetic moments defined.
:param make_primitive (bool): Return a primitive
structure, defaults to True.
:return: Structure
"""
structure = self.structure.copy()
stru... |
Returns a Structure with all magnetic moments positive or zero.: param make_primitive ( bool ): Return a primitive structure defaults to True.: return: Structure | def get_ferromagnetic_structure(self, make_primitive=True):
"""
Returns a Structure with all magnetic moments positive
or zero.
:param make_primitive (bool): Return a primitive
structure, defaults to True.
:return: Structure
"""
structure = self.structure... |
Returns a dict of magnetic species and the magnitude of their associated magmoms. Will return a set if there are multiple magmoms per species. | def magnetic_species_and_magmoms(self):
"""
Returns a dict of magnetic species and the magnitude of
their associated magmoms. Will return a set if there are
multiple magmoms per species.
:return: dict of magnetic species and magmoms
"""
structure = self.get_ferr... |
: param symprec ( float ): same as in SpacegroupAnalyzer: param angle_tolerance ( float ): same as in SpacegroupAnalyzer: return ( int ): Number of symmetrically - distinct magnetic sites present in structure. | def number_of_unique_magnetic_sites(self, symprec=1e-3, angle_tolerance=5):
"""
:param symprec (float): same as in SpacegroupAnalyzer
:param angle_tolerance (float): same as in SpacegroupAnalyzer
:return (int): Number of symmetrically-distinct magnetic sites present
in structure.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.