# WarrenCowleyParameters
![PyPI Version](https://img.shields.io/pypi/v/WarrenCowleyParameters.svg) ![PyPI Downloads](https://static.pepy.tech/badge/WarrenCowleyParameters)
![tests](https://github.com/killiansheriff/WarrenCowleyParameters/actions/workflows/python-tests.yml/badge.svg)
OVITO Python modifier to compute the Warren-Cowley parameters, defined as:
$$\alpha_{ij}^m = 1-\frac{p_{ij}^m}{c_j},$$
where $m$ denotes the $m$-th nearest-neighbor shell, $p_{ij}^m$ is the average probability of finding a $j$-type atom around an $i$-type atom in the $m$-th shell, and $c_j$ is the average concentration of $j$-type atom in the system.
A negative $\alpha_{ij}^m$ suggests the tendency of $j$-type clustering in the $m$-th shell of an $i$-type atom, while a positive value means repulsion.
## Utilisation
Here is an example of how to compute the 1st and 2nd nearest neighbor shell Warren-Cowley parameters of the ``fcc.dump`` dump file. Note that in the fcc crystal structure, the ``1st nearest neighbor shell has 12 atoms``, while ``the second one has 6 atoms``.
```python
from ovito.io import import_file
import WarrenCowleyParameters as wc
pipeline = import_file("fcc.dump")
mod = wc.WarrenCowleyParameters(nneigh=[0, 12, 18], only_selected=False)
pipeline.modifiers.append(mod)
data = pipeline.compute()
wc_for_shells = data.attributes["Warren-Cowley parameters"]
print(f"1NN Warren-Cowley parameters: \n {wc_for_shells[0]}")
print(f"2NN Warren-Cowley parameters: \n {wc_for_shells[1]}")
# Alternatively, can see it as a dictionarry
# print(data.attributes["Warren-Cowley parameters by particle name"])
```
Example scripts can be found in the ``examples/`` folder.
![](media/wc_bar_plot.png)
## Installation
For a standalone Python package or Conda environment, please use:
```bash
pip install --user WarrenCowleyParameters
```
For *OVITO PRO* built-in Python interpreter, please use:
```bash
ovitos -m pip install --user WarrenCowleyParameters
```
If you want to install the lastest git commit, please replace ``WarrenCowleyParameters`` by ``git+https://github.com/killiansheriff/WarrenCowleyParameters.git``.
## Contact
If any questions, feel free to contact me (ksheriff at mit dot edu).
## References & Citing
If you use this repository in your work, please cite:
```
@article{sheriffquantifying2024,
title = {Quantifying chemical short-range order in metallic alloys},
doi = {10.1073/pnas.2322962121},
journaltitle = {Proceedings of the National Academy of Sciences},
author = {Sheriff, Killian and Cao, Yifan and Smidt, Tess and Freitas, Rodrigo},
date = {2024-06-18},
}
```
and
```
@article{sheriff2024chemicalmotif,
title = {Chemical-motif characterization of short-range order with E(3)-equivariant graph neural networks},
DOI = {10.1038/s41524-024-01393-5},
journal = {npj Computational Materials},
author = {Sheriff, Killian and Cao, Yifan and Freitas, Rodrigo},
year = {2024},
month = sep,
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "WarrenCowleyParameters",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "Killian Sheriff <ksheriff@mit.edu>",
"keywords": "ovito, python-modifier",
"author": null,
"author_email": "Killian Sheriff <ksheriff@mit.edu>",
"download_url": "https://files.pythonhosted.org/packages/fd/c0/ef4831ee9772b93727ba87c63de243bd08f060a43f6842af70fe88c8fc3a/warrencowleyparameters-1.0.1.tar.gz",
"platform": null,
"description": "# WarrenCowleyParameters\n\n![PyPI Version](https://img.shields.io/pypi/v/WarrenCowleyParameters.svg) ![PyPI Downloads](https://static.pepy.tech/badge/WarrenCowleyParameters)\n![tests](https://github.com/killiansheriff/WarrenCowleyParameters/actions/workflows/python-tests.yml/badge.svg)\n\nOVITO Python modifier to compute the Warren-Cowley parameters, defined as:\n\n$$\\alpha_{ij}^m = 1-\\frac{p_{ij}^m}{c_j},$$ \n\nwhere $m$ denotes the $m$-th nearest-neighbor shell, $p_{ij}^m$ is the average probability of finding a $j$-type atom around an $i$-type atom in the $m$-th shell, and $c_j$ is the average concentration of $j$-type atom in the system. \nA negative $\\alpha_{ij}^m$ suggests the tendency of $j$-type clustering in the $m$-th shell of an $i$-type atom, while a positive value means repulsion.\n\n## Utilisation \n\nHere is an example of how to compute the 1st and 2nd nearest neighbor shell Warren-Cowley parameters of the ``fcc.dump`` dump file. Note that in the fcc crystal structure, the ``1st nearest neighbor shell has 12 atoms``, while ``the second one has 6 atoms``. \n\n```python\nfrom ovito.io import import_file\nimport WarrenCowleyParameters as wc\n\npipeline = import_file(\"fcc.dump\")\nmod = wc.WarrenCowleyParameters(nneigh=[0, 12, 18], only_selected=False)\npipeline.modifiers.append(mod)\ndata = pipeline.compute()\n\nwc_for_shells = data.attributes[\"Warren-Cowley parameters\"]\nprint(f\"1NN Warren-Cowley parameters: \\n {wc_for_shells[0]}\")\nprint(f\"2NN Warren-Cowley parameters: \\n {wc_for_shells[1]}\")\n\n\n# Alternatively, can see it as a dictionarry\n# print(data.attributes[\"Warren-Cowley parameters by particle name\"])\n\n```\nExample scripts can be found in the ``examples/`` folder.\n\n![](media/wc_bar_plot.png)\n\n## Installation\nFor a standalone Python package or Conda environment, please use:\n```bash\npip install --user WarrenCowleyParameters\n```\n\nFor *OVITO PRO* built-in Python interpreter, please use:\n```bash\novitos -m pip install --user WarrenCowleyParameters\n```\n\nIf you want to install the lastest git commit, please replace ``WarrenCowleyParameters`` by ``git+https://github.com/killiansheriff/WarrenCowleyParameters.git``.\n\n## Contact\nIf any questions, feel free to contact me (ksheriff at mit dot edu).\n\n## References & Citing \nIf you use this repository in your work, please cite:\n\n```\n@article{sheriffquantifying2024,\n\ttitle = {Quantifying chemical short-range order in metallic alloys},\n\tdoi = {10.1073/pnas.2322962121},\n\tjournaltitle = {Proceedings of the National Academy of Sciences},\n\tauthor = {Sheriff, Killian and Cao, Yifan and Smidt, Tess and Freitas, Rodrigo},\n\tdate = {2024-06-18},\n}\n```\n\nand \n\n```\n@article{sheriff2024chemicalmotif,\n title = {Chemical-motif characterization of short-range order with E(3)-equivariant graph neural networks},\n DOI = {10.1038/s41524-024-01393-5},\n journal = {npj Computational Materials},\n author = {Sheriff, Killian and Cao, Yifan and Freitas, Rodrigo},\n year = {2024},\n month = sep,\n}\n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "OVITO Python modifier to compute Warren-Cowley parameters.",
"version": "1.0.1",
"project_urls": {
"repository": "https://github.com/killiansheriff/WarrenCowleyParameters"
},
"split_keywords": [
"ovito",
" python-modifier"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c94826cbd5ed7ba3ab595f5a1c40e0064d1848e7ee068be69947fb205a6541d",
"md5": "302494e3e83e5b97af13005b574aa616",
"sha256": "4a5d0d8e7d58f6432fb12056bbb29ccac4fb9c8db1aae55a81c49aadfc5dde5f"
},
"downloads": -1,
"filename": "WarrenCowleyParameters-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "302494e3e83e5b97af13005b574aa616",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5515,
"upload_time": "2024-11-05T01:33:20",
"upload_time_iso_8601": "2024-11-05T01:33:20.934470Z",
"url": "https://files.pythonhosted.org/packages/5c/94/826cbd5ed7ba3ab595f5a1c40e0064d1848e7ee068be69947fb205a6541d/WarrenCowleyParameters-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fdc0ef4831ee9772b93727ba87c63de243bd08f060a43f6842af70fe88c8fc3a",
"md5": "0128b6f97563026965f6e5f9e6da7368",
"sha256": "8aed686963ddd7e586b08800865be10cbf6cba5eb5030e31510f9b32f38decd8"
},
"downloads": -1,
"filename": "warrencowleyparameters-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "0128b6f97563026965f6e5f9e6da7368",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5815,
"upload_time": "2024-11-05T01:33:22",
"upload_time_iso_8601": "2024-11-05T01:33:22.413626Z",
"url": "https://files.pythonhosted.org/packages/fd/c0/ef4831ee9772b93727ba87c63de243bd08f060a43f6842af70fe88c8fc3a/warrencowleyparameters-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-05 01:33:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "killiansheriff",
"github_project": "WarrenCowleyParameters",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "warrencowleyparameters"
}