New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bvlain

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bvlain

The Bond valence site energy calculator

  • 0.24.6
  • PyPI
  • Socket score

Maintainers
1

BVlain_logo

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.

Installation

pip install bvlain

Examples

Percolation barriers
from bvlain import Lain

file = '/Users/artemdembitskiy/Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
st = 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)
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
Percolation radii
from bvlain import Lain

file = '/Users/artemdembitskiy/Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
st = 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
Save volumetric data for visualization (.grd or .cube)
from bvlain import Lain

file = '/Users/artemdembitskiy/Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
st = 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.void_distribution(**params)

calc.write_grd(file + '_bvse', task = 'bvse')  # saves .grd file
calc.write_cube(file + '_void', task = 'void') # save .cube file
Bond valence sum mismatch
from bvlain import Lain

file = '/Users/artemdembitskiy/Downloads/LiFePO4.cif'
calc = Lain(verbose = False)
st = calc.read_file(file)
dataframe = calc.mismatch(r_cut = 3.5)

For more examples, see documentation.

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc