public class APEAttributeGenerator extends BaseAttributeGenerator
[Packing efficiency] = [Ideal radius ratio] / [Actual radius ratio]
The ideal ratio is determined based on the ratio between the size of a central atom and the neighboring atoms such that packing around the central atom is maximized. These optimal ratios for clusters of different numbers of atoms have been tabulated by Miracle et al..
The actual ratio is computed by dividing the radius of the central atom by the average radius of the central atoms.
We currently use this framework to create two types of attributes:
Advanced Notes
This algorithm currently evaluates all possible clusters provided a list of elements. On a 3.5GHz processor, this can find all clusters with up to 8 types in ~20 seconds. However, as the number of clusters scales with N!, the runtime for this algorithm scales with N!.
For now, we only search for clusters with up to 7 atoms (see MaxNTypes)
in order to avoid this combinatorial problem. In practice, the algorithm
picks the top 7 alloys with the highest fractions. While not ideal, this
might work in practice since most alloys have fewer than 7 main components.
Many alloys have >10 elements in the specification, but many are impurities
that may not be present in large enough amounts to really affect the determination
of efficiently packed clusters.
Usage: <packing threshold> -neighbors <neighbors to evaluate>
packing threshold: Threshold at which to define a cluster
as "efficiently-packed" (suggestion = 0.01)
neighbors to evaluate: List of number of nearest neighbors
to consider when generating attributes (suggestion = 1 3 5)
Modifier and Type | Field and Description |
---|---|
static int |
MaxNTypes
Maximum number of types over which to search for clusters.
|
Constructor and Description |
---|
APEAttributeGenerator()
Create generator with default settings.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributes(Dataset data)
Generate new attributes for a dataset.
|
static double |
computeAPE(double[] radii,
int centerType,
int[] shellTypes)
Compute the APE of a cluster, provided the identities of the central and
1st neighbor atoms.
|
static double |
computeAPE(int NNeighbors,
double centerRadius,
double neighEffRadius)
Compute the APE provided the number of neighbors and radii.
|
static java.util.List<CompositionEntry> |
computeClusterCompositions(int[] elements,
java.util.List<java.util.List<int[]>> clusters)
Compute the compositions of a list of atomic clusters.
|
static double |
determineOptimalAPE(int centralAtomType,
CompositionEntry shellComposition,
double[] radii)
Compute the optimal APE for a cluster with a certain atom type
in the center and composition in the cell.
|
static java.util.List<java.util.List<int[]>> |
findEfficientlyPackedClusters(double[] radii,
double packingThreshold)
Provided a list of atomic radii, find all clusters with better than a certain
packing efficiency threshold.
|
static java.util.List |
getClosestCompositions(CompositionEntry targetComposition,
java.util.Collection<CompositionEntry> otherCompositions,
int nClosest,
int pNorm)
Get closest compositions
|
static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,java.lang.Integer> |
getClusterRange(double[] radii,
double packingThreshold)
Determine the maximum and minimum possible cluster sizes, provided a list of radii.
|
static double |
getIdealRadiusRatio(int NNeighbors)
Get the ideal radius ratio for a cluster of a certain size.
|
java.lang.String |
printDescription(boolean htmlFormat)
Print out description of attributes.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
setNNearestToEval(java.util.Collection<java.lang.Integer> toEval)
Set the number of nearest clusters to evaluate when computing attributes.
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
void |
setPackingThreshold(double threshold)
Define the threshold at which to define a cluster as efficiently packed.
|
void |
setRadiusProperty(java.lang.String property)
Set the name of the elemental property used to define radii.
|
runCommand
public static int MaxNTypes
public APEAttributeGenerator()
public void setOptions(java.util.List<java.lang.Object> Options) throws java.lang.Exception
Options
Options
- Array of options as Objects - can be null
java.lang.Exception
- if problem with inputspublic java.lang.String printUsage()
Options
public void setPackingThreshold(double threshold) throws java.lang.Exception
threshold
- Desired threshold (default = 0.01)java.lang.Exception
public void setNNearestToEval(java.util.Collection<java.lang.Integer> toEval)
toEval
- Collection containing a set of numbers of nearest clusters
to evaluate when computing attributes. Default: {1, 3, 5}public void setRadiusProperty(java.lang.String property)
property
- Name of property used to define radiipublic void addAttributes(Dataset data) throws java.lang.Exception
BaseAttributeGenerator
addAttributes
in class BaseAttributeGenerator
data
- Dataset to be added tojava.lang.Exception
Dataset.addAttribute(java.lang.String, double[])
public java.lang.String printDescription(boolean htmlFormat)
BaseAttributeGenerator
Implementation Notes
Format should look like
[Full Name of generator]: (Number of attributes) Text description of what these attributes are
For HTML format, omit the ":".
printDescription
in class BaseAttributeGenerator
htmlFormat
- Whether to print in HTML formatpublic static double determineOptimalAPE(int centralAtomType, CompositionEntry shellComposition, double[] radii)
centralAtomType
- Element ID (Z - 1) of central atomshellComposition
- Composition of nearest neighbor shellradii
- Lookup table of elemental radiipublic static java.util.List<CompositionEntry> computeClusterCompositions(int[] elements, java.util.List<java.util.List<int[]>> clusters)
elements
- Elements from which clusters are composed.clusters
- Clusters to convert. List of the identity of shell compositions
for each type of central atom. Example: clusters[1][2] Is a array defining
the number of atoms of each type for clusters with an atom of type 1 in
the center.findEfficientlyPackedClusters(double[], double)
public static java.util.List<java.util.List<int[]>> findEfficientlyPackedClusters(double[] radii, double packingThreshold)
radii
- Radii of elementspackingThreshold
- Desired packing limit threshold. A "default"
choice would be 0.05computeAPE(double[], int, int[])
public static double computeAPE(double[] radii, int centerType, int[] shellTypes)
radii
- Radius of each atom typecenterType
- Type of atom in the centershellTypes
- Number of atoms of each type in the outer shell. Must be
the same length as radiipublic static double computeAPE(int NNeighbors, double centerRadius, double neighEffRadius)
Here, we follow the formulation given by
Laws et al., where:
APE = <ideal radius ratio> / (<radius of central atom> /
<effective radius of nearest neighbors>)
The ideal ratio is computed using getIdealRadiusRatio(int)
NNeighbors
- Number of 1st nearest neighbors in the clustercenterRadius
- Radius of central atomneighEffRadius
- Effective radius of 1st shell. Usually computed
as the average radius of all atoms in the shell.public static double getIdealRadiusRatio(int NNeighbors)
Note: The ideal radius ratio is only known for clusters with between 3 and 24 (inclusive) neighbors. If you request outside of this range, it will return the value of 3 for anything less than 3, and the value of 24 for anything larger than 24.
Reference: Miracle et al.
NNeighbors
- Number of 1st nearest neighbors.public static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,java.lang.Integer> getClusterRange(double[] radii, double packingThreshold)
The smallest possible cluster has the smallest atom in the center and the largest in the outside. The largest possible has the largest in the inside and smallest in the outside
radii
- List of radii of elements in systempackingThreshold
- APE defining the maximum packing thresholdpublic static java.util.List getClosestCompositions(CompositionEntry targetComposition, java.util.Collection<CompositionEntry> otherCompositions, int nClosest, int pNorm)
targetComposition
- Composition from which to measure distanceotherCompositions
- Compositions that whose distance from the
target composition will be rankednClosest
- Number of closest compounds to retrievepNorm
- P-norm to use when computing distance