materialsintelligence / propnet Goto Github PK
View Code? Open in Web Editor NEWA knowledge graph for Materials Science.
License: Other
A knowledge graph for Materials Science.
License: Other
I find the names "Symbol" and "SymbolType" to be very unintuitive. I would think of them more as PropertyType and Property. i.e., saying that "Young's modulus=200GPa" is a "symbol" of a material makes no sense to me. Calling it a "property" makes more sense and also fits in with the idea of "propnet". Also the add_property() method makes more sense if you feed in a Property object. etc. etc.
The jupyter notebook starts with printing a propnet. I tried for awhile to figure out what the format of this thing is but it's beyond me. Why are there indents sometimes and not others? I can't figure it out!
Incidentally there is a networkx ascii tool, I'd be pretty interested to see what kind of craziness would result from printing that out ...
reflectance should look like [(1-n)^2+k^2]/[(1+n)^2+k^2] nd you can remove k for very transparent materials.
absoprtion should look like 4pik/lambda where lambda is wavelength of light
Also add the relationship between n and k and eps_real and eps_imag, should be straightforward. Thus if someone starts with eps_real and eps_imag, they can end up with reflectance / absorptivity
Consider auto-checking things like that the keys of the symbol_mappings are valid canonical names for known properties
Let's say there are 2 measurements (bulk modulus, band gap) all performed under the same condition (T=300K)
There are 3 ways to do it:
I don't see a real implementation example for this and the Property object doesn't have a field called "downstream_properties" which which indicate the first way or "upstream_conditions" which would represent the second way.
I also don't get the DFT/expt example. Let's say the PropertyType for both is band gap in eV - so far, so good. The property value for DFT is 0.4 and for experiment is 1.1. Where is the notation of whether it's DFT or expt supposed to go?
There seems to be mixing of Sij and Eij?
I think the base class has symbol_out be optional, but the actual models seem to require it
Perhaps you want the following:
i) symbol_out is required in the model.evaluate() AND
ii) the base model class implements a method that allows you to provide a symbol_input dictionary and gives you a list of potential symbol_outputs that the model can produce (None if nothing). Easy to get with connections dict?
Currently only have one test (property metadata parsing) ... need unit tests for all core code
Constraints are currently a map between symbols and the constraint, which is currently a simple lambda function.
Better would be a Constraint class, with a mandatory explanation string of what the constraint does, and a .satisfies_constraint(value)
method.
You have:
G = symbols_and_values_in.get('G')
why not
G = symbols_and_values_in['G']
If 'G' does not exist in symbols and values, the latter will cause the code to fail at the actual point of failure (cannot load G). The former will cause the code to fail somewhere downstream, which will always be less clear as to what is happening. e.g., even in this simplest case, when the code fails it won't be clear that 'G' was the missing parameter
[1] J. Yan, P. Gorai, B. Ortiz, S. Miller, S.A. Barnett, T. Mason, et al., Material descriptors for predicting thermoelectric performance, Energy Environ. Sci. 8 (2015) 983–994.
See: https://github.com/crubier/react-graph-vis
Assigned to myself.
I like this as a minimal 'advanced' property:
Even though the initial graph will concentrate on single materials, it would be good to make sure the design is forward looking enough that we can support this kind of property in future.
Current status, graph can have:
AbstractModel
subclass as nodePropertyType
as nodeMaterial
wrapped in a generic NodeType
containerThis is getting messy. We will standardize on a generic NodeType
container, which will make it easier for new people joining the project to understand what's going on, and give a consistent interface for understanding what type a given node is.
Assigned to myself.
A semi-empirical thermal conductivity model:
[1] S.A. Miller, P. Gorai, B.R. Ortiz, A. Goyal, D. Gao, S.A. Barnett, et al., Capturing Anharmonicity in a Lattice Thermal Conductivity Model for High-Throughput Predictions, Chem. Mater. 29 (2017) 2494–2501.
Also includes a very rough relation for Gruneisen parameter based on coordination number
There is a relationship between max phonon frequency and long-wave absorption limit in:
[1] J. Du, N. Chen, X. Li, S. Xie, W.Q. Tian, X. Wang, Exploring long-wave infrared transmitting materials with A x B y form : First-principles gene-like studies, Nat. Publ. Gr. (2016) 1–8.
to predict perovskite stability
The one thing that comes to mind now is the relative magnetic permeability, which is around 1 for most of the materials. I define refraction index n as a function of electrical permittivity and magnetic permeability, without a default value for \mu it won’t compute n and other optical properties that depend on n. However, in most cases, it makes sense to use 1 for \mu and propagate the graph.
We should, however, have a flag notifying the user that a default value was used and the result might not be precise.
Other things might later include e.g. a default wavelength for light, default sample thickness, etc.
See matminer for ideas
From Introduction to Materials Science Class:
Other Ideas:
add this
Before I forget...
Current status of Propnet is essentially two distinct graphs that get merged together + solved:
Should make the material graph MSONable for easy database insertion. Should be fairly easy to do, networkx gives graph as json, might want to tidy it up a little bit for easy querying.
I understand the desire to re-use pint notation, but maybe explain it and make it easy for people? e.g. give an example of what some complex unit looks like and what the various components are.
Looks like a reverse connection? PropertyTypes don't have Properties do they?
An early goal, as soon as possible create a builder that can periodically run Propnet on MP data and derive new quantities as and when new models are added.
Let's say I have 3 known properties with canonical names:
There are 2 different models. One of them calls the bulk modulus as "B" and another one decides to call the bulk modulus as "K". Thus, to use model 1 you pass in {"B": 2} whereas to use model to you pass in {"K": 2}. Yes, these can be auto-converted by reversing the symbol_mapping, but you can see how it gets a little awkward versus just passing in {"bulk_modulus": 2} for both models
Vickers hardness is already covered in matminer models.
Other hardness models to consider:
https://journals.aps.org/prb/pdf/10.1103/PhysRevB.84.092103
http://aip.scitation.org/doi/pdf/10.1063/1.4794424
(I didn't read the papers).
I'd consider these to be lower-priority since we already have a Vickers hardness
There are various dielectric constant (index of refraction) and band gap relations, see:
[1] N.M. Ravindra, P. Ganapathy, J. Choi, Energy gap-refractive index relations in semiconductors - An overview, Infrared Phys. Technol. 50 (2007) 21–29.
e.g. same as pymatgen, etc.
PropertyMetadata could include things like the conditions the property was measured under or the type of technique used to measure the property
"vise versa"
"comlex permittivity"
PEP suggests <80 character lines
This is probably the most controversial PEP guideline. I like 100 chars but this is really up to you
Preferably with flake8 and mypy integrations.
Already there:
various mechanical property relations (bulk, shear, Poission, p-wave, Lame) via: https://en.wikipedia.org/wiki/Lamé_parameters
Vicker's hardness from bulk modulus
thermal stress
various toughness (see matminer - although might require some revision / thought)
various heat flow / thermal stress (see matminer - although might require some revision / thought)
sound velocity from bulk modulus
multiple thermal conductivity models
Some of these I would classify as "good" relations already - i.e., relations between two intrinsic materials properties. Others require more thought - e.g., if the relation involves an initial crack size or some other parameter that is "external" to the fundamental material. Those I think can be skipped initially and added as issues to figure out later
Model class is currently very programmatic. Want to separate out data (title, tags, description, equations, symbol mapping, etc.) and logic (constraints, evaluation). Simple models shouldn't need any logic.
This will make storing/serializing models easier, and checking for conformance easier.
K.A. Denault, J. Brogh, S.D. Kloss, M.W. Gaultois, J. Siewenie, K. Page, et al., Average and Local Structure, Debye Temperature, and Structural Rigidity in Some Oxide Compounds Related to Phosphor Hosts, (2015).
I'd rate as low-priority. It is a specialized topic, and the validation is only a few data points
Should be able to get this through MP data today, would be a great low hanging fruit:
see equation here:
https://en.wikipedia.org/wiki/Debye_model
Previously implemented by Saurabh in matminer (now removed from matminer)
from __future__ import division, unicode_literals, print_function
import math
from scipy.constants import *
from scipy.integrate import quad
from matminer.models import ureg
__author__ = 'Saurabh Bajaj <[email protected]>'
class CahillSimpleModel:
"""
Calculate Cahill thermal conductivity.
References:
- DOI: 10.1016/j.jallcom.2014.09.022 (Title: "Electronic structure, elastic anisotropy,
thermal conductivity and optical properties of calcium apatite Ca5(PO4)3X (X = F, Cl or Br)")
- DOI: 10.1016/j.commatsci.2015.07.029 (Title: "Electronic structure, mechanical properties and
anisotropy of thermal conductivity of Y-Si-O-N quaternary crystals")
- DOI: 10.1002/adma.201400515 (Title: "High Thermoelectric Performance in Non-Toxic Earth-Abundant
Copper Sulfide")
"""
@ureg.wraps(None, (None, None, 'm**3', 'm/s', 'm/s', 'm/s'), True)
def __init__(self, n, V, v_l, v_t1, v_t2):
"""
Args:
n: (int) number of atoms in unit cell
V: (float) unit cell volume (in SI units, i.e. m^(3))
v_l: (float) longitudinal sound velocity (in SI units, i.e. m/s)
v_t1: (float) transverse sound velocity in direction 1 (in SI units, i.e. m/s)
v_t2: (float) transverse sound velocity in direction 2 (in SI units, i.e. m/s)
Returns: None
"""
self.n = n
self.V = V
self.v_l = v_l
self.v_t1 = v_t1
self.v_t2 = v_t2
@ureg.wraps('joule/m/s/kelvin', None, True)
def calculate(self):
"""
Returns: (float) Cahill thermal conductivity (in SI units, i.e. joule/(m*s*kelvin))
"""
return (1. / 2.) * ((math.pi / 6) ** (1. / 3.)) * k * ((self.n / self.V) ** (2. / 3.)) * (
self.v_l + self.v_t1 + self.v_t2)
def cahill_integrand(x):
"""
Integrand function to calculate Cahill thermal conductivity.
Args:
x: (hbar * omega)/(k * T) # hbar: reduced Planck's constant, omega = phonon frequency
Returns: (float) integral value
"""
return (x ** 3 * math.exp(x)) / ((math.exp(x) - 1) ** 2)
def cahill_integrand_summation(v_i, T, theta):
"""
Calculate the summation term for the Cahill thermal conductivity integrand model.
Use this function repeatedly to calculate the total sum over all acoustic modes.
References:
- DOI: 10.1002/adfm.201600718 (Title: "Minimum Thermal Conductivity in Weak Topological Insulators with
Bismuth-Based Stack Structure")
- DOI: 10.1038/nature13184 (Title: "Ultralow thermal conductivity and high thermoelectric figure of merit in
SnSe crystals") (full formula)
Args:
v_i: (float) sound velocity for the acoustic mode i (in SI units, i.e. m(s)^(-1))
T: (float) absolute temperature (in K)
theta: (float) Debye temperature (in K)
Returns: (float) summation term for only *one* acoustic mode i
"""
return v_i * (T / theta) ** 2 * quad(cahill_integrand, 0, theta / T)
def cahill_integrand_model(n, V, cahill_integrand_sum):
"""
Calculate Cahill thermal conductivity using the intergrand model.
References:
- DOI: 10.1002/adfm.201600718 (Title: "Minimum Thermal Conductivity in Weak Topological Insulators with
Bismuth-Based Stack Structure")
- DOI: 10.1038/nature13184 (Title: "Ultralow thermal conductivity and high thermoelectric figure of merit in
SnSe crystals") (full formula)
Args:
n: (int) number of atoms in primitive cell
V: (float) unit cell volume (in SI units, i.e. m^(3))
cahill_integrand_sum: (float) *sum* of the term calculate using the above function "cahill_integrand_summation"
Returns: (float) Cahill thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
n_d = (6 * math.pi ** 2 * (n / V)) ** (1. / 3.)
return (math.pi / 6) ** (1. / 3.) * k * n_d ** (1. / 3.) * cahill_integrand_sum
def clarke_model(n, E, m, V):
"""
Calculate Clarke thermal conductivity.
References:
- DOI: 10.1016/j.jallcom.2014.09.022 (Title: "Electronic structure, elastic anisotropy,
thermal conductivity and optical properties of calcium apatite Ca5(PO4)3X (X = F, Cl or Br)")
- DOI: 10.1016/j.commatsci.2015.07.029 (Title: "Electronic structure, mechanical properties and
anisotropy of thermal conductivity of Y-Si-O-N quaternary crystals")
Args:
n: (int) number of atoms in primitive cell
E: (float) Young's modules (in SI units, i.e. Kgm(s)^(-2))
m: (float) total mass per unit cell (in SI units, i.e. Kg)
V: (float) unit cell volume (in SI units, i.e. m^(3))
Returns: (float) Clarke thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
return 0.87 * k * (((n * 6.023 * 10 ** 23) / m) ** (2. / 3.)) * (E ** (1. / 2.)) * (
(m / V) ** (1. / 6.))
def callaway_integrand(x, t_ph):
"""
Integrand function to calculate Callaway thermal conductivity.
Args:
x: (hbar * omega)/(k * T) # hbar: reduced Planck's constant, omega = phonon frequency
t_ph: (float) phonon relaxation time (in SI units, s^(-1))
Returns: (float) integral value
"""
return (x ** 4 * math.exp(x)) / (t_ph ** (-1) * (math.exp(x) - 1) ** 2)
def callaway_model(v_m, T, theta, t_ph):
"""
Calculate Callaway thermal conductivity
(In some circumstances, a second term may be required as seen in
http://link.springer.com/chapter/10.1007%2F0-387-25100-6_2#page-1)
References:
- DOI: 10.1002/adfm.201600718 (Title: "Minimum Thermal Conductivity in Weak Topological Insulators with
Bismuth-Based Stack Structure")
- DOI: 10.1063/1.4906225 (Title: "Critical analysis of lattice thermal conductivity of half-Heusler alloys
using variations of Callaway model")
- DOI: 10.1103/PhysRev.134.A1058 (Title: "Thermal Conductivity of Silicon and Germanium from 3 K to the Melting
Point")
Args:
v_m: (float) speed of sound in the material (in SI units, i.e. m(s)^(-1))
T: (float) absolute temperature (in K)
theta: (float) Debye temperature (in K)
t_ph: (float) phonon relaxation time (in SI units, s^(-1))
Returns: (float) Callaway thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
return (k / (2 * math.pi ** 2 * v_m)) * ((k * T) / hbar) ** 3 * quad(callaway_integrand, 0,
theta / T, args=(t_ph,))
def slack_simple_model(M, theta, v_a, gamma, n, T):
"""
Calculate the simple Slack thermal conductivity
References
- DOI: 10.1007/0-387-25100-6_2 (Title: "High Lattice Thermal Conductivity Solids")
- DOI: 10.1002/adfm.201600718 (Title: "Minimum Thermal Conductivity in Weak Topological Insulators with
Bismuth-Based Stack Structure")
Args:
M: (float) average atomic mass
theta: (float) Debye temperature (K)
v_a: (float) (v_a)**3 is the volume per atom (Angstroms)
gamma: (float) Gruneisen parameter
n: (int) number of atoms in primitive cell
T: (float) absolute temperature (K)
Returns: (float) Slack thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
A_0 = 3.1 * 10 ** (-8) # for v_a in Angstroms.
# Taken from http://link.springer.com/chapter/10.1007%2F0-387-25100-6_2#page-1
# This constant is 3.1 * 10**(-6) in Ref:- DOI: 10.1002/adfm.201600718
return (A_0 * M * theta ** 3 * v_a) / (gamma * n ** (2. / 3.) * T)
def slack_integrand(x, t_c):
"""
Integrand function to calculate Callaway thermal conductivity.
Args:
x: (hbar * omega)/(k * T) # hbar: reduced Planck's constant, omega = phonon frequency
t_c: (float) phonon relaxation time (in SI units, s^(-1))
Returns: (float) integral value
"""
return t_c * x ** 2
def slack_integrand_model(v_m, T, theta, t_c):
"""
Calculate Slack thermal conductivity using the integral model.
(In high temperature regions, those higher than that of the Debye temperature of the material, the Callaway
model is insufficient at predicting the lattice thermal conductivity. This shortfall must be addressed as many
thermoelectric materials are designed to be used in conditions beyond the Debye temperature of the alloys and
accurate predictions are required. At high temperatures, a modification suggested by Glassbrenner and Slack is
made to model thermal conductivity as shown here.)
References:
- DOI: 10.1103/PhysRev.134.A1058 (Title: "Thermal Conductivity of Silicon and Germanium from 3 K to the Melting
Point")
- DOI: 10.1063/1.4906225 (Title: "Critical analysis of lattice thermal conductivity of half-Heusler alloys
using variations of Callaway model")
Args:
v_m: (float) speed of sound in the material (in SI units, i.e. m(s)^(-1))
T: (float) absolute temperature (in K)
theta: (float) Debye temperature (in K)
t_c: (float) combined phonon relaxation time that includes higher-order processes (in SI units, s^(-1))
(see Ref:- DOI: 10.1103/PhysRev.134.A1058)
Returns: (float) Slack thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
return (k / (2 * math.pi ** 2 * v_m)) * ((k * T) / hbar) ** 3 * quad(callaway_integrand, 0,
theta / T, args=(t_c,))
def keyes_model(gamma, e_m, T_m, m, V, T, A):
"""
Calculate Keyes thermal conductivity
References:
- DOI: 10.1103/PhysRev.115.564 (Title: "High-Temperature Thermal Conductivity of Insulating Crystals:
Relationship to the Melting Point")
Args:
gamma: (float) Gruneisen parameter
e_m: (float) amplitude of atomic vibrations as fraction of lattice constant at which melting takes place
T_m: (float) melting temperature (K)
m: (float) total mass (in SI units, i.e. Kg)
V: (float) unit cell volume (in SI units, i.e. m^(3))
T: (float) absolute temperature (in K)
A: (float) average atomic weight
Returns: (float) Keyes thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
B = (R ** (3. / 2.)) / (3 * gamma ** 2 * e_m ** 3 * (6.023 * 10 ** 23) ** (1.0 / 3))
return (B * T_m ** (3. / 2.) * (m / V) ** (2. / 3.)) / (T * A ** (7. / 6.))
def debye_model(M, E, m, V):
"""
Calculate Debye thermal conductivity.
Args:
M: (float) molecular mass
E: (float) Young's modules (in SI units, i.e. Kgm(s)^(-2))
m: (float) total mass (in SI units, i.e. Kg)
V: (float) unit cell volume (in SI units, i.e. m^(3))
Returns: (float) Debye thermal conductivity (in SI units, i.e. W(mK)^(-1))
"""
return 2.489e-11 * ((1 / M) ** (1. / 3.)) * (E ** 0.5) * ((m / V) ** (-1. / 6.))
*These may be difficult because some quantities involve knowledge of the burgers vector for the dislocations in the material.
What does this mean?
" a sample value of the property, reasonable over a wide variety of contexts."
??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.