perconeb


Nameperconeb JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/dembart/perconeb
SummaryA tool for finding percolation pathways in crystals
upload_time2023-12-07 15:43:14
maintainer
docs_urlNone
authorArtem Dembitskiy
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #### About

Perconeb is the library used for fast identifying of the optimal jumps mobile species required for the percolation in a crystal structure. 

The identified jumps can be used for nudged elastic band (NEB) clalculation of the mobile species activation barriers.

Functionality includes:
- 1-3D percolation radius calculations (percolation threshold)

- cutoff search for the shortest ionic jumps between equilibrium positions

- identifying of unique jumps required for 1-3D percolation

- initial trajectory preparation for NEB calculations


#### Installation
!pip install perconeb

#### How to use


```python
from core import Perconeb
from ase.io import read

file = '/Users/artemdembitskiy/Desktop/perconeb/LiCoO2.cif'
atoms = read(file)  # can be .cif, POSCAR, or any that is readable by ase
specie = 3          # mobile specie, atomic number
tr = 0.75           # minimum allowed distance between linear segment connecting i,j-th positions of mobile specie
                    # and the framework, angstrom
upper_bound = 10.0  # maximum allowed distance for intersite hops of mobile species, angstrom

calc = Perconeb(atoms, specie, upper_bound = upper_bound)
dim, cutoff = calc.percolation_dimensionality(tr = tr)

dimensions = {2: 1, 4: 2, 8: 3} # we use 2x2x2 supercell to evaluate the percolation dimensionality
                                # if there is a connection between some point in the unitcell 
                                # and its closest replica within supercell then we have the percolation
                                # number of connected unitcell and dimensionality are related as follows
                                # 2 -> 1D, 4 -> 2D, 8 -> 3D
print(f'Maximum percolation dimnesionality is {dimensions[dim]}')
print(f'That requires mobile specie hops up to {round(cutoff, 3)} Angstorm')
```

    Maximum percolation dimnesionality is 3
    That requires mobile specie hops up to 4.922 Angstorm


#### Inequivalent mobile specie hops (edges)


```python
edges, edge_ids, inverse  = calc.unique_edges(tr = tr, dim = dim, cutoff = cutoff)
edges                         # each edge is represented by a 5D vector [i, j, offset_x, offset_y, offset_z]
for edge in edges:
    source, target = edge[:2] # indices of source and target mobile atoms in the mobile sublattice
    offset = edge[2:]
    p_source = atoms[atoms.numbers == specie].positions[source]
    p_target = atoms[atoms.numbers == specie].positions[target]
    distance_vector = p_source - (p_target + np.dot(atoms.cell, offset))
    distance = np.linalg.norm(distance_vector)
    print(f'Source {source}, target {target}, offset {offset}, hop distance {round(distance, 4)}')
```

    Source 0, target 1, offset [0 0 0], hop distance 4.9124
    Source 0, target 0, offset [ 1 -1  0], hop distance 4.7593
    Source 0, target 0, offset [0 1 0], hop distance 2.4346


#### Initial gues for NEB


```python
sep_dist = 8.0                                  # minimum size of the supercell, Angstrom
idpp = False                                    # whether to use IDPP or linear interpolation scheme
step = 1.0                                      # interpolation step, Angstroms
out = calc.neb_guess(edges, edge_ids,
                     min_sep_dist = sep_dist,
                     idpp = idpp,
                     step = step
                    )
calc.write_traj(out, f'{file}_traj.cif')        # the whole trajectory can be visualized in jmol
```

#### Save percolating pathway within supercell


```python
from ase.io import write

file = '/Users/artemdembitskiy/Desktop/perconeb/LiCoO2.cif'
atoms = read(file)
specie = 3

calc = Perconeb(atoms, specie, upper_bound = 10.0)
dim, cutoff = calc.percolation_dimensionality(tr = 0.75)
mask = calc._filter_edges(tr = 0.75, cutoff = cutoff)
sublattice = calc.mobile_supercell
base = sublattice.copy()
for pair in calc.u[mask][:, :2]:
    p1, p2 = sublattice.positions[pair]
    traj = np.linspace(p1, p2, 10)
    for p in traj[1:-1]:
        base.append('B')
        base.positions[-1] = p
write('percopath.cif', base)
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dembart/perconeb",
    "name": "perconeb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Artem Dembitskiy",
    "author_email": "art.dembitskiy@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/85/f675dd86c7079c0b877a099a1200b50dbeab3dcd428025399526c3ce708c/perconeb-0.1.1.tar.gz",
    "platform": null,
    "description": "#### About\n\nPerconeb is the library used for fast identifying of the optimal jumps mobile species required for the percolation in a crystal structure. \n\nThe identified jumps can be used for nudged elastic band (NEB) clalculation of the mobile species activation barriers.\n\nFunctionality includes:\n- 1-3D percolation radius calculations (percolation threshold)\n\n- cutoff search for the shortest ionic jumps between equilibrium positions\n\n- identifying of unique jumps required for 1-3D percolation\n\n- initial trajectory preparation for NEB calculations\n\n\n#### Installation\n!pip install perconeb\n\n#### How to use\n\n\n```python\nfrom core import Perconeb\nfrom ase.io import read\n\nfile = '/Users/artemdembitskiy/Desktop/perconeb/LiCoO2.cif'\natoms = read(file)  # can be .cif, POSCAR, or any that is readable by ase\nspecie = 3          # mobile specie, atomic number\ntr = 0.75           # minimum allowed distance between linear segment connecting i,j-th positions of mobile specie\n                    # and the framework, angstrom\nupper_bound = 10.0  # maximum allowed distance for intersite hops of mobile species, angstrom\n\ncalc = Perconeb(atoms, specie, upper_bound = upper_bound)\ndim, cutoff = calc.percolation_dimensionality(tr = tr)\n\ndimensions = {2: 1, 4: 2, 8: 3} # we use 2x2x2 supercell to evaluate the percolation dimensionality\n                                # if there is a connection between some point in the unitcell \n                                # and its closest replica within supercell then we have the percolation\n                                # number of connected unitcell and dimensionality are related as follows\n                                # 2 -> 1D, 4 -> 2D, 8 -> 3D\nprint(f'Maximum percolation dimnesionality is {dimensions[dim]}')\nprint(f'That requires mobile specie hops up to {round(cutoff, 3)} Angstorm')\n```\n\n    Maximum percolation dimnesionality is 3\n    That requires mobile specie hops up to 4.922 Angstorm\n\n\n#### Inequivalent mobile specie hops (edges)\n\n\n```python\nedges, edge_ids, inverse  = calc.unique_edges(tr = tr, dim = dim, cutoff = cutoff)\nedges                         # each edge is represented by a 5D vector [i, j, offset_x, offset_y, offset_z]\nfor edge in edges:\n    source, target = edge[:2] # indices of source and target mobile atoms in the mobile sublattice\n    offset = edge[2:]\n    p_source = atoms[atoms.numbers == specie].positions[source]\n    p_target = atoms[atoms.numbers == specie].positions[target]\n    distance_vector = p_source - (p_target + np.dot(atoms.cell, offset))\n    distance = np.linalg.norm(distance_vector)\n    print(f'Source {source}, target {target}, offset {offset}, hop distance {round(distance, 4)}')\n```\n\n    Source 0, target 1, offset [0 0 0], hop distance 4.9124\n    Source 0, target 0, offset [ 1 -1  0], hop distance 4.7593\n    Source 0, target 0, offset [0 1 0], hop distance 2.4346\n\n\n#### Initial gues for NEB\n\n\n```python\nsep_dist = 8.0                                  # minimum size of the supercell, Angstrom\nidpp = False                                    # whether to use IDPP or linear interpolation scheme\nstep = 1.0                                      # interpolation step, Angstroms\nout = calc.neb_guess(edges, edge_ids,\n                     min_sep_dist = sep_dist,\n                     idpp = idpp,\n                     step = step\n                    )\ncalc.write_traj(out, f'{file}_traj.cif')        # the whole trajectory can be visualized in jmol\n```\n\n#### Save percolating pathway within supercell\n\n\n```python\nfrom ase.io import write\n\nfile = '/Users/artemdembitskiy/Desktop/perconeb/LiCoO2.cif'\natoms = read(file)\nspecie = 3\n\ncalc = Perconeb(atoms, specie, upper_bound = 10.0)\ndim, cutoff = calc.percolation_dimensionality(tr = 0.75)\nmask = calc._filter_edges(tr = 0.75, cutoff = cutoff)\nsublattice = calc.mobile_supercell\nbase = sublattice.copy()\nfor pair in calc.u[mask][:, :2]:\n    p1, p2 = sublattice.positions[pair]\n    traj = np.linspace(p1, p2, 10)\n    for p in traj[1:-1]:\n        base.append('B')\n        base.positions[-1] = p\nwrite('percopath.cif', base)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A tool for finding percolation pathways in crystals",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/dembart/perconeb"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d5b7ebfc9ef6439b52d74fb953520fda6fa61d6a9b54b1720184a4a96b9b0c1",
                "md5": "918a30e00382a76b5e9b70f16de5095e",
                "sha256": "4173bc8791e769594a90adf07fb1783e40b008685dbb0c9cf9d5181f248badeb"
            },
            "downloads": -1,
            "filename": "perconeb-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "918a30e00382a76b5e9b70f16de5095e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7913,
            "upload_time": "2023-12-07T15:43:12",
            "upload_time_iso_8601": "2023-12-07T15:43:12.971178Z",
            "url": "https://files.pythonhosted.org/packages/9d/5b/7ebfc9ef6439b52d74fb953520fda6fa61d6a9b54b1720184a4a96b9b0c1/perconeb-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca85f675dd86c7079c0b877a099a1200b50dbeab3dcd428025399526c3ce708c",
                "md5": "824ece5452133d86bb338ee76e33e098",
                "sha256": "3710cbe7bfe00d0b407a07677ee4f1c94d9edb07b6576b1f499a7975b3de28cc"
            },
            "downloads": -1,
            "filename": "perconeb-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "824ece5452133d86bb338ee76e33e098",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7923,
            "upload_time": "2023-12-07T15:43:14",
            "upload_time_iso_8601": "2023-12-07T15:43:14.326825Z",
            "url": "https://files.pythonhosted.org/packages/ca/85/f675dd86c7079c0b877a099a1200b50dbeab3dcd428025399526c3ce708c/perconeb-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-07 15:43:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dembart",
    "github_project": "perconeb",
    "github_not_found": true,
    "lcname": "perconeb"
}
        
Elapsed time: 0.37611s