bvlain


Namebvlain JSON
Version 0.25.1 PyPI version JSON
download
home_pagehttps://github.com/dembart/BVlain
SummaryThe Bond valence site energy calculator
upload_time2025-08-21 16:16:20
maintainerNone
docs_urlNone
authorArtem Dembitskiy
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![BVlain_logo](BVlain_logo.png)

BVlain is a python library for bond valence site energy calculations. The functionality includes calculation of the 1-3D percolation barrier and radius of a mobile ion (e.g. Li+), calculation of the bond valence sum mismatch, writing of volumetric data files (.grd or .cube) for visualization of a mobile ion diffusion map. 

For more details, see [documentation.](https://bvlain.readthedocs.io/en/latest/index.html)

![License](https://img.shields.io/github/license/dembart/bvlain?color=fbf2fe)
![PyPI Downloads](https://img.shields.io/pypi/dm/BVlain?color=57328a)



## Installation


```python
pip install bvlain
```

## Examples

##### Percolation barriers


```python
from bvlain import Lain

file = './Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
atoms = calc.read_file(file)       # alternatively, you can use read_atoms() or read_structure()

params = {'mobile_ion': 'Li1+',              # mobile specie
		  'r_cut': 10.0,                     # cutoff for interaction between the mobile species and framework
		  'resolution': 0.2,	             # distance between the grid points
		  'k': 100,                          # maximum number of neighbors to be collected for each point
          'use_softbv_covalent_radii': False # default is False, use True to compare results with softBV
}
_ = calc.bvse_distribution(**params)
energies = calc.percolation_barriers(encut = 5.0)
for key in energies.keys():
    print(f'{key[-2:]} percolation barrier is {round(energies[key], 4)} eV')
```

    1D percolation barrier is 0.4395 eV
    2D percolation barrier is 3.3301 eV
    3D percolation barrier is 3.3594 eV



##### Save volumetric data for visualization (.grd or .cube)


```python
from bvlain import Lain

file = './Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
atoms = calc.read_file(file)

params = {'mobile_ion': 'Li1+',    # mobile specie
		  'r_cut': 10.0,           # cutoff for interaction between the mobile species and framework
		  'resolution': 0.2,	   # distance between the grid points
		  'k': 100                 # maximum number of neighbors to be collected for each point
}
_ = calc.bvse_distribution(**params)

calc.write_grd(file + '_bvse', task = 'bvse')  # saves .grd file
# calc.write_cube(file + '_bvse', task = 'bvse') # alternatively, save .cube file
```

##### Percolation radii


```python
from bvlain import Lain

file = './Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
atoms = calc.read_file(file)

params = {'mobile_ion': 'Li1+',    # mobile specie
		  'r_cut': 10.0,           # cutoff for interaction between the mobile species and framework
		  'resolution': 0.2,	   # distance between the grid points
}
_ = calc.void_distribution(**params)
radii = calc.percolation_radii()
for key in radii.keys():
    print(f'{key[-2:]} percolation barrier is {round(radii[key], 4)} angstrom')
```

    1D percolation barrier is 0.3943 angstrom
    2D percolation barrier is 0.2957 angstrom
    3D percolation barrier is 0.1972 angstrom

```python
calc.write_grd(file + '_void', task = 'void') # # save void distribution
```

##### Bond valence sum mismatch


```python
from bvlain import Lain

file = './Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
atoms = calc.read_file(file)
dataframe = calc.mismatch(r_cut = 3.5)
```


For more examples, see [documentation.](https://bvlain.readthedocs.io/en/latest/index.html)

The library is under active development and it is not guaranteed that there are no bugs. If you observe not expected results, errors, please report an issue at github.







            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dembart/BVlain",
    "name": "bvlain",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Artem Dembitskiy",
    "author_email": "art.dembitskiy@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cd/e2/c3f784736f01e9516104e5f6bcefccf73c0e9151f6811ee5d34923efeec8/bvlain-0.25.1.tar.gz",
    "platform": null,
    "description": "![BVlain_logo](BVlain_logo.png)\n\nBVlain is a python library for bond valence site energy calculations. The functionality includes calculation of the 1-3D percolation barrier and radius of a mobile ion (e.g. Li+), calculation of the bond valence sum mismatch, writing of volumetric data files (.grd or .cube) for visualization of a mobile ion diffusion map. \n\nFor more details, see [documentation.](https://bvlain.readthedocs.io/en/latest/index.html)\n\n![License](https://img.shields.io/github/license/dembart/bvlain?color=fbf2fe)\n![PyPI Downloads](https://img.shields.io/pypi/dm/BVlain?color=57328a)\n\n\n\n## Installation\n\n\n```python\npip install bvlain\n```\n\n## Examples\n\n##### Percolation barriers\n\n\n```python\nfrom bvlain import Lain\n\nfile = './Downloads/LiFePO4.cif'\ncalc = Lain(verbose = False)\natoms = calc.read_file(file)       # alternatively, you can use read_atoms() or read_structure()\n\nparams = {'mobile_ion': 'Li1+',              # mobile specie\n\t\t  'r_cut': 10.0,                     # cutoff for interaction between the mobile species and framework\n\t\t  'resolution': 0.2,\t             # distance between the grid points\n\t\t  'k': 100,                          # maximum number of neighbors to be collected for each point\n          'use_softbv_covalent_radii': False # default is False, use True to compare results with softBV\n}\n_ = calc.bvse_distribution(**params)\nenergies = calc.percolation_barriers(encut = 5.0)\nfor key in energies.keys():\n    print(f'{key[-2:]} percolation barrier is {round(energies[key], 4)} eV')\n```\n\n    1D percolation barrier is 0.4395 eV\n    2D percolation barrier is 3.3301 eV\n    3D percolation barrier is 3.3594 eV\n\n\n\n##### Save volumetric data for visualization (.grd or .cube)\n\n\n```python\nfrom bvlain import Lain\n\nfile = './Downloads/LiFePO4.cif'\ncalc = Lain(verbose = False)\natoms = calc.read_file(file)\n\nparams = {'mobile_ion': 'Li1+',    # mobile specie\n\t\t  'r_cut': 10.0,           # cutoff for interaction between the mobile species and framework\n\t\t  'resolution': 0.2,\t   # distance between the grid points\n\t\t  'k': 100                 # maximum number of neighbors to be collected for each point\n}\n_ = calc.bvse_distribution(**params)\n\ncalc.write_grd(file + '_bvse', task = 'bvse')  # saves .grd file\n# calc.write_cube(file + '_bvse', task = 'bvse') # alternatively, save .cube file\n```\n\n##### Percolation radii\n\n\n```python\nfrom bvlain import Lain\n\nfile = './Downloads/LiFePO4.cif'\ncalc = Lain(verbose = False)\natoms = calc.read_file(file)\n\nparams = {'mobile_ion': 'Li1+',    # mobile specie\n\t\t  'r_cut': 10.0,           # cutoff for interaction between the mobile species and framework\n\t\t  'resolution': 0.2,\t   # distance between the grid points\n}\n_ = calc.void_distribution(**params)\nradii = calc.percolation_radii()\nfor key in radii.keys():\n    print(f'{key[-2:]} percolation barrier is {round(radii[key], 4)} angstrom')\n```\n\n    1D percolation barrier is 0.3943 angstrom\n    2D percolation barrier is 0.2957 angstrom\n    3D percolation barrier is 0.1972 angstrom\n\n```python\ncalc.write_grd(file + '_void', task = 'void') # # save void distribution\n```\n\n##### Bond valence sum mismatch\n\n\n```python\nfrom bvlain import Lain\n\nfile = './Downloads/LiFePO4.cif'\ncalc = Lain(verbose = False)\natoms = calc.read_file(file)\ndataframe = calc.mismatch(r_cut = 3.5)\n```\n\n\nFor more examples, see [documentation.](https://bvlain.readthedocs.io/en/latest/index.html)\n\nThe library is under active development and it is not guaranteed that there are no bugs. If you observe not expected results, errors, please report an issue at github.\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The Bond valence site energy calculator",
    "version": "0.25.1",
    "project_urls": {
        "Homepage": "https://github.com/dembart/BVlain"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9592f801132ace647ddba5494b9f03a8b67feb29163e8707af425695a07bdbd",
                "md5": "3f31666fa7d09e2d2622408ad27c83dc",
                "sha256": "8c785978dc69c0dab1939ec3b5e1832518ccd3237eea2c572ba65b0a5ae78701"
            },
            "downloads": -1,
            "filename": "bvlain-0.25.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3f31666fa7d09e2d2622408ad27c83dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 60116,
            "upload_time": "2025-08-21T16:16:19",
            "upload_time_iso_8601": "2025-08-21T16:16:19.896028Z",
            "url": "https://files.pythonhosted.org/packages/a9/59/2f801132ace647ddba5494b9f03a8b67feb29163e8707af425695a07bdbd/bvlain-0.25.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cde2c3f784736f01e9516104e5f6bcefccf73c0e9151f6811ee5d34923efeec8",
                "md5": "32bd3800eea7e2f611c5c9f11625ea7e",
                "sha256": "55c63944bccca3a1c4bff2ebe57188c82123716682c01215ece02c7648aa9016"
            },
            "downloads": -1,
            "filename": "bvlain-0.25.1.tar.gz",
            "has_sig": false,
            "md5_digest": "32bd3800eea7e2f611c5c9f11625ea7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 59575,
            "upload_time": "2025-08-21T16:16:20",
            "upload_time_iso_8601": "2025-08-21T16:16:20.969441Z",
            "url": "https://files.pythonhosted.org/packages/cd/e2/c3f784736f01e9516104e5f6bcefccf73c0e9151f6811ee5d34923efeec8/bvlain-0.25.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 16:16:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dembart",
    "github_project": "BVlain",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bvlain"
}
        
Elapsed time: 2.32006s