PSH(Phase Hunter) is a Python-based toolkit for crystal structure scanning and phase-transition candidate exploration.
It is designed to generate symmetry-broken distorted structures from a parent crystal structure and to support systematic searches for possible low-symmetry phases.
The main entry script is:
run_phase_hunter.pyPSH is intended for research workflows involving:
- crystal phase exploration
- symmetry-breaking distortion scans
- Landau-mode-inspired structural perturbations
- high-symmetry k-point mode generation
- distorted structure reduction
- space-group-based output organization
- SLURM-based high-throughput execution
It is especially useful for first-principles studies where one wants to explore possible hidden, metastable, or symmetry-lowered phases derived from a high-symmetry parent structure.
PSH/
├── README.md
├── run_phase_hunter.py
└── phase_hunter/
├── config.py # Default parameters, CLI overrides, and derived configs
├── cli.py # Command-line interface and SLURM-related branches
├── scan_engine.py # Core single/combo scan execution
├── persistence.py # Output writing: JSONL, CSV, POSCAR, checkpoint
└── runtime_io.py # Runtime directory and log management
└── ...
Python 3.10 or later is recommended.
Core dependencies:
python -m pip install numpy scipy spglib seekpathRequired packages:
numpyscipyspglibseekpath
python run_phase_hunter.py --helppython run_phase_hunter.pyBy default, the program reads the parent structure defined in the configuration file and starts the scan using the default settings.
python run_phase_hunter.py --parent-poscar parent.vasppython run_phase_hunter.py --output-dir phase_scan_resultsPSH supports generating and submitting SLURM jobs.
python run_phase_hunter.py --write-slurmpython run_phase_hunter.py --submit-slurm| Option | Description |
|---|---|
--parent-poscar PATH |
Path to the parent POSCAR/VASP structure |
--output-dir PATH |
Directory for scan outputs |
Example:
python run_phase_hunter.py \
--parent-poscar parent.vasp \
--output-dir results| Option | Description |
|---|---|
--structure-dimensionality {2d,3d} |
Specify whether the structure is treated as 2D or 3D |
--high-symmetry-kpoint-selection {path_endpoints,all_point_coords,labels} |
Method for selecting high-symmetry k points |
--high-symmetry-kpoint-labels "K1,K2,..." |
Manually select high-symmetry labels |
--exclude-gamma-high-symmetry |
Exclude the Γ point from selected high-symmetry k points |
Example:
python run_phase_hunter.py \
--structure-dimensionality 3d \
--high-symmetry-kpoint-selection path_endpoints| Option | Description |
|---|---|
--failure-policy strict |
Stop immediately when an error occurs |
--failure-policy debug |
Provide more debugging information |
--failure-policy permissive |
Continue when non-critical failures occur |
Example:
python run_phase_hunter.py --failure-policy strict| Option | Description |
|---|---|
--reduce-distorted-symprec FLOAT |
Symmetry tolerance used for reducing distorted structures |
--reduce-distorted-skip-if-amplitude-below FLOAT |
Skip reduction when the distortion amplitude is below this threshold |
Example:
python run_phase_hunter.py \
--reduce-distorted-symprec 0.1 \
--reduce-distorted-skip-if-amplitude-below 1e-4A typical output directory may contain:
output/
├── scan_results.jsonl
├── scan_results.csv
├── checkpoint.json
├── run.log
├── structures_by_sg/
├── hit_structures_by_sg/
└── *.structure_metadata.json
| File or Directory | Description |
|---|---|
scan_results.jsonl |
Main scan results in JSON Lines format |
scan_results.csv |
Optional CSV summary of scan results |
checkpoint.json |
Checkpoint file for restart or continuation |
run.log |
Runtime log file |
structures_by_sg/ |
Generated structures grouped by space group |
hit_structures_by_sg/ |
Candidate structures grouped by space group |
*.structure_metadata.json |
Metadata for generated or reduced structures |
A typical PSH workflow is:
1. Prepare parent POSCAR structure
2. Configure scan parameters in phase_hunter/config.py
3. Run run_phase_hunter.py
4. Generate distorted structures
5. Reduce distorted cells when applicable
6. Identify space groups
7. Write structures and metadata
8. Analyze candidate phases
Example command:
python run_phase_hunter.py \
--parent-poscar parent.vasp \
--output-dir scan_output \
--failure-policy strict \
--debug-print-planIf the program reports missing packages, check the current Python environment:
python -m pip show numpy scipy spglib seekpathThen install missing packages:
python -m pip install numpy scipy spglib seekpathpython run_phase_hunter.py \
--debug \
--debug-stop-after-stage configFor quick debugging, consider:
- using a smaller scan profile
- reducing the number of trials
- disabling CSV output
- increasing flush intervals
- increasing print intervals
For example, modify the following options in phase_hunter/config.py:
WRITE_RESULTS_CSV = False
FLUSH_EVERY_N_RECORDS = 100
PRINT_EVERY_N_TRIALS = 100- The recommended entry point is
run_phase_hunter.py. - Most default parameters are configured in
phase_hunter/config.py. - For high-throughput calculations, SLURM mode is recommended.
- For debugging, use
--debugtogether with--debug-stop-after-stage.
A symmetry-driven crystal phase exploration toolkit for generating and screening distorted structures from parent phases.
Please add a license before public release, for example:
- MIT License
- Apache License 2.0
- GPLv3
If this code is used in academic work, please cite the corresponding paper or repository once available.
Citation information will be added here.