Coder Social home page Coder Social logo

mineralscloud / pgm Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 3.0 85.89 MB

Calculate thermodynamic properties of matter using phonon gas model (PGM)

Home Page: https://mineralscloud.github.io/pgm/

License: GNU General Public License v3.0

Python 100.00%
ab-initio anharmonicity python scientific-computing solid-state-physics

pgm's Introduction

pgm: A Python package for free energy calculations within the phonon gas model

Calculate thermodynamic properties of matter using phonon gas model(PGM)

GitHub Actions pypi pypi

Contributors

This repository is authored and maintained by Hongjin Wang and Jingyi Zhuang.

How to cite

The associated paper is published online here.

Please cite this article as:

Hongjin Wang, Jingyi Zhuang, Zhen Zhang, Qi Zhang, Renata M. Wentzcovitch, pgm: A Python package for free energy calculations within the phonon gas model, Computer Physics Communications (2023), Volume 291, 2023, 108845, https://doi.org/10.1016/j.cpc.2023.108845.

If you are unable to access the full text of this article, please contact the authors.

Installation

Install from PyPI

You can install the package directly from PyPI:

$ pip install phonon-gas-model

Manual install

To install the pgm package, first clone the code repository using git:

$ git clone https://github.com/MineralsCloud/pgm.git

After cloning the code repository, change to the code directory using cd:

$ cd pgm

After changing to the code directory, install the required Python packages using pip:

$ pip install -r requirements.txt

Finally, install the pgm package using pip:

$ pip install .

See details in Installation of pgm.

How to use

Here we provide two examples inside the example folder. One is CaSiO₃, and one is B8-FeO.

For the case of CaSiO₃, simply run the following commands from the root path of the package:

$ cd examples/casio3
$ pgm run casio3.yaml

and for another case, B8-FeO,

run the following commands from the root path of the package:

$ cd examples/feo
$ pgm run feo.yaml

See details Command Line Tool of pgm.

Use your own example

First, you need to prepare a set of phonon calculations calculated at different temperatures.

Convert them as standard qha input files(for now use input converter in qha pkg), and put the input files like in the case of CaSiO₃ or B8-FeO

Compose your own settings.yaml file, enjoy.

Details will be provide shortly.

Documentation

See GitHub pages of pgm.

pgm's People

Contributors

jappoker avatar singularitti avatar underhill1886 avatar

Stargazers

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

Watchers

 avatar  avatar

pgm's Issues

Some questions

Dear pgm developers!
I really appreciate idea of the code, however, I've got some issues and questions.

  1. As can we see from the input files in the examples folder, there is S_el = ... variable, which is not written by the conventional qha input maker. Should I add S_el = 0 by hands? Because now pgm drops an error, which I guess is due to the absence of S_el.
  2. In the example .yaml file there is ratio : 1.2 parameter, which is not described in the manual. Could you comment on its meaning?
  3. I am wondering that in the casio3 example pressure range starts just from 0, while in conventional QHA calculations to find the equilibrium volume at P=0 we include some points corresponding to negative pressures... Doesn't pgm require this?

KeyError: 'NV'

environment
google colab

steps

!pip install -U phonon-gas-model
!wget -c https://github.com/MineralsCloud/pgm/blob/master/examples/casio3/casio3.yaml
!wget -c https://github.com/MineralsCloud/pgm/blob/master/examples/feo/feo.yaml

execute
!pgm run casio3.yaml

result

  _ __   __ _ _ __ ___  
 | '_ \ / _` | '_ ` _ \ 
 | |_) | (_| | | | | | |
 | .__/ \__, |_| |_| |_|
 | |     __/ |          
 |_|    |___/           
 Version 1.0.0-a
    
Traceback (most recent call last):
  File "/usr/local/bin/pgm", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pgm/cli/main.py", line 93, in main
    run(settings)
  File "/usr/local/lib/python3.10/dist-packages/pgm/cli/main.py", line 16, in run
    user_settings.read_from_yaml(file_settings)
  File "/usr/local/lib/python3.10/dist-packages/pgm/settings.py", line 76, in read_from_yaml
    self.NV = dic['NV']
KeyError: 'NV'

execute
!pgm run feo.yaml

result

  _ __   __ _ _ __ ___  
 | '_ \ / _` | '_ ` _ \ 
 | |_) | (_| | | | | | |
 | .__/ \__, |_| |_| |_|
 | |     __/ |          
 |_|    |___/           
 Version 1.0.0-a
    
Traceback (most recent call last):
  File "/usr/local/bin/pgm", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pgm/cli/main.py", line 93, in main
    run(settings)
  File "/usr/local/lib/python3.10/dist-packages/pgm/cli/main.py", line 16, in run
    user_settings.read_from_yaml(file_settings)
  File "/usr/local/lib/python3.10/dist-packages/pgm/settings.py", line 76, in read_from_yaml
    self.NV = dic['NV']
KeyError: 'NV'

best regards

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.