qha

A Python package for calculating thermodynamic properties under quasi-harmonic approximation, using data from ab-initio calculations

https://github.com/mineralscloud/qha

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: sciencedirect.com
  • Committers with academic emails
    1 of 7 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.4%) to scientific vocabulary

Keywords

ab-initio phonon python3 quasi-harmonic-approximation scientific-computing thermodynamic-properties

Keywords from Contributors

materials-science
Last synced: 4 months ago · JSON representation ·

Repository

A Python package for calculating thermodynamic properties under quasi-harmonic approximation, using data from ab-initio calculations

Basic Info
Statistics
  • Stars: 30
  • Watchers: 3
  • Forks: 15
  • Open Issues: 7
  • Releases: 22
Topics
ab-initio phonon python3 quasi-harmonic-approximation scientific-computing thermodynamic-properties
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

qha: A Powerful Python toolkit for quasi-harmonic approximation

[TOC]

Stable docs Build Status PyPI Downloads

Contributors

This repository is now maintained by Qi Zhang. Thanks to the contribution from Chenxing Luo.

How to cite

The associated paper is published on Computer Physics Communications.

Please cite this article as: T. Qin, Q. Zhang, R.M. Wentzcovitch et al., qha: A Python package for quasiharmonic free energy calculation for multi-configuration systems, Computer Physics Communications (2018), https://doi.org/10.1016/j.cpc.2018.11.003.

Quick start: installation

Python environment

qha is written in Python, and can be installed from Python package index (PyPI) or local source files.

Python 3 can be downloaded from its official website for systems including Windows, macOS, and Linux, please check more details on Python 3 documentation.

To install qha, currently, Python 3.6.x distributions are recommended.

Where to get it

Binary installers for the latest released version are available at the PyPI.

```shell

use PyPI

$ pip install qha ```

Dependencies

Installation from sources

The source code is currently hosted on GitHub. Please go to the “releases” page to download the tagged releases. Unzip the downloaded sources, go to the top-level directory (e.g., /path/to/repo/qha), run

shell $ pip install .

Notice that you have to use Python version > 3.6.x to install. If you want to install qha in development mode, instead run

shell $ pip install -e .

Checking the examples

To run the examples, go to examples/ice VII/ or examples/silicon/ directories and type in terminal:

shell $ qha run /path/to/settings.yaml

If you want to plot your results, in the same folder, run

shell $ qha plot /path/to/settings.yaml

Structure of the qha package

The qha source code consists of three major parts.

  1. ./qha directory contains all the source code.

  2. ./examples directory contains two examples, ./examples/silicon is the example for single-configuration calculation, ./examples/ice VII is the example for multi-configuration calculation.

The brief of the organization of these directories follows as below:

The main folder ./

This main folder contains three folders, license file, readme file, and setup file.

LICENSE.txt: The license file attached with the qha code;

README.md: Readme file of the code, it would be better to view it in a Markdown editor, e.g., Typora;

setup.py: setup file needed for installation of the qha Python package.

The ./qha/ folder

qha/__init__.py: Tells Python interpreter that this is a Python package;

qha/calculator.py: Perform single-, multi-configuration calculations, one of the most crucial modules in this code;

qha/fitting.py: Perform the Birch—Murnaghan (BM) equation-of-state (EOS) fitting;

qha/grid_interpolation.py: Find the most suitable volume grid to perform the BM EOS fitting;

qha/plotting.py: A simple module to plot the calculated physical properties;

qha/settings.py: Define some computational settings for the calculation;

qha/single_configuration.py: Calculate the Helmholtz free energy for a single-configuration system;

qha/statmech.py: Define some useful statistical mechanics functions;

qha/thermodynamics.py: Derive the internal energy($U$), enthalpy($H$), and Gibbs free energy ($G$) from the calculated Helmholtz free energy ($F$) via basic thermodynamics relationship;

qha/tools.py: Define some miscellaneous functions used in the code, e.g., function used to perform Lagrange interpolation;

qha/type_aliases.py: Define some types for annotation in the code;

qha/unit_conversion.py: A module to convert units used in the calculation;

qha/v2p.py: Contain the function v2p used to convert calculated properties on $(T, V)$ grid to $(T, P)$ grid;

qha/input_maker.py: Generate the input file for qha from results obtained from ab initio calculation;

qha/out.py: Functions used to write calculated properties into files.

The ./qha/readers folder

qha/readers/__init__.py

qha/readers/read_input.py: This module is used to read the input file.

The ./qha/cli folder

This folder contains files used for the command-line interface.

qha/cli/__init__.py

qha/cli/converter.py

qha/cli/handler.py

qha/cli/parser.py

qha/cli/plotter.py

qha/cli/runner.py

The ./qha/multi_configurations folder

This folder contains files to calculate Helmholtz free energy for the multi-configuration system.

qha/multi_configurations/__init__.py

qha/multi_configurations/different_phonon_dos.py: Work with qha/calculator.py to calculate Helmholtz free energy for the multi-configuration system with different phonon density of states (VDOS) for each configuration;

qha/multi_configurations/same_phonon_dos.py: Work with qha/calculator.py to calculate Helmholtz free energy for multi-configuration system with the same VDOS for all configurations.

The ./qha/tests folder

this folder contains unit test files

qha/tests/__init__.py

qha/tests/test_overall_run.py

qha/tests/test_read_input.py

qha/tests/test_samevdos_overall.py

qha/tests/test_single_configuration.py

qha/tests/test_unit_conversion.py

The ./examples/ folder

This folder contains two examples for demonstration purpose.

The ./examples/silicon folder

This folder conations an example to perform the single-configuration calculation. Also, an example to generate the input file for the qha code is included, check examples/silicon/make_input/README for details;

examples/silicon/input: The input file for qha;

examples/silicon/settings.yaml: This file is the computational settings file.

The ./examples/ice VII folder

examples/ice VII/input_01 : input_01 through input_52 are the input files of 52 distinguish configurations; examples/ice VII/input_02 examples/ice VII/input_03 examples/ice VII/input_52

examples/ice VII/settings.yaml: This file is the computational settings file, see our online tutorial for more details.

License

GNU General Public License v3

Documentation

The official documentation is hosted on our GitHub page.

Stargazers over time

Stargazers over time

Owner

  • Name: Minerals Cloud
  • Login: MineralsCloud
  • Kind: organization
  • Email: mineralscloudcu@gmail.com
  • Location: Columbia University, New York, NY, USA

Investigates minerals in the cloud

Citation (CITATIONS.bib)

@article{QIN2019199,
title = {qha: A Python package for quasiharmonic free energy calculation for multi-configuration systems},
journal = {Computer Physics Communications},
volume = {237},
pages = {199-207},
year = {2019},
issn = {0010-4655},
doi = {https://doi.org/10.1016/j.cpc.2018.11.003},
url = {https://www.sciencedirect.com/science/article/pii/S0010465518303953},
author = {Tian Qin and Qi Zhang and Renata M. Wentzcovitch and Koichiro Umemoto},
keywords = {Quasi-harmonic approximation, Multi-configuration, Thermodynamic properties},
abstract = {In this work, we present a Python package, qha, which can calculate the equation of state and various thermodynamic properties of both single- and multi-configuration crystalline materials within a user-specified pressure and temperature range in the framework of the quasi-harmonic approximation (QHA). Two examples, one for single-configuration calculation and the other for multi-configuration calculation, are also distributed along with source code. Apart from its versatility, qha has been tested to be both accurate and computationally efficient.
Program summary
Program Title: qha Program Files doi: http://dx.doi.org/10.17632/rz42b97px5.1 Licensing provisions: GPLv3 Programming language: Python3 Nature of problem: Calculations of thermodynamic properties of dynamically stable and structurally disordered solids, e.g., H-disordered phases of H2O-ice, solid solutions, defects with multiple possible configurations need to sample the phase space of all relevant configurations. These calculations start from a calculation of the partition function, which includes all structural and vibrational states and from which the Helmholtz free energy and all thermodynamics properties are derived within the quasi-harmonic approximations for a user-defined temperature and pressure range. Solution method: The method involves the calculation of the partition function of a harmonic oscillator along with the calculated energy and vibrational spectra of multiple crystalline configurations to derive the Helmholtz free energy F(Vi,Tj), where i labels the discrete set of volumes and j labels ionic temperature. The free energy is then fit to temperature-dependent finite-strain equations of state from which all thermodynamic properties can be derived. Additional comments including restrictions and unusual features: The package contains executable scripts that can be run directly in the command line given input data and a computational settings file. It can also be separated into stand-alone modules for incorporating into other programs. Though the package is written in Python, it does not seem to be slow since the just-in-time (JIT) compilation technique is used to improve its performance significantly.}
}

GitHub Events

Total
  • Issues event: 1
  • Watch event: 5
  • Issue comment event: 3
  • Push event: 4
  • Pull request event: 1
  • Fork event: 3
Last Year
  • Issues event: 1
  • Watch event: 5
  • Issue comment event: 3
  • Push event: 4
  • Pull request event: 1
  • Fork event: 3

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 363
  • Total Committers: 7
  • Avg Commits per committer: 51.857
  • Development Distribution Score (DDS): 0.187
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Qi Zhang s****i@o****m 295
tianqin91 t****1@g****m 51
Chazeon c****o@g****m 6
Qi q****0@c****u 5
Restyled.io c****s@r****o 4
zhenzhang305 z****5@h****m 1
underhill1886 e****5@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 27
  • Total pull requests: 74
  • Average time to close issues: 5 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 4
  • Total pull request authors: 6
  • Average comments per issue: 1.96
  • Average comments per pull request: 0.19
  • Merged pull requests: 57
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • singularitti (17)
  • chazeon (8)
  • tianqin91 (1)
  • stanroozen (1)
Pull Request Authors
  • singularitti (34)
  • tianqin91 (15)
  • chazeon (14)
  • restyled-io[bot] (7)
  • underhill1886 (4)
  • wantianqi2009 (1)
Top Labels
Issue Labels
dependencies (7) enhancement (4) bug (4) docs (3) versioning (2) io (2) command-line (2) compatibility (1) API (1) CI (1) warning (1) test (1) numeric errors (1) Python (1) examples (1) docker (1)
Pull Request Labels
bug (2) io (1) enhancement (1) versioning (1) obsolete (1) plugin (1) command-line (1)

Dependencies

setup.py pypi
  • lazy_property *
  • matplotlib *
  • mpmath *
  • numba *
  • numpy *
  • pandas *
  • pyyaml *
  • scientific-string *
  • scipy *
  • seaborn *
  • text-stream *