GithubHelp home page GithubHelp logo

materialsintelligence / propnet Goto Github PK

View Code? Open in Web Editor NEW
72.0 72.0 23.0 8.38 MB

A knowledge graph for Materials Science.

License: Other

Python 31.74% CSS 1.55% Dockerfile 0.05% Makefile 0.03% HTML 64.92% JavaScript 1.70%

propnet's People

Contributors

clegaspi avatar codacy-badger avatar computron avatar dmrdjenovich avatar dwinston avatar jdagdelen avatar jpalakapilly avatar leighweston86 avatar maseh87 avatar mkhorton avatar montoyjh avatar pyup-bot avatar shyamd avatar vtshitoyan avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

propnet's Issues

naming: Symbol and SymbolType

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.

can't figure out the format of print(propnet)

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 ...

https://github.com/cosminbasca/asciinet

absorption and reflectance from dielectric constants

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

DependentProperty connections - what's the plan?

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:

  • The T=300K node points to both measurements (looks this way from the graph picture in which the dependent property points to the "main" property)
  • Both measurements individually point to the 300K node
  • The measurements and connections both point to one another

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?

symbol_out can usually be auto-detected?

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?

Add class for constraints

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.

why G = symbols_and_values_in.get('G')

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

Add Electrical / Thermal Properties

  • Approximations for metallic electrical conductivity based on DOS, Eg, T, etc.
  • Drude Model Constants: tau, effective mass
  • Matthiessen's Rule for extrapolations of resistivity with temperature
  • Wiedemann-Franz-Lorentz Law: Relating electron thermal conductivity to electrical conductivity.
  • Thermal Conductivity (ideal, noninteracting bosons): K = 1/3 * Cv * v_ph * l_ph
  • Hall Coefficient (from the Hall Effect)
  • Mott & Jones Equation (Seebeck Coefficient)

Lattice misfit for epitaxy

I like this as a minimal 'advanced' property:

  • It requires defining multiple materials and an orientation relationship between them
  • It's very simple to calculate ... (a_substrate - a_film / a_film)
  • ... but does have associated assumptions

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.

Formalize node types on graph

Current status, graph can have:

  • AbstractModel subclass as node
  • PropertyType as node
  • a Material wrapped in a generic NodeType container
  • materials have additional edges to other data (strings, etc.)

This 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.

Add Crystallographic Quantities

  • Members of planar / direction families.
  • Space Group, Point Group, Bravais Lattice, Enantiomorphic Pairs, Geometric Crystal Class, Bravais Class, Arithmetic Crystal Class, Bravais Arithmetic Crystal Class, Bravais Flock, Lattice System, Crystal System, Crystal Family.
  • Potentially planar symmetry groups of given crystal planes.
  • Symmetry constraints on tensors of the crystal (several orders).
  • Symmetry constraints on the metric tensor of the crystal.
  • Intrinsic translation components of various space group transformations.

semi-empirical thermal conductivity

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

Add Thermodynamic Quantities

  • Energy / Enthalpy of vacancy formation.
  • Large suite of thermodynamic relations (ie. Maxwell relations, cyclic rule, etc. etc.) relating various materials properties. MANY possible thermodynamic relations here.

phonon frequency and long wavelength absorption

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.

Option to include a default value for the property/condition

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.

Add Multi-Material Properties

From Introduction to Materials Science Class:

  • Hume Rothery Miscibility Rules
  • Pilling-Bedworth Ratios (protective oxide prediction)
  • Nordheim's Rule (resistivity as a function of dilute impurity concentration in metals)
  • Reynolds / Hugh Rule (resistivity as a function of concentration in a sub-eutectoid dual-phase field)

Other Ideas:

  • Lattice Misfit
  • Surface Tension at Dissimilar Material Interface?
  • Brewester's Angle (optics)
  • Angle of Total Internal Reflection

Make `Material` MSONable

Before I forget...

Current status of Propnet is essentially two distinct graphs that get merged together + solved:

  • logic graph (property types + models)
  • material graph (material + properties of that material)

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.

MP builder

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.

use of symbols rather than canonical names could be confusing later on

Let's say I have 3 known properties with canonical names:

  • dielectric_constant = 4
  • bulk_modulus = 2
  • shear_modulus = 1

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

dielectric-gap relations

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.

high k dielectric descriptors

See paper

Petousis, I., Mrdjenovich, D., Ballouz, E., Liu, M., Winston, D., Chen, W., Graf, T., Schladt, T. D., Persson, K. A. & Prinz, F. B. High-throughput screening of inorganic compounds for the discovery of novel dielectric and optical materials. Sci. Data 4, 160134 (2017).

screen shot 2018-04-01 at 12 02 49 pm

Add CI

Preferably with flake8 and mypy integrations.

Add existing matminer properties to CPN

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

Redesign model class to better separate data and logic

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.

Relation between Debye T and phosphor efficiency

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

Some code implementation of thermal conductivity models

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.))

Add Mechanical Properties

  • Pierls Nabarro Force
  • Hall Petch Relation
  • Closest Packed Plane / Direction / Slip Systems
  • Schmidt's Law (resolved stress on atomic planes)
  • Tables of Hardness relations and relations to yield stress / ultimate tensile stress

*These may be difficult because some quantities involve knowledge of the burgers vector for the dislocations in the material.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.