ShakeNBreak
ShakeNBreak: Navigating the defect configurational landscape - Published in JOSS (2022)
Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 82 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, wiley.com, nature.com, aps.org, acs.org, joss.theoj.org -
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Defect structure-searching employing chemically-guided bond distortions
Basic Info
- Host: GitHub
- Owner: SMTG-Bham
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://shakenbreak.readthedocs.io
- Size: 103 MB
Statistics
- Stars: 103
- Watchers: 4
- Forks: 21
- Open Issues: 1
- Releases: 41
Topics
Metadata Files
README.md
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. Docs here!
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
We kindly ask that you cite the code and theory/method paper if you use ShakeNBreak in your work.
- Preview: Mosquera-Lois, I.; Kavanagh, S. R. In Search of Hidden Defects, Matter 4 (8), 2602-2605, 2021
- Code: Mosquera-Lois, I. & Kavanagh, S. R.; Walsh, A.; Scanlon, D. O. ShakeNBreak: Navigating the defect configurational landscape, Journal of Open Source Software 7 (80), 4817, 2022
- Theory/Method: Mosquera-Lois, I. & Kavanagh, S. R.; Walsh, A.; Scanlon, D. O. Identifying the Ground State Structures of Defects in Solids, npj Comput Mater 9, 25 2023
- News & Views: Mannodi-Kanakkithodi, A. The Devil is in the Defects, Nature Physics 2023 (Free-to-read link)
- YouTube Overview (10 mins): ShakeNBreak: Symmetry-Breaking and Reconstruction at Defects in Solids
- YouTube Seminar (35 mins): Seminar: Predicting the Atomic Structures of Defects
Installation
ShakeNBreak can be installed using conda:
bash
conda install -c conda-forge shakenbreak
or pip:
bash
pip install shakenbreak
See the Installation docs if you encounter any issues (e.g. known issue with phonopy CMake build).
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:
bash
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 Installation docs 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.
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:

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.
You may also find the
YouTube Overview (10 mins),
YouTube Seminar (35 mins)
and/or papers listed in the Literature section above useful.
Studies using ShakeNBreak
- C. López et al. Chalcogen Vacancies Rule Charge Recombination in Pnictogen Chalcohalide Solar-Cell Absorbers arXiv 2025
- K. Ogawa et al. Defect Tolerance via External Passivation in the Photocatalyst SrTiO3:Al ChemRxiv 2025
- Y. Fu & H. Lohan et al. Factors Enabling Delocalized Charge-Carriers in Pnictogen-Based Solar Absorbers: In-depth Investigation into CuSbSe2 Nature Communications 2025
- S. R. Kavanagh Identifying Split Vacancies with Foundation Models and Electrostatics arXiv 2025
- Y. Liu Small hole polarons in yellow phase δ-CsPbI3 Physical Review Materials 2025
- S. R. Kavanagh et al. Intrinsic point defect tolerance in selenium for indoor and tandem photovoltaics Energy & Environmental Science 2025
- J. Huang et al. Manganese in β-Ga2O3: a deep acceptor with a large nonradiative electron capture cross-section Journal of Physics D: Applied Physics 2025
- J. Hu et al. Enabling ionic transport in Li3AlP2 the roles of defects and disorder Journal of Materials Chemistry A 2025
- X. Zhao et al. Trace Yb doping-induced cationic vacancy clusters enhance thermoelectrics in p-type PbTe Applied Physics Letters 2025
- Z. Cai & C. Ma Origin of oxygen partial pressure-dependent conductivity in SrTiO3 Applied Physics Letters 2025
- R. Desai et al. Exploring the Defect Landscape and Dopability of Chalcogenide Perovskite BaZrS3 Journal of Physical Chemistry C 2025
- C. Kaewmeechai, J. Strand & A. Shluger Structure and Migration Mechanisms of Oxygen Interstitial Defects in β-Ga2O3 Physica Status Solidi B 2025 <!-- though didn't properly cite SnB or doped code papers... -->
- W. Gierlotka et al. Thermodynamics of point defects in the AlSb phase and its influence on phase equilibrium Computational Materials Science 2025 <!-- though didn't cite SnB code paper... -->
- W. D. Neilson et al. Oxygen Potential, Uranium Diffusion, and Defect Chemistry in UO2±x: A Density Functional Theory Study Journal of Physical Chemistry C 2024
- X. Wang et al. Sulfur Vacancies Limit the Open-circuit Voltage of Sb2S3 Solar Cells ACS Energy Letters 2024
- Z. Yuan & G. Hautier First-principles study of defects and doping limits in CaO Applied Physics Letters 2024
- B. E. Murdock et al. Li-Site Defects Induce Formation of Li-Rich Impurity Phases: Implications for Charge Distribution and Performance of LiNi0.5-xMxMn1.5O4 Cathodes (M = Fe and Mg; x = 0.05–0.2) Advanced Materials 2024
- A. G. Squires et al. Oxygen dimerization as a defect-driven process in bulk LiNiO22 ACS Energy Letters 2024
- X. Wang et al. Upper efficiency limit of Sb2Se3 solar cells Joule 2024
- I. Mosquera-Lois et al. Machine-learning structural reconstructions for accelerated point defect calculations npj Computational Materials 2024
- S. R. Kavanagh et al. doped: Python toolkit for robust and repeatable charged defect supercell calculations Journal of Open Source Software 2024
- K. Li et al. Computational Prediction of an Antimony-based n-type Transparent Conducting Oxide: F-doped Sb2O5 Chemistry of Materials 2024
- S. Hachmioune et al. Exploring the Thermoelectric Potential of MgB4: Electronic Band Structure, Transport Properties, and Defect Chemistry Chemistry of Materials 2024
- X. Wang et al. Four-electron negative-U vacancy defects in antimony selenide Physical Review B 2023
- Y. Kumagai et al. Alkali Mono-Pnictides: A New Class of Photovoltaic Materials by Element Mutation PRX Energy 2023
- A. T. J. Nicolson et al. Cu2SiSe3 as a promising solar absorber: harnessing cation dissimilarity to avoid killer antisites Journal of Materials Chemistry A 2023
- J. Willis, K. B. Spooner, D. O. Scanlon On the possibility of p-type doping in barium stannate Applied Physics Letters 2023
- J. Cen et al. Cation disorder dominates the defect chemistry of high-voltage LiMn1.5Ni0.5O4 (LMNO) spinel cathodes Journal of Materials Chemistry A 2023
- J. Willis & R. Claes et al. Limits to Hole Mobility and Doping in Copper Iodide Chemistry of Materials 2023
- I. Mosquera-Lois & S. R. Kavanagh, A. Walsh, D. O. Scanlon Identifying the ground state structures of point defects in solids npj Computational Materials 2023
- B. Peng et al. Advancing understanding of structural, electronic, and magnetic properties in 3d-transition-metal TM-doped α-Ga₂O₃ (TM = V, Cr, Mn, and Fe) Journal of Applied Physics 2023
- Y. T. Huang & S. R. Kavanagh et al. Strong absorption and ultrafast localisation in NaBiS2 nanocrystals with slow charge-carrier recombination Nature Communications 2022
- S. R. Kavanagh, D. O. Scanlon, A. Walsh, C. Freysoldt Impact of metastable defect structures on carrier recombination in solar cells Faraday Discussions 2022
- Y-S. Choi et al. Intrinsic Defects and Their Role in the Phase Transition of Na-Ion Anode Na2Ti3O7 ACS Applied Energy Materials 2022 (Early version)
- S. R. Kavanagh, D. O. Scanlon, A. Walsh Rapid Recombination by Cadmium Vacancies in CdTe ACS Energy Letters 2021
- C. J. Krajewska et al. Enhanced visible light absorption in layered Cs3Bi2Br9 through mixed-valence Sn(II)/Sn(IV) doping Chemical Science 2021 (Early version)
- (News & Views): A. Mannodi-Kanakkithodi The devil is in the defects Nature Physics 2023 (Free-to-read link)
License and Citation
ShakeNBreak is made available under the MIT License.
If you use it in your research, please cite: - Code: Mosquera-Lois, I. & Kavanagh, S. R.; Walsh, A.; Scanlon, D. O. ShakeNBreak: Navigating the defect configurational landscape. Journal of Open Source Software 7 (80), 4817, 2022 - Theory/Method: Mosquera-Lois, I. & Kavanagh, S. R.; Walsh, A.; Scanlon, D. O. Identifying the Ground State Structures of Defects in Solids npj Comput Mater 9, 25 2023
You may also find this Preview paper useful, which discusses the general problem of defect structure prediction: - Mosquera-Lois, I.; Kavanagh, S. R. In Search of Hidden Defects. Matter 4 (8), 2602-2605, 2021
BibTeX entries for these papers are provided in the CITATIONS.md file.
Code Compatibility
ShakeNBreak is built to natively function using doped / pymatgen Defect objects 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:
bash
pip install -U pymatgen shakenbreak
ShakeNBreak is compatible with a variety of inputs (to then generate the trial distorted structures), including doped / pymatgen Defect objects, pymatgen Structure objects or structure files
(e.g. POSCARs for VASP). As such, it should be compatible with any defect code
(such as doped, pydefect,
PyCDT, PyLada,
DASP, Spinney,
DefAP, PyDEF...) or manual defect supercell generation.
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.
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.
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.
Owner
- Name: Scanlon Materials Theory Group
- Login: SMTG-Bham
- Kind: organization
- Location: UCL, UK
- Website: http://davidscanlon.com
- Repositories: 1
- Profile: https://github.com/SMTG-Bham
Citation (CITATIONS.md)
# Citing `ShakeNBreak`
Thank you for using `ShakeNBreak`!
If you have used it in your research, we kindly ask that you cite:
- **Code:** Mosquera-Lois, I. & Kavanagh, S. R.; Walsh, A.; Scanlon, D. O. [ShakeNBreak: Navigating the defect configurational landscape](https://doi.org/10.21105/joss.04817). _Journal of Open Source Software_ 7 (80), 4817, **2022**
- **Theory/Method:** Mosquera-Lois, I. & Kavanagh, S. R.; Walsh, A.; Scanlon, D. O. [Identifying the Ground State Structures of Defects in Solids](https://doi.org/10.1038/s41524-023-00973-1) _npj Comput Mater_ 9, 25 **2023**
You may also find this 'Preview' paper useful, which discusses the general problem of defect structure prediction:
- Mosquera-Lois, I.; Kavanagh, S. R. [In Search of Hidden Defects](https://doi.org/10.1016/j.matt.2021.06.003). _Matter_ 4 (8), 2602-2605, **2021**
## BibTeX
Available as a BibTeX file [here](docs/shakenbreak.bib), or copy the following:
```
@article{SnB_code,
author = {Mosquera-Lois, Irea and Kavanagh, Seán R. and Walsh, Aron and Scanlon, David O.},
title = {{ShakeNBreak}: {Navigating} the defect configurational landscape},
journal = {Journal of Open Source Software},
volume = {7},
number = {80},
pages = {4817},
year = {2022},
doi = {10.21105/joss.04817},
url = {https://joss.theoj.org/papers/10.21105/joss.04817},
eprint = {https://joss.theoj.org/papers/10.21105/joss.04817},
abstract = {Mosquera-Lois et al., (2022). ShakeNBreak: Navigating the defect configurational landscape. Journal of Open Source Software, 7(80), 4817, https://doi.org/10.21105/joss.04817},
}
@article{SnB_theory,
author = {Mosquera-Lois, Irea and Kavanagh, Seán R. and Walsh, Aron and Scanlon, David O.},
title = {Identifying the ground state structures of point defects in solids},
journal = {npj Computational Materials},
volume = {9},
number = {1},
pages = {1--11},
year = {2023}
doi = {10.1038/s41524-023-00973-1},
url = {https://www.nature.com/articles/s41524-023-00973-1},
eprint = {https://www.nature.com/articles/s41524-023-00973-1},
abstract = {Point defects are a universal feature of crystals. Their identification is addressed by combining experimental measurements with theoretical models. The standard modelling approach is, however, prone to missing the ground state atomic configurations associated with energy-lowering reconstructions from the idealised crystallographic environment. Missed ground states compromise the accuracy of calculated properties. To address this issue, we report an approach to navigate the defect configurational landscape using targeted bond distortions and rattling. Application of our workflow to eight materials (CdTe, GaAs, Sb2S3, Sb2Se3, CeO2, In2O3, ZnO, anatase-TiO2) reveals symmetry breaking in each host crystal that is not found via conventional local minimisation techniques. The point defect distortions are classified by the associated physico-chemical factors. We demonstrate the impact of these defect distortions on derived properties, including formation energies, concentrations and charge transition levels. Our work presents a step forward for quantitative modelling of imperfect solids.},
}
@article{SnB_preview,
author = {Mosquera-Lois, Irea and Kavanagh, Seán R.},
title = {In search of hidden defects},
journal = {Matter},
volume = {4},
number = {8},
pages = {2602--2605},
year = {2021},
doi = {10.1016/j.matt.2021.06.003},
url = {https://www.cell.com/matter/abstract/S2590-2385(21)00273-3},
eprint = {https://www.cell.com/matter/abstract/S2590-2385(21)00273-3},
}
```
GitHub Events
Total
- Create event: 3
- Release event: 3
- Issues event: 8
- Watch event: 15
- Delete event: 2
- Issue comment event: 31
- Push event: 56
- Pull request review event: 24
- Pull request review comment event: 22
- Pull request event: 7
- Fork event: 3
Last Year
- Create event: 3
- Release event: 3
- Issues event: 8
- Watch event: 15
- Delete event: 2
- Issue comment event: 31
- Push event: 56
- Pull request review event: 24
- Pull request review comment event: 22
- Pull request event: 7
- Fork event: 3
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Sean Kavanagh | s****9@i****k | 1,005 |
| ireaml | i****8@g****m | 382 |
| dependabot[bot] | 4****] | 1 |
| Andrew S. Rosen | a****3@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 28
- Total pull requests: 65
- Average time to close issues: 29 days
- Average time to close pull requests: 1 day
- Total issue authors: 15
- Total pull request authors: 4
- Average comments per issue: 3.54
- Average comments per pull request: 0.37
- Merged pull requests: 61
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 9
- Pull requests: 8
- Average time to close issues: about 19 hours
- Average time to close pull requests: 5 days
- Issue authors: 6
- Pull request authors: 1
- Average comments per issue: 2.56
- Average comments per pull request: 1.13
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- kavanase (9)
- Walser52 (3)
- Andrew-S-Rosen (3)
- zhangweiteng (2)
- geli7676 (1)
- leeeru1987 (1)
- kantaimperial (1)
- AndresOrtegaGuerrero (1)
- tommyxuecong (1)
- JaafarMehrez (1)
- zccalgh (1)
- BAN-2 (1)
- lucydot (1)
- ZhivkoL0326 (1)
- zhoufy20 (1)
Pull Request Authors
- kavanase (43)
- ireaml (25)
- Andrew-S-Rosen (2)
- dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 3,743 last-month
- Total dependent packages: 2
- Total dependent repositories: 1
- Total versions: 45
- Total maintainers: 2
pypi.org: shakenbreak
Package to generate and analyse distorted defect structures, in order to identify ground-state and metastable defect configurations.
- Homepage: https://shakenbreak.readthedocs.io/en/latest/index.html
- Documentation: https://shakenbreak.readthedocs.io/en/latest/index.html
- License: MIT
-
Latest release: 24.1.7
published almost 3 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v1 composite
- actions/create-release v1 composite
- actions/setup-python v1 composite
- amitsingh-007/next-release-tag v1.0.0 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v3 composite
- ase *
- click *
- doped >=2.1.0
- hiphive *
- importlib-metadata *
- matplotlib >=3.6
- monty *
- myst-nb *
- numpy >=1.21
- pandas >=1.1.0
- pymatgen >2022.0.17
- pymatgen-analysis-defects *
- recommonmark *
- seaborn *
- shakenbreak *
- sphinx *
- sphinx-book-theme *
- sphinx_click *
- sphinx_design *
- CarrierCapture.jl *
- ase *
- click *
- doped >=2.1.0
- easyunfold *
- hiphive *
- importlib-metadata *
- matplotlib *
- monty *
- myst-nb *
- nonrad *
- numpy >=1.21
- pandas >=1.1.0
- py-sc-fermi *
- pymatgen >2022.0.17
- pymatgen-analysis-defects *
- seaborn *
- shakenbreak *
- sphinx *
- sphinx-book-theme *
- sphinx_click *
- sphinx_design *
- ase *
- click >8.0
- doped >=2.1.0
- hiphive >=1.0
- importlib_metadata *
- matplotlib >=3.6
- monty *
- numpy *
- pandas >=1.1.0
- pymatgen >=2022.10.22
- pymatgen-analysis-defects >=2022.10.28
- seaborn *