Giter Site home page Giter Site logo

materialsvirtuallab / matcalc Goto Github PK

View Code? Open in Web Editor NEW
43.0 7.0 10.0 4.74 MB

A python library for calculating materials properties from the PES

Home Page: https://materialsvirtuallab.github.io/matcalc/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
learning machine materials pes properties

matcalc's Introduction

MatCalc logo
MatCalc

GitHub license Linting Testing codecov Requires Python 3.8+ PyPI

Docs

materialsvirtuallab.github.io/matcalc

Introduction

MatCalc is a Python library for calculating material properties from the potential energy surface (PES). The PES can come from DFT or, more commonly, from machine learning interatomic potentials (MLIPs).

Calculating material properties often requires involved setups of various simulation codes. The goal of MatCalc is to provide a simplified, consistent interface to access these properties with any parameterization of the PES.

Outline

The main base class in MatCalc is PropCalc (property calculator). All PropCalc subclasses should implement a calc(pymatgen.Structure) -> dict method that returns a dictionary of properties.

In general, PropCalc should be initialized with an ML model or ASE calculator, which is then used by either ASE, LAMMPS or some other simulation code to perform calculations of properties.

Cite matcalc

If you use matcalc in your research, see citation.cff or the GitHub sidebar for a BibTeX and APA citation.

matcalc's People

Contributors

dependabot[bot] avatar janosh avatar jiqi535 avatar kenko911 avatar proa200 avatar rul048 avatar shyuep 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

matcalc's Issues

`ElasticityCalc` `norm_strains` and `shear_strains` should default to lists

norm_strains: float = 0.01,

Shouldn't you be able to input a list of normal/shear strain magnitudes? This is standard in elastic constant calculations, and it is also the default in the pymatgen class used to generate the deformations (see https://github.com/materialsproject/pymatgen/blob/bc5edc5960506f28530739f268fdf31752de2bea/pymatgen/analysis/elasticity/strain.py#L117C20-L117C20)

[Bug]: using mace with dispersion results in crash

What happened?

Using "mace" as calculator with dispersion=True results in

)
  cell: Optional[Tensor] = torch.tensor(
Traceback (most recent call last):
  File "/work4/scd/scarf562/ml/LiFePO4/./LiFePO4-NEB.py", line 89, in <module>
    NEBcalc = NEBCalc.from_end_images(
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work4/scd/scarf562/micromamba/micromamba/envs/mace/lib/python3.11/site-packages/matcalc/neb.py", line 110, in from_end_images
    return cls(images=images, calculator=calculator, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work4/scd/scarf562/micromamba/micromamba/envs/mace/lib/python3.11/site-packages/matcalc/neb.py", line 65, in __init__
    atoms.calc = get_universal_calculator(self.calculator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work4/scd/scarf562/micromamba/micromamba/envs/mace/lib/python3.11/site-packages/matcalc/util.py", line 40, in get_universal_calculator
    if name.lower().startswith("m3gnet"):
       ^^^^^^^^^^
AttributeError: 'SumCalculator' object has no attribute 'lower'

Code snippet

calculator_mace = get_universal_calculator("mace", model="large", default_dtype="float64", dispersion=True)

Log output

Traceback (most recent call last):
  File "/work4/scd/scarf562/ml/LiFePO4/./LiFePO4-NEB.py", line 89, in <module>
    NEBcalc = NEBCalc.from_end_images(
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work4/scd/scarf562/micromamba/micromamba/envs/mace/lib/python3.11/site-packages/matcalc/neb.py", line 110, in from_end_images
    return cls(images=images, calculator=calculator, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work4/scd/scarf562/micromamba/micromamba/envs/mace/lib/python3.11/site-packages/matcalc/neb.py", line 65, in __init__
    atoms.calc = get_universal_calculator(self.calculator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work4/scd/scarf562/micromamba/micromamba/envs/mace/lib/python3.11/site-packages/matcalc/util.py", line 40, in get_universal_calculator
    if name.lower().startswith("m3gnet"):
       ^^^^^^^^^^
AttributeError: 'SumCalculator' object has no attribute 'lower'

Elastic properties

To implement calculators for elastic properties in matcalc. Ideally, we need the following:

  1. Bulk modulus (from EOS)
  2. Full elastic tensor
  3. Bulk modulus from elastic tensor
  4. Shear modulus from elastic tensor
  5. Young's modulus

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.