Skip to main content

Package to generate and analyse distorted defect structures, in order to identify ground-state and metastable defect configurations.

Reason this release was yanked:

Switch to SemVer

Project description

Build status Documentation Status JOSS PyPI Conda Version Downloads npj

ShakeNBreak (SnB)

ShakeNBreak is a defect structure-searching method employing chemically-guided bond distortions to locate ground-state and metastable structures of point defects in solid materials.

Main features include:

  1. Defect structure generation:
    • Automatic generation of distorted structures for input defects
    • Optionally, input file generation for geometry optimisation with several codes (VASP, CP2K, Quantum-Espresso, CASTEP & FHI-aims)
  2. Analysis:
    • Parsing of geometry relaxation results
    • Plotting of final energies versus distortion to demonstrate what energy-lowering reconstructions have been identified
    • Coordination & bonding analysis to investigate the physico-chemical factors driving an energy-lowering distortion
    • Magnetisation analysis (currently only supported for VASP)

The code currently supports VASP, CP2K, Quantum-Espresso, CASTEP & FHI-aims. Code contributions to support additional solid-state packages are welcome.

Literature

Installation

ShakeNBreak can be installed using pip:

  pip install shakenbreak

Alternatively if needed, it can also be installed from conda with:

  conda install -c conda-forge shakenbreak

If using VASP, in order for ShakeNBreak to automatically generate the pseudopotential input files (POTCARs), your local VASP pseudopotential directory must be set in the pymatgen configuration file $HOME/.pmgrc.yaml as follows:

  PMG_VASP_PSP_DIR: <Path to VASP pseudopotential top directory>

Within your VASP pseudopotential top directory, you should have a folder named POT_GGA_PAW_PBE which contains the POTCAR.X(.gz) files (in this case for PBE POTCARs). Please refer to the doped README instructions if you have difficulty with this.

The font Montserrat (Open Font License) will be installed with the package, and will be used by default for plotting.

Developer installation

For development work, ShakeNBreak can also be installed from a copy of the source directory:

  1. Download ShakeNBreak source code using the command:
  git clone https://github.com/SMTG-UCL/ShakeNBreak
  1. Navigate to root directory:
  cd ShakeNBreak
  1. Install the code, using the command:
  pip install -e .

This command tries to obtain the required packages and their dependencies and install them automatically.

Usage

Python API

ShakeNBreak can be used through a Python API, as exemplified in the SnB Python API tutorial, with more info available on the docs.

Command line interface

Alternatively, the code can be used via the command line: ShakeNBreak CLI

The functions provided include:

  • snb-generate: Generate distorted structures for a given defect
  • snb-generate_all: Generate distorted structures for all defects present in the specified/current directory
  • snb-run: Submit geometry relaxations to the HPC scheduler
  • snb-parse: Parse the results of the geometry relaxations and write them to a yaml file
  • snb-analyse: Generate csv files with energies and structural differences between the final configurations
  • snb-plot: Generate plots of energy vs distortion, with the option to include a colorbar to quantify structural differences
  • snb-regenerate: Identify defect species undergoing energy-lowering distortions and test these distortions for the other charge states of the defect
  • snb-groundstate: Save the ground state structures to a Groundstate directory for continuation runs

More information about each function and its inputs/outputs are available from the CLI section of the docs or using -h help option (e.g. snb -h).

We recommend at least looking through the tutorials when first starting to use ShakeNBreak, to familiarise yourself with the full functionality and workflow.

Code Compatibility

ShakeNBreak is built to natively function using pymatgen Defect objects (docs available here) and be compatible with the most recent version of pymatgen. If you are receiving pymatgen-related errors when using ShakeNBreak, you may need to update pymatgen and/or ShakeNBreak, which can be done with:

pip install --upgrade pymatgen shakenbreak

ShakeNBreak can take pymatgen Defect objects as input (to then generate the trial distorted structures), but also can take in pymatgen Structure objects, doped defect dictionaries or structure files (e.g. POSCARs for VASP) as inputs. As such, it should be compatible with any defect code (such as doped, pydefect, PyCDT, PyLada, DASP, Spinney, DefAP, PyDEF...) that generates these files. Please let us know if you have any issues with compatibility, or if you would like to see any additional features added to ShakeNBreak to make it more compatible with your code.

Contributing

Bugs reports, feature requests and questions

Please use the Issue Tracker to report bugs or request new features.

Contributions to extend this package are very welcome! Please use the "Fork and Pull" workflow to do so and follow the PEP8 style guidelines.

See the Contributing Documentation for detailed instructions.

Tests

Unit tests are in the tests directory and can be run from the top directory using unittest. Automatic testing is run on the master and develop branches using Github Actions. Please run tests and add new tests for any new features whenever submitting pull requests.

Acknowledgements

ShakeNBreak has benefitted from feedback from many members of the Walsh and Scanlon research groups who have used / are using it in their work, including Adair Nicolson, Xinwei Wang, Katarina Brlec, Joe Willis, Zhenzhu Li, Jiayi Cen, Lavan Ganeshkumar, Daniel Sykes, Luisa Herring-Rodriguez, Alex Squires, Sabrine Hachmioune and Chris Savory.

Studies using ShakeNBreak

We'll add papers that use ShakeNBreak to this list as they come out!

License and Citation

ShakeNBreak is made available under the MIT License.

If you use it in your research, please cite:

You may also find this Preview paper useful, which discusses the general problem of defect structure prediction:

BibTeX entries for these papers are provided in the CITATIONS.md file.

Requirements

ShakeNBreak is compatible with Python 3.8, 3.9 & 3.10 and requires the following open-source python packages:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shakenbreak-23.6.23.tar.gz (33.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shakenbreak-23.6.23-py3-none-any.whl (8.7 MB view details)

Uploaded Python 3

File details

Details for the file shakenbreak-23.6.23.tar.gz.

File metadata

  • Download URL: shakenbreak-23.6.23.tar.gz
  • Upload date:
  • Size: 33.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for shakenbreak-23.6.23.tar.gz
Algorithm Hash digest
SHA256 afc7d6d0077162a9c75fcde41d441a890d99b4d5c0866eca4eeadddd07d3675b
MD5 e35099b4f912255b314ded00e5a52f83
BLAKE2b-256 f6f1a08070c8df2b3191cb726864a5990ce10c15c5e1a808646b0c720be7293d

See more details on using hashes here.

File details

Details for the file shakenbreak-23.6.23-py3-none-any.whl.

File metadata

  • Download URL: shakenbreak-23.6.23-py3-none-any.whl
  • Upload date:
  • Size: 8.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for shakenbreak-23.6.23-py3-none-any.whl
Algorithm Hash digest
SHA256 259a9adcdc727d5037fd4e9b4ae96dbd079abbe52fd515102907cea12e52f754
MD5 8ac539fe045a99d28a9c0937b7d49f2f
BLAKE2b-256 06c3d880c48705599d11dcf5700f2cbecf7e1276ac2154397d1b10492c793edf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page