packaging-extrapolation


Namepackaging-extrapolation JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryExtrapolation methods for complete basis sets
upload_time2024-04-28 13:15:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT License Copyright (c) [2023] [ZhaoKai Xi] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords basis set extrapolation quantum chemistry
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            --------------------------------------------------------------------------------
<span style="font-size:larger;">packaging-extrapolation Manual</span>
========
![Static Badge](https://img.shields.io/badge/Extrapolation_method-blue)
![Static Badge](https://img.shields.io/badge/Quantum_Chemistry-red)
![Static Badge](https://img.shields.io/badge/Basis_set-green)
![doi](https://img.shields.io/badge/Chemical_energy-yellow)

## About

* This package contains partial extrapolation methods in quantum chemistry, written using the extrapolation method proposed in the literature. Extrapolation to the CBS limit can be done by entering two successive energies.

## Quickly Use

* Please use the `pip` command to install: `pip install packaging-extrapolation` or `python3 -m pip install packaging-extrapolation`
* Please make sure the package is the latest: `pip install --upgrade packaging_extrapolation`
* After installation, test the example in `src/packaging_extrapolation/examples/examples_energy.py` to see if you get results.
  * Extrapolation Method Calls: `python  examples_energy.py -m "Klopper_1986" -xe -76.0411795 -ye -76.0603284 -low 2 -high 3 -a 4.25`
  * `-m`: extrapolation method name.
  * `-xe`: energy for E(X).
  * `-ye`: energy for E(Y).
  * `-low`: cardinal number for X.
  * `-high`: cardinal number for Y.
  * `-a`: extrapolation parameter alpha/beta.

## Ten Extrapolation Schemes

| Method                      | Two-point From                                               | Name            |                          Reference                           |
| :-------------------------- | :----------------------------------------------------------- | --------------- | :----------------------------------------------------------: |
| Klopper-1986                | $E_{CBS}=\frac{E(Y)e^{-α\sqrt{X}}-E(X)e^{-α\sqrt{Y}}}{e^{-α\sqrt{X}}-e^{-α\sqrt{Y}}}$ | `Klopper_1986`  | [https://doi.org/10.1016/0166-1280(86)80068-9](https://doi.org/10.1016/0166-1280(86)80068-9) |
| Feller-1992                 | $E_{CBS}=\frac{E(Y)e^{-αX}-E(X)e^{-αY}}{e^{-αX}-e^{-αY}}$    | `Feller_1992`   | [https://doi.org/10.1063/1.462652](https://doi.org/10.1063/1.462652) |
| Truhlar-1998 (Hartree-Fock) | $E_{CBS}=\frac{E(Y)X^{-\alpha}-E(X)Y^{-\alpha}}{X^{-\alpha}-Y^{-\alpha}}$ | `Truhlar_1998`  | [https://doi.org/10.1016/S0009-2614(98)00866-5](https://doi.org/10.1016/S0009-2614(98)00866-5) |
| Jensen-2001                 | $E_{CBS}=\frac{E(Y)(X+1)e^{-α\sqrt{X}}-E(X)(Y+1))e^{-α\sqrt{Y}}}{(X+1)e^{-α\sqrt{X}}-(Y+1)e^{-α\sqrt{Y}}}$ | `Jensen_2001`   |              https://doi.org/10.1063/1.1413524               |
| Schwenke-2005               | $E_{CBS}=[E(Y)-E(X)]\alpha+E(X)$                             | `Schwenke_2005` |              https://doi.org/10.1063/1.1824880               |
| Martin-1996                 | $E_{CBS}=\frac{E(Y)(X+1/2)^{-\beta}-E(X)(Y+1/2)^{-\beta}}{(X+1/2)^{-\beta}-(Y+1/2)^{-\beta}}$ | `Martin_1996`   |         https://doi.org/10.1016/0009-2614(96)00898-6         |
| Truhlar-1998 (Correlation)  | $E_{CBS}=\frac{E(Y)X^{-\beta}-E(X)Y^{-\beta}}{X^{-\beta}-Y^{-\beta}}$ | `Truhlar_1998`  | [https://doi.org/10.1016/S0009-2614(98)00866-5](https://doi.org/10.1016/S0009-2614(98)00866-5) |
| Huh-2003                    | $E_{CBS}=\frac{E(Y)(X+\beta)^{-3}-E(X)(Y+\beta)^{-3}}{(X+\beta)^{-3}-(Y+\beta)^{-3}}$ | `HuhLee_2003`   |              https://doi.org/10.1063/1.1534091               |
| Bakowies-2007               | $E_{CBS}=\frac{E(Y)(X+1)^{-\beta}-E(X)(Y+1)^{-\beta}}{(X+1)^{-\beta}-(Y+1)^{-\beta}}$ | `Bkw_2007`      |              https://doi.org/10.1063/1.2749516               |
| OAN(C)                      | $E_{CBS}=\frac{3^3E(Y)-\beta^3E(X)}{3^3-\beta^3}$            | `OAN_C`         |              https://doi.org/10.1002/jcc.23896               |



## Another Use

* If you need to calculate the extrapolation energy of more systems, please refer to the following examples:

```python
from packaging_extrapolation import UtilTools
from packaging_extrapolation.Extrapolation import FitMethod
import pandas as pd
import numpy as np

"""
Calculate more systems.
"""

if __name__ == "__main__":
    # Input file.
    data = pd.read_csv('../data/hf.CSV')

    # Extrapolation model.
    model = FitMethod()
    # The E(X) and E(Y).
    x_energy_list, y_energy_list = data['aug-cc-pvdz'], data['aug-cc-pvtz']
    # Using Klopper-1986 method and alpha=4.25, extrapolate to the CBS limit at the AV {D, T}Z basis set pair.
    low_card, high_card, alpha, method_name = 2, 3, 4.25, 'Klopper_1986'
    result = UtilTools.train_alpha(model=model,
                                   method=method_name,
                                   x_energy_list=x_energy_list,
                                   y_energy_list=y_energy_list,
                                   low_card=low_card,
                                   high_card=high_card,
                                   alpha=alpha)
    for i in range(len(result)):
        print(result[i], 'Eh')
    df = pd.DataFrame()
    df['CBS Energy'] = result
    # Output file.
    df.to_csv('CBS_Energy.csv', index=False)
```

* The input file should be in `.csv` format and have the following content:

```python
mol,aug-cc-pvdz,aug-cc-pvtz
HCN,-92.8880397,-92.9100033
HCO,-113.2672513,-113.2947633
HNO,-129.8114596,-129.8401888
HO2,-150.2024221,-150.239531
N2O,-183.7105405,-183.7530387
NH2,-55.5749363,-55.5878344
NH3,-56.1972947,-56.2127423
NO2,-204.0664514,-204.1137363
```



| Functions                                                                                                                                                                                       |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `UtilTools.calc_MAD(y_true, y_pred)`: Calculate the Mean Absolute Deviation (kcal/mol).                                                                                                         |
| `UtilTools.calc_max_MAD(y_true, y_pred)`: Calculate the Maximum Absolute Deviation (kcal/mol).                                                                                                  |
| `UtilTools.calc_min_MAD(y_true, y_pred)`: Calculate the Minimum Absolute Deviation (kcal/mol).                                                                                                  |
| `UtilTools.calc_RMSE(y_true, y_pred)`: Calculate the Root Mean Square Deviation (kcal/mol).                                                                                                     |
| `UtilTools.calc_MSD(y_true, y_pred)`: Calculate the Mean Square Deviation (kcal/mol).                                                                                                           |
| `UtilTools.calc_MaxPosMAD(y_true, y_pred)`: Calculate the Maximum Positive Deviation (kcal/mol).                                                                                                |
| `UtilTools.train_alpha(*,  model, method, x_energy_list, y_energy_list, alpha, low_card, high_card)`: Calculate extrapolated energy.                                                            |
| `UtilLog.extract_energy(input_path, output_path)`: Extracting energy from many log files.                                                                                                       |
| `UtilLog.train_all(*, model, method, x_energy_list, y_energy_list, low_card, high_card, limit_list, init_guess=0.001, temp='RMSD')` : Optimizing extrapolation parameters with `RMSD` or `MAD`. |




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "packaging-extrapolation",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "basis set, extrapolation, quantum chemistry",
    "author": null,
    "author_email": "ZHAOKAI XI <xizaokaiz@foxmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/cc/7d/87f6d6264dfbc5c9e962d28be70d9269390cbb3a66ed630f5a5d1513f320/packaging-extrapolation-1.0.2.tar.gz",
    "platform": null,
    "description": "--------------------------------------------------------------------------------\r\n<span style=\"font-size:larger;\">packaging-extrapolation Manual</span>\r\n========\r\n![Static Badge](https://img.shields.io/badge/Extrapolation_method-blue)\r\n![Static Badge](https://img.shields.io/badge/Quantum_Chemistry-red)\r\n![Static Badge](https://img.shields.io/badge/Basis_set-green)\r\n![doi](https://img.shields.io/badge/Chemical_energy-yellow)\r\n\r\n## About\r\n\r\n* This package contains partial extrapolation methods in quantum chemistry, written using the extrapolation method proposed in the literature. Extrapolation to the CBS limit can be done by entering two successive energies.\r\n\r\n## Quickly Use\r\n\r\n* Please use the `pip` command to install: `pip install packaging-extrapolation` or `python3 -m pip install packaging-extrapolation`\r\n* Please make sure the package is the latest: `pip install --upgrade packaging_extrapolation`\r\n* After installation, test the example in `src/packaging_extrapolation/examples/examples_energy.py` to see if you get results.\r\n  * Extrapolation Method Calls: `python  examples_energy.py -m \"Klopper_1986\" -xe -76.0411795 -ye -76.0603284 -low 2 -high 3 -a 4.25`\r\n  * `-m`: extrapolation method name.\r\n  * `-xe`: energy for E(X).\r\n  * `-ye`: energy for E(Y).\r\n  * `-low`: cardinal number for X.\r\n  * `-high`: cardinal number for Y.\r\n  * `-a`: extrapolation parameter alpha/beta.\r\n\r\n## Ten Extrapolation Schemes\r\n\r\n| Method                      | Two-point From                                               | Name            |                          Reference                           |\r\n| :-------------------------- | :----------------------------------------------------------- | --------------- | :----------------------------------------------------------: |\r\n| Klopper-1986                | $E_{CBS}=\\frac{E(Y)e^{-\u03b1\\sqrt{X}}-E(X)e^{-\u03b1\\sqrt{Y}}}{e^{-\u03b1\\sqrt{X}}-e^{-\u03b1\\sqrt{Y}}}$ | `Klopper_1986`  | [https://doi.org/10.1016/0166-1280(86)80068-9](https://doi.org/10.1016/0166-1280(86)80068-9) |\r\n| Feller-1992                 | $E_{CBS}=\\frac{E(Y)e^{-\u03b1X}-E(X)e^{-\u03b1Y}}{e^{-\u03b1X}-e^{-\u03b1Y}}$    | `Feller_1992`   | [https://doi.org/10.1063/1.462652](https://doi.org/10.1063/1.462652) |\r\n| Truhlar-1998 (Hartree-Fock) | $E_{CBS}=\\frac{E(Y)X^{-\\alpha}-E(X)Y^{-\\alpha}}{X^{-\\alpha}-Y^{-\\alpha}}$ | `Truhlar_1998`  | [https://doi.org/10.1016/S0009-2614(98)00866-5](https://doi.org/10.1016/S0009-2614(98)00866-5) |\r\n| Jensen-2001                 | $E_{CBS}=\\frac{E(Y)(X+1)e^{-\u03b1\\sqrt{X}}-E(X)(Y+1))e^{-\u03b1\\sqrt{Y}}}{(X+1)e^{-\u03b1\\sqrt{X}}-(Y+1)e^{-\u03b1\\sqrt{Y}}}$ | `Jensen_2001`   |              https://doi.org/10.1063/1.1413524               |\r\n| Schwenke-2005               | $E_{CBS}=[E(Y)-E(X)]\\alpha+E(X)$                             | `Schwenke_2005` |              https://doi.org/10.1063/1.1824880               |\r\n| Martin-1996                 | $E_{CBS}=\\frac{E(Y)(X+1/2)^{-\\beta}-E(X)(Y+1/2)^{-\\beta}}{(X+1/2)^{-\\beta}-(Y+1/2)^{-\\beta}}$ | `Martin_1996`   |         https://doi.org/10.1016/0009-2614(96)00898-6         |\r\n| Truhlar-1998 (Correlation)  | $E_{CBS}=\\frac{E(Y)X^{-\\beta}-E(X)Y^{-\\beta}}{X^{-\\beta}-Y^{-\\beta}}$ | `Truhlar_1998`  | [https://doi.org/10.1016/S0009-2614(98)00866-5](https://doi.org/10.1016/S0009-2614(98)00866-5) |\r\n| Huh-2003                    | $E_{CBS}=\\frac{E(Y)(X+\\beta)^{-3}-E(X)(Y+\\beta)^{-3}}{(X+\\beta)^{-3}-(Y+\\beta)^{-3}}$ | `HuhLee_2003`   |              https://doi.org/10.1063/1.1534091               |\r\n| Bakowies-2007               | $E_{CBS}=\\frac{E(Y)(X+1)^{-\\beta}-E(X)(Y+1)^{-\\beta}}{(X+1)^{-\\beta}-(Y+1)^{-\\beta}}$ | `Bkw_2007`      |              https://doi.org/10.1063/1.2749516               |\r\n| OAN(C)                      | $E_{CBS}=\\frac{3^3E(Y)-\\beta^3E(X)}{3^3-\\beta^3}$            | `OAN_C`         |              https://doi.org/10.1002/jcc.23896               |\r\n\r\n\r\n\r\n## Another Use\r\n\r\n* If you need to calculate the extrapolation energy of more systems, please refer to the following examples:\r\n\r\n```python\r\nfrom packaging_extrapolation import UtilTools\r\nfrom packaging_extrapolation.Extrapolation import FitMethod\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\n\"\"\"\r\nCalculate more systems.\r\n\"\"\"\r\n\r\nif __name__ == \"__main__\":\r\n    # Input file.\r\n    data = pd.read_csv('../data/hf.CSV')\r\n\r\n    # Extrapolation model.\r\n    model = FitMethod()\r\n    # The E(X) and E(Y).\r\n    x_energy_list, y_energy_list = data['aug-cc-pvdz'], data['aug-cc-pvtz']\r\n    # Using Klopper-1986 method and alpha=4.25, extrapolate to the CBS limit at the AV {D, T}Z basis set pair.\r\n    low_card, high_card, alpha, method_name = 2, 3, 4.25, 'Klopper_1986'\r\n    result = UtilTools.train_alpha(model=model,\r\n                                   method=method_name,\r\n                                   x_energy_list=x_energy_list,\r\n                                   y_energy_list=y_energy_list,\r\n                                   low_card=low_card,\r\n                                   high_card=high_card,\r\n                                   alpha=alpha)\r\n    for i in range(len(result)):\r\n        print(result[i], 'Eh')\r\n    df = pd.DataFrame()\r\n    df['CBS Energy'] = result\r\n    # Output file.\r\n    df.to_csv('CBS_Energy.csv', index=False)\r\n```\r\n\r\n* The input file should be in `.csv` format and have the following content:\r\n\r\n```python\r\nmol,aug-cc-pvdz,aug-cc-pvtz\r\nHCN,-92.8880397,-92.9100033\r\nHCO,-113.2672513,-113.2947633\r\nHNO,-129.8114596,-129.8401888\r\nHO2,-150.2024221,-150.239531\r\nN2O,-183.7105405,-183.7530387\r\nNH2,-55.5749363,-55.5878344\r\nNH3,-56.1972947,-56.2127423\r\nNO2,-204.0664514,-204.1137363\r\n```\r\n\r\n\r\n\r\n| Functions                                                                                                                                                                                       |\r\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `UtilTools.calc_MAD(y_true, y_pred)`: Calculate the Mean Absolute Deviation (kcal/mol).                                                                                                         |\r\n| `UtilTools.calc_max_MAD(y_true, y_pred)`: Calculate the Maximum Absolute Deviation (kcal/mol).                                                                                                  |\r\n| `UtilTools.calc_min_MAD(y_true, y_pred)`: Calculate the Minimum Absolute Deviation (kcal/mol).                                                                                                  |\r\n| `UtilTools.calc_RMSE(y_true, y_pred)`: Calculate the Root Mean Square Deviation (kcal/mol).                                                                                                     |\r\n| `UtilTools.calc_MSD(y_true, y_pred)`: Calculate the Mean Square Deviation (kcal/mol).                                                                                                           |\r\n| `UtilTools.calc_MaxPosMAD(y_true, y_pred)`: Calculate the Maximum Positive Deviation (kcal/mol).                                                                                                |\r\n| `UtilTools.train_alpha(*,  model, method, x_energy_list, y_energy_list, alpha, low_card, high_card)`: Calculate extrapolated energy.                                                            |\r\n| `UtilLog.extract_energy(input_path, output_path)`: Extracting energy from many log files.                                                                                                       |\r\n| `UtilLog.train_all(*, model, method, x_energy_list, y_energy_list, low_card, high_card, limit_list, init_guess=0.001, temp='RMSD')` : Optimizing extrapolation parameters with `RMSD` or `MAD`. |\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) [2023] [ZhaoKai Xi]  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Extrapolation methods for complete basis sets",
    "version": "1.0.2",
    "project_urls": {
        "Repository": "https://github.com/xizaokaiz/packaging_extrapolation.git"
    },
    "split_keywords": [
        "basis set",
        " extrapolation",
        " quantum chemistry"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d1288899d6be89e11104df473e9a390ad93c860570afbc78b27f3c8eed340580",
                "md5": "ed7a912c7bf2eea897122af3bb548008",
                "sha256": "2f0f234173c841ba608c831c9a42b928ba5e395eb9ab5df1246c0ec809f01239"
            },
            "downloads": -1,
            "filename": "packaging_extrapolation-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed7a912c7bf2eea897122af3bb548008",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 12786,
            "upload_time": "2024-04-28T13:15:19",
            "upload_time_iso_8601": "2024-04-28T13:15:19.052814Z",
            "url": "https://files.pythonhosted.org/packages/d1/28/8899d6be89e11104df473e9a390ad93c860570afbc78b27f3c8eed340580/packaging_extrapolation-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc7d87f6d6264dfbc5c9e962d28be70d9269390cbb3a66ed630f5a5d1513f320",
                "md5": "c0a1c01dcedbe6f55b098c09eb1e75a5",
                "sha256": "4e87086b8cff6f8ce11ee07e938d778034c4d1fc09ab3333b8c4bc71e4eb9902"
            },
            "downloads": -1,
            "filename": "packaging-extrapolation-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c0a1c01dcedbe6f55b098c09eb1e75a5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13800,
            "upload_time": "2024-04-28T13:15:20",
            "upload_time_iso_8601": "2024-04-28T13:15:20.347556Z",
            "url": "https://files.pythonhosted.org/packages/cc/7d/87f6d6264dfbc5c9e962d28be70d9269390cbb3a66ed630f5a5d1513f320/packaging-extrapolation-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 13:15:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xizaokaiz",
    "github_project": "packaging_extrapolation",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "packaging-extrapolation"
}
        
Elapsed time: 0.28713s