diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..89b2a6a --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,30 @@ +title: matcalc +email: ongsp@ucsd.edu +description: >- # this means to ignore newlines until "baseurl:" + MatCalc is a Python library for calculating materials properties from the potential energy surface (PES). +baseurl: "" +# twitter_username: matcalc +github_username: materialsvirtuallab + +# Build settings +remote_theme: just-the-docs/just-the-docs + +color_scheme: pmg +favicon_ico: /assets/favicon.ico + +aux_links: + API docs: /matcalc + GitHub: https://github.com/materialsvirtuallab/matcalc + Issues: https://github.com/materialsvirtuallab/matcalc/issues + Materials Virtual Lab: https://materialsvirtuallab.org + +# Enable or disable the site search +# Supports true (default) or false +search_enabled: true + +# Split pages into sections that can be searched individually +# Supports 1 - 6, default: 2 +search.heading_level: 6 + +kramdown: + toc_levels: 1..3 diff --git a/docs/assets b/docs/assets new file mode 100644 index 0000000..89d92c6 Binary files /dev/null and b/docs/assets differ diff --git a/docs/changes.md b/docs/changes.md new file mode 100644 index 0000000..e09c943 --- /dev/null +++ b/docs/changes.md @@ -0,0 +1,9 @@ +# Change Log + +## v0.0.2 + +- Minor updates to returned dicts. + +## v0.0.1 + +- First release with all major components. diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..2f20d07 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,364 @@ +"""matcalc documentation build configuration file, created by +sphinx-quickstart on Tue Nov 15 00:13:52 2011. + +This file is execfile()d with the current directory set to its containing dir. + +Note that not all possible configuration values are present in this +autogenerated file. + +All configuration values have a default; values that are commented out +serve to show the default. +""" + +from __future__ import annotations + +import sys + +from matcalc import __file__, __version__ + +project = "matcalc" +copyright = "2023, Materials Virtual Lab" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +# Napoleon is necessary to parse Google style docstrings. Markdown builder allows the generation of markdown output. +# extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "myst_parser", "sphinx_markdown_builder"] +# Add any paths that contain templates here, relative to this directory. + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.linkcode", + "sphinx.ext.mathjax", + "sphinx_markdown_builder", +] +exclude_patterns = ["../**/tests*"] +exclude_dirnames = ["../**/tests*"] +autoclass_content = "both" + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix of source filenames. +source_suffix = ".rst" + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = "index" + +# General information about the project. +project = "matcalc" +copyright = "2023, " + "Materials Virtual Lab" + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = __version__ +# The full version, including alpha/beta/rc tags. +release = __version__ + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +add_module_names = False + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "sphinx_rtd_theme" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +html_theme_path = ["."] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +html_favicon = "favicon.ico" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["assets"] + +html_css_files = [ + "css/custom.css", +] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = "matcalcdoc" + +html_theme_options = { + "canonical_url": "https://matcalc.org", + "logo_only": True, + "display_version": True, + "prev_next_buttons_location": None, + "style_external_links": True, + "style_nav_header_background": "linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)", + "collapse_navigation": True, + "sticky_navigation": True, + "navigation_depth": 4, + "includehidden": True, + "titles_only": False, +} + +html_context = { + "display_github": True, + "github_user": "materialsvirtuallab", + "github_repo": "matcalc", + "github_version": "master", + "conf_py_path": "/docs_rst/", +} + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ("index", "matcalc.tex", "matcalc Documentation", "Materials Virtual Lab", "manual"), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [("index", "matcalc", "matcalc Documentation", ["Materials Virtual Lab"], 1)] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + "index", + "matcalc", + "matcalc Documentation", + "Materials Virtual Lab", + "matcalc", + "One line description of project.", + "Miscellaneous", + ), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + + +# -- Options for Epub output --------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = "matcalc" +epub_author = "Materials Virtual Lab" +epub_publisher = "Materials Virtual Lab" +epub_copyright = copyright + +# The language of the text. It defaults to the language option +# or en if the language is not set. +# epub_language = '' + +# The scheme of the identifier. Typical schemes are ISBN or URL. +# epub_scheme = '' + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# epub_identifier = '' + +# A unique identification for the text. +# epub_uid = '' + +# A tuple containing the cover image and cover page html template filenames. +# epub_cover = () + +# HTML files that should be inserted before the pages created by sphinx. +# The format is a list of tuples containing the path and title. +# epub_pre_files = [] + +# HTML files shat should be inserted after the pages created by sphinx. +# The format is a list of tuples containing the path and title. +# epub_post_files = [] + +# A list of files that should not be packed into the epub file. +# epub_exclude_files = [] + +# The depth of the table of contents in toc.ncx. +# epub_tocdepth = 3 + +# Allow duplicate toc entries. +# epub_tocdup = True + + +def linkcode_resolve(domain, info): + """Resolve function for the linkcode extension. + Thanks to https://github.com/Lasagne/Lasagne/blob/master/docs/conf.py. + """ + + def find_source(): + # try to find the file and line number, based on code from numpy: + # https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286 + obj = sys.modules[info["module"]] + for part in info["fullname"].split("."): + obj = getattr(obj, part) + import inspect + import os + + fn = inspect.getsourcefile(obj) + fn = os.path.relpath(fn, start=os.path.dirname(__file__)) + source, lineno = inspect.getsourcelines(obj) + return fn, lineno, lineno + len(source) - 1 + + if domain != "py" or not info["module"]: + return None + + try: + rel_path, line_start, line_end = find_source() + # __file__ is imported from matcalc.core + filename = f"matcalc/core/{rel_path}#L{line_start}-L{line_end}" + except Exception: + # no need to be relative to core here as module includes full path. + filename = info["module"].replace(".", "/") + ".py" + + return f"https://github.com/materialsvirtuallab/matcalc/blob/v{__version__}/{filename}" diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..042c104 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,37 @@ +--- +layout: default +title: Home +nav_order: 1 +--- + +

+ MatCalc logo + MatCalc +

+ +

+ +[![GitHub license](https://img.shields.io/github/license/materialsvirtuallab/matcalc)](https://github.com/materialsvirtuallab/matcalc/blob/main/LICENSE) +[![Linting](https://github.com/materialsvirtuallab/matcalc/workflows/Linting/badge.svg)](https://github.com/materialsvirtuallab/matcalc/workflows/Linting/badge.svg) +[![Testing](https://github.com/materialsvirtuallab/matcalc/workflows/Testing/badge.svg)](https://github.com/materialsvirtuallab/matcalc/workflows/Testing/badge.svg) +[![codecov](https://codecov.io/gh/materialsvirtuallab/matcalc/branch/main/graph/badge.svg?token=OR7Z9WWRRC)](https://codecov.io/gh/materialsvirtuallab/matcalc) +[![Requires Python 3.8+](https://img.shields.io/badge/Python-3.8+-blue.svg?logo=python&logoColor=white)](https://python.org/downloads) +[![PyPI](https://img.shields.io/pypi/v/matcalc?logo=pypi&logoColor=white)](https://pypi.org/project/matcalc?logo=pypi&logoColor=white) +

+ +## Introduction + +MatCalc is a Python library for calculating materials properties from the potential energy surface (PES). The +PES can be from DFT or, more commonly, from machine learning interatomic potentials (MLIPs). + +Calculating various materials properties can require relatively involved setup 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](https://github.com/search?q=repo%3Amaterialsvirtuallab%2Fmatcalc%20%22(PropCalc)%22) should implement a +`calc(pymatgen.Structure) -> dict` method that returns a dict 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. diff --git a/docs/matcalc.md b/docs/matcalc.md new file mode 100644 index 0000000..3688c71 --- /dev/null +++ b/docs/matcalc.md @@ -0,0 +1,261 @@ +--- +layout: default +title: API Documentation +nav_order: 5 +--- + +# matcalc package + +Calculators for materials properties. + + +## matcalc.base module + +Define basic API. + +### *class* PropCalc + +Bases: `object` + +API for a property calculator. + +#### \_abc_impl *= <_abc._abc_data object>* + +#### *abstract* calc(structure: Structure) + +All PropCalc subclasses should implement a calc method that takes in a pymatgen structure +and returns a dict. The method can return more than one property. + +* **Parameters:** + **structure** – Pymatgen structure. +* **Returns:** + In the form {“prop_name”: value}. +* **Return type:** + dict[str, Any] + +#### calc_many(structures: Sequence[Structure], n_jobs: None | int = None, \*\*kwargs) + +Performs calc on many structures. The return type is a generator given that the calc method can potentially be +expensive. It is trivial to convert the generator to a list/tuple. + +* **Parameters:** + * **structures** – List or generator of Structures. + * **n_jobs** – The maximum number of concurrently running jobs. If -1 all CPUs are used. For n_jobs below -1, + (n_cpus + 1 + n_jobs) are used. None is a marker for unset that will be interpreted as n_jobs=1 + unless the call is performed under a parallel_config() context manager that sets another value for + n_jobs. + * **\*\*kwargs** – Passthrough to joblib.Parallel. +* **Returns:** + Generator of dicts. + +## matcalc.elasticity module + +Calculator for phonon properties. + +### *class* ElasticityCalc(calculator: Calculator, norm_strains: float = 0.01, shear_strains: float = 0.01, fmax: float = 0.1, relax_structure: bool = True) + +Bases: [`PropCalc`](#matcalc.base.PropCalc) + +Calculator for elastic properties. + +* **Parameters:** + * **calculator** – ASE Calculator to use. + * **fmax** – maximum force in the relaxed structure (if relax_structure). + * **norm_strains** – strain value to apply to each normal mode. + * **shear_strains** – strain value to apply to each shear mode. + * **relax_structure** – whether to relax the provided structure with the given calculator. + +#### \_abc_impl *= <_abc._abc_data object>* + +#### calc(structure: Structure) + +Calculates elastic properties of Pymatgen structure with units determined by the calculator. + +* **Parameters:** + **structure** – Pymatgen structure. + +Returns: { +: elastic_tensor: Elastic tensor as a pymatgen ElasticTensor object, + shear_modulus_vrh: Voigt-Reuss-Hill shear modulus based on elastic tensor, + bulk_modulus_vrh: Voigt-Reuss-Hill bulk modulus based on elastic tensor, + youngs_modulus: Young’s modulus based on elastic tensor, + +} + +## matcalc.eos module + +Calculators for EOS and associated properties. + +### *class* EOSCalc(calculator: Calculator, optimizer: Optimizer | str = 'FIRE', max_steps: int = 500, max_abs_strain: float = 0.1, n_points: int = 11, fmax: float = 0.1, relax_structure: bool = True) + +Bases: [`PropCalc`](#matcalc.base.PropCalc) + +Equation of state calculator. + +* **Parameters:** + * **calculator** – ASE Calculator to use. + * **optimizer** (*str* *|* *ase Optimizer*) – The optimization algorithm. Defaults to “FIRE”. + * **max_steps** (*int*) – Max number of steps for relaxation. Defaults to 500. + * **max_abs_strain** (*float*) – The maximum absolute strain applied to the structure. Defaults to 0.1 (10% strain). + * **n_points** (*int*) – Number of points in which to compute the EOS. Defaults to 11. + * **fmax** (*float*) – Max force for relaxation (of structure as well as atoms). + * **relax_structure** – Whether to first relax the structure. Set to False if structures provided are pre-relaxed + with the same calculator. Defaults to True. + +#### \_abc_impl *= <_abc._abc_data object>* + +#### calc(structure: Structure) + +Fit the Birch-Murnaghan equation of state. + +* **Parameters:** + **structure** – pymatgen Structure object. + +Returns: { +: eos: { + : volumes: list[float] in Angstrom^3, + energies: list[float] in eV, +
+ }, + bulk_modulus_bm: Birch-Murnaghan bulk modulus in GPa. + +} + +## matcalc.phonon module + +Calculator for phonon properties. + +### *class* PhononCalc(calculator: Calculator, atom_disp: float = 0.015, supercell_matrix: ArrayLike = ((2, 0, 0), (0, 2, 0), (0, 0, 2)), t_step: float = 10, t_max: float = 1000, t_min: float = 0, fmax: float = 0.1, relax_structure: bool = True) + +Bases: [`PropCalc`](#matcalc.base.PropCalc) + +Calculator for phonon properties. + +* **Parameters:** + * **calculator** – ASE Calculator to use. + * **fmax** – Max forces. This criterion is more stringent than for simple relaxation. + * **atom_disp** – Atomic displacement + * **supercell_matrix** – Supercell matrix to use. Defaults to 2x2x2 supercell. + * **t_step** – Temperature step. + * **t_max** – Max temperature. + * **t_min** – Min temperature. + * **relax_structure** – Whether to first relax the structure. Set to False if structures + provided are pre-relaxed with the same calculator. + +#### \_abc_impl *= <_abc._abc_data object>* + +#### calc(structure: Structure) + +Calculates thermal properties of Pymatgen structure with phonopy. + +* **Parameters:** + **structure** – Pymatgen structure. + +Returns: +{ + +> phonon: Phonopy object with force constants produced +> thermal_properties: + +> > { +> > : temperatures: list of temperatures in Kelvin, +> > free_energy: list of Helmholtz free energies at corresponding temperatures in eV, +> > entropy: list of entropies at corresponding temperatures in eV/K, +> > heat_capacity: list of heat capacities at constant volume at corresponding temperatures in eV/K^2, + +> > } + +} + +### \_calc_forces(calculator: Calculator, supercell: PhonopyAtoms) + +Helper to compute forces on a structure. + +* **Parameters:** + * **calculator** – ASE Calculator + * **supercell** – Supercell from phonopy. +* **Returns:** + forces + +## matcalc.relaxation module + +Relaxation properties. + +### *class* RelaxCalc(calculator: Calculator, optimizer: Optimizer | str = 'FIRE', max_steps: int = 500, traj_file: str | None = None, interval: int = 1, fmax: float = 0.1, relax_cell: bool = True) + +Bases: [`PropCalc`](#matcalc.base.PropCalc) + +Relaxes and computes the relaxed parameters of a structure. + +* **Parameters:** + * **calculator** – ASE Calculator to use. + * **optimizer** (*str* *|* *ase Optimizer*) – The optimization algorithm. Defaults to “FIRE”. + * **max_steps** (*int*) – Max number of steps for relaxation. Defaults to 500. + * **traj_file** (*str* *|* *None*) – File to save the trajectory to. Defaults to None. + * **interval** (*int*) – The step interval for saving the trajectories. Defaults to 1. + * **fmax** (*float*) – Total force tolerance for relaxation convergence. + fmax is a sum of force and stress forces. Defaults to 0.1 (eV/A). + * **relax_cell** (*bool*) – Whether to relax the cell (or just atoms). +* **Raises:** + **ValueError** – If the optimizer is not a valid ASE optimizer. + +#### \_abc_impl *= <_abc._abc_data object>* + +#### calc(structure: Structure) + +Perform relaxation to obtain properties. + +* **Parameters:** + **structure** – Pymatgen structure. + +Returns: { +: final_structure: final_structure, + energy: trajectory observer final energy in eV, + volume: lattice.volume in A^3, + a: lattice.a in A, + b: lattice.b in A, + c: lattice.c in A, + alpha: lattice.alpha in degrees, + beta: lattice.beta in degrees, + gamma: lattice.gamma in degrees, + +} + +### *class* TrajectoryObserver(atoms: Atoms) + +Bases: `object` + +Trajectory observer is a hook in the relaxation process that saves the +intermediate structures. + +Init the Trajectory Observer from a Atoms. + +* **Parameters:** + **atoms** (*Atoms*) – Structure to observe. + +#### save(filename: str) + +Save the trajectory to file. + +* **Parameters:** + **filename** (*str*) – filename to save the trajectory. + +## matcalc.util module + +Some utility methods, e.g., for getting calculators from well-known sources. + +### get_universal_calculator(name: str | Calculator, \*\*kwargs) + +Helper method to get some well-known **universal** calculators. +Imports should be inside if statements to ensure that all models are optional dependencies. +All calculators must be universal, i.e. encompass a wide swath of the periodic table. +Though matcalc can be used with any MLIP, even custom ones, this function is not meant as + +> a list of all MLIPs. +* **Parameters:** + * **name** (*str*) – Name of calculator. + * **\*\*kwargs** – Passthrough to calculator init. +* **Raises:** + **ValueError** – on unrecognized model name. +* **Returns:** + Calculator diff --git a/docs/tutorials/Calculating MLIP properties.md b/docs/tutorials/Calculating MLIP properties.md new file mode 100644 index 0000000..c09fe1d --- /dev/null +++ b/docs/tutorials/Calculating MLIP properties.md @@ -0,0 +1,530 @@ +--- +layout: default +title: Calculating MLIP properties.md +nav_exclude: true +--- + +```python +from matcalc.relaxation import RelaxCalc +from matcalc.phonon import PhononCalc +from matcalc.eos import EOSCalc +from matcalc.elasticity import ElasticityCalc +from matcalc.util import get_universal_calculator +from datetime import datetime +from tqdm import tqdm + +from pymatgen.ext.matproj import MPRester +``` + + +```python +mpr = MPRester() +``` + + /Users/shyue/miniconda3/envs/mavrl/lib/python3.9/site-packages/mp_api/client/mprester.py:182: UserWarning: mpcontribs-client not installed. Install the package to query MPContribs data, or construct pourbaix diagrams: 'pip install mpcontribs-client' + warnings.warn( + + + +```python +mp_data = mpr.materials._search(nelements=2, fields=["material_id", "structure"]) +``` + + + Retrieving MaterialsDoc documents: 0%| | 0/20627 [00:00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
midcompositionnsitestime_relax_M3GNettime_elastic_M3GNettime_eos_M3GNettime_phonon_M3GNetM3GNettime_relax_CHGNettime_elastic_CHGNettime_eos_CHGNettime_phonon_CHGNetCHGNettime_total_M3GNettime_total_CHGNet
0mp-1106268Pr14 Pd6205.0388330.3415462.87767018.464435{'relax': {'final_structure': [[-5.19403841 2...1.8809300.1754650.93600014.569963{'relax': {'final_structure': [[-5.17384363 2...26.72248417.562358
1mp-974315Ru2 I240.7735360.1792191.0705392.316252{'relax': {'final_structure': [[ 1.84542095 -1...1.1601280.0898490.4372772.086802{'relax': {'final_structure': [[ 1.65819622 -0...4.3395463.774056
2mp-1206714Al2 Sn130.1676870.1157950.2240740.234789{'relax': {'final_structure': [[1.59915279 1.5...0.0794180.0374100.0901260.148499{'relax': {'final_structure': [[1.7730046 1.7...0.7423450.355453
3mp-30339Er1 Ag230.1035800.1861560.5958750.667356{'relax': {'final_structure': [[ 8.89873414e-0...0.0991270.0447740.6265110.447964{'relax': {'final_structure': [[6.55745455e-08...1.5529671.218376
4mp-696Si4 Pt480.8848840.3210634.6997287.904360{'relax': {'final_structure': [[0.89916847 3.8...3.0560380.2554164.0779603.434237{'relax': {'final_structure': [[1.0806827 3.8...13.81003510.823651
5mp-866222Ac2 Si683.1001280.2539950.8239626.351784{'relax': {'final_structure': [[-5.41563953e-0...0.2668550.1484240.5975665.063765{'relax': {'final_structure': [[-7.10695448e-0...10.5298696.076610
6mp-11422Gd1 Hg120.0780040.1163290.1684640.172210{'relax': {'final_structure': [[0. 0. 0.] Gd, ...0.0383910.0335960.0554060.109223{'relax': {'final_structure': [[ 1.26072246e-0...0.5350070.236616
7mp-21238Th4 Si480.7559270.2032861.4787112.996610{'relax': {'final_structure': [[1.08960316 0.7...0.2014970.1034881.1545571.503147{'relax': {'final_structure': [[1.0389477 0.7...5.4345342.962689
8mp-1215363Zr4 Pd150.2727510.2060091.2016482.377837{'relax': {'final_structure': [[1.68717563e-07...0.2106000.1248400.4599931.993330{'relax': {'final_structure': [[1.04751628e-06...4.0582452.788763
9mp-1212658Ga1 C670.6287000.2374541.2951003.996263{'relax': {'final_structure': [[-1.88279105e-0...1.8732890.1998981.0644034.189688{'relax': {'final_structure': [[-6.66235219e-0...6.1575177.327278
10mp-1101922Eu4 Fe8121.7285440.4205621.8291216.689619{'relax': {'final_structure': [[-2.87170119e-0...1.9397940.2142201.4401526.306060{'relax': {'final_structure': [[4.98291305e-04...10.6678469.900226
11mp-1183610Ca2 Sm680.5027530.2395880.7049320.858113{'relax': {'final_structure': [[3.63931889 2.1...0.1284530.0582290.1354670.982124{'relax': {'final_structure': [[3.78035221 2.1...2.3053861.304273
12mp-1187980Yb6 Pb280.4346600.1669100.6857160.849555{'relax': {'final_structure': [[2.0021903 1.1...0.1579950.0445240.1221181.047720{'relax': {'final_structure': [[1.91249449 1.1...2.1368411.372357
13mp-1187953Yb3 Pb140.1875640.1201730.2180630.192944{'relax': {'final_structure': [[2.84492250e-09...0.0481100.0464920.0731630.093079{'relax': {'final_structure': [[1.78586414e-09...0.7187440.260844
14mp-1185577Cs2 Hg680.2078660.1902340.4352081.504534{'relax': {'final_structure': [[1.97069239e-05...0.1558790.0588243.7723191.030184{'relax': {'final_structure': [[2.13005453e-05...2.3378425.017206
15mp-570436Ca2 Ir460.2300310.2622200.3850670.766176{'relax': {'final_structure': [[2.33205448 1.6...0.1603860.1388790.2856401.973823{'relax': {'final_structure': [[2.32066406 1.6...1.6434942.558728
16mp-1184183Cu1 Ge340.3395470.1771240.3201890.642880{'relax': {'final_structure': [[-9.97837602e-0...0.2525910.2510990.3151711.908043{'relax': {'final_structure': [[ 1.15179087e-0...1.4797402.726904
17mp-1025440Cu2 Ge680.3128630.2433990.8315791.779199{'relax': {'final_structure': [[2.17845727 1.2...0.9023310.1410781.1173334.821146{'relax': {'final_structure': [[2.06660372 1.1...3.1670406.981888
18mp-1184147Cu2 Ge681.4660850.2790861.3486337.323365{'relax': {'final_structure': [[ 3.87471272 -2...0.4408010.1832261.1442643.075049{'relax': {'final_structure': [[ 3.65967384 -2...10.4171694.843340
19mp-1187368Tb2 Mn685.8263070.3170861.6020823.894644{'relax': {'final_structure': [[3.13273031 1.8...0.6260250.1911461.2592794.358320{'relax': {'final_structure': [[3.08463436 1.7...11.6401196.434770
+ + + + + +```python +ax = df.plot(x="nsites", y="time_relax_M3GNet", kind="scatter") +``` + + + +![png](assets/Calculating%20MLIP%20properties_8_0.png) + + + + +```python +ax = df["time_total_M3GNet"].hist() +ax = df["time_total_CHGNet"].hist() +``` + + + +![png](assets/Calculating%20MLIP%20properties_9_0.png) diff --git a/tasks.py b/tasks.py index 7a9dc5b..9f308be 100644 --- a/tasks.py +++ b/tasks.py @@ -64,10 +64,12 @@ def make_docs(ctx): make_tutorials(ctx) with cd("docs"): + ctx.run("cp ../README.md index.md", warn=True) ctx.run("rm matcalc.*.rst", warn=True) ctx.run("sphinx-apidoc -P -M -d 6 -o . -f ../matcalc") # ctx.run("rm matcalc*.html", warn=True) # ctx.run("sphinx-build -b html . ../docs") # HTML building. + ctx.run("cp modules.rst index.rst") ctx.run("sphinx-build -M markdown . .") ctx.run("rm *.rst", warn=True) ctx.run("cp markdown/matcalc*.md .")