Tutorials#
Python API#
Usage of ShakeNBreak from a Python API is exemplified in the SnB Python API Tutorial, which includes:
SnB
Python APIShakeNBreak
applied to Cd vacancies in CdTe (VCd)- Table of contents
- 1. Generate defects with
doped
/pymatgen
- 2. Apply the
SnB
method to your defects - 3. Send to HPCs and run relaxations
- 4. Plot energies vs distortion
- 5. Optional: Analyse the defect distortions found with
SnB
- 6. Optional: Input File Generation for Other Codes
Command line interface (CLI)#
Additionally, the core functionality of the code can be accessed through the command line, with the following commands:
- Generation of distorted structures and/or their relaxation input files:
for a specific defect: snb-generate
for all defects present in a directory: snb-generate_all
- Submitting the geometry optimisations to the HPC scheduler:
- Parsing of the geometry optimisation results:
- Analysis of the energies and structural differences between the relaxed configurations:
- Plotting of energy vs distortions to identify what energy lowering reconstructions have been found:
- Identification of defect species undergoing energy-lowering distortions and test these distortions for the other charge states of the defect
- Saving the ground state structures
All commands are documented in the Python API section, and their use is exemplified in the following pages:
Getting help#
Beyond the documentation, we can get a full list of accepted flags and
their description using the --help
or -h
flag, e.g.:
$ snb-generate --help
> Usage: snb-generate [OPTIONS]
Generate the trial distortions for structure-searching for a given defect.
Options:
-d, --defect FILE Path to defect structure [required]
-b, --bulk FILE Path to bulk structure [required]
-c, --charge INTEGER Defect charge state
--min-charge, --min INTEGER Minimum defect charge state for which to
--max-charge, --max INTEGER Maximum defect charge state for which to
generate distortions
--defect-index, --idx INTEGER Index of defect site in defect structure, in
case auto site-matching fails
--defect-coords, --def-coords <FLOAT FLOAT FLOAT>...
Fractional coordinates of defect site in
defect structure, in case auto site-matching
fails. In the form 'x y z' (3 arguments)
--code TEXT Code to generate relaxation input files for.
Options: 'VASP', 'CP2K', 'espresso',
'CASTEP', 'FHI-aims'. Defaults to 'VASP'
-n, --name TEXT Defect name for folder and metadata
generation. Defaults to doped scheme
(see tutorials)
--config FILE Config file for advanced distortion
settings. See example
in/input_files/example_generate_config.yaml
-v, --verbose Print information about identified defects
and generated distortions
-h, --help Show this help message and exit