|
1 | | -# sqs_substitution_tool |
| 1 | +# 🔁 SQS Substitution Tool |
2 | 2 |
|
3 | 3 | [](https://naveen-dandu.github.io/sqs_substitution_tool/) |
4 | 4 | [](https://github.com/naveen-dandu/sqs_substitution_tool/actions) |
5 | 5 | [](LICENSE) |
6 | 6 |
|
7 | 7 | A substitution-based randomizer for generating VASP-compatible POSCAR files. |
| 8 | + |
| 9 | +A Python-based command-line utility to perform **site substitution** in crystal structures (POSCAR/CONTCAR format), enabling the generation of **Special Quasirandom Structures (SQS)** for binary, ternary, or quaternary materials systems. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## 🔍 Overview |
| 14 | + |
| 15 | +This tool automates the substitution of atoms in a crystal lattice with customizable control over: |
| 16 | +- **Which elements to replace** |
| 17 | +- **How many atoms to substitute** |
| 18 | +- Randomized sampling of configurations (without replacement) |
| 19 | +- Output format in standard VASP-compatible POSCAR format |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 🧪 Use Case |
| 24 | + |
| 25 | +Simulating alloy or doped systems such as: |
| 26 | + |
| 27 | +- Substituting `O` with `S` in ZnO₂ |
| 28 | +- Generating SQS-like structures for CoBHT by replacing Co atoms with Ni, Mn, or Cu |
| 29 | +- Studying defect energetics or composition-dependent electronic structure |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## 🚀 Installation |
| 34 | + |
| 35 | +```bash |
| 36 | +git clone https://github.com/naveen-dandu/sqs_substitution_tool.git |
| 37 | +cd sqs_substitution_tool |
| 38 | +pip install -r requirements.txt # optional, if needed |
| 39 | +``` |
| 40 | +--- |
| 41 | + |
| 42 | +## 🔀 SQS Substitution Tool |
| 43 | +This Python script provides an interactive CLI interface for performing simple SQS-like random substitutions on atoms in a VASP structure (POSCAR) using pymatgen. |
| 44 | + |
| 45 | +## 📦 Features |
| 46 | +Select a host atom to substitute |
| 47 | +Specify the number of substitutions |
| 48 | +Choose multiple elements to substitute with |
| 49 | +Performs randomized substitutions over the specified host atom indices |
| 50 | +Outputs a modified structure as POSCAR_substituted |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## 🖥️ Usage |
| 55 | + |
| 56 | +```bash |
| 57 | +python sqs_prompt_substitute.py |
| 58 | +``` |
| 59 | + |
| 60 | +You will be prompted interactively: |
| 61 | + |
| 62 | +```vbnet |
| 63 | + |
| 64 | +Which atom do you want to substitute (e.g., Co)? Co |
| 65 | +Found 3 atoms of Co. |
| 66 | +How many atoms do you want to substitute? [1 <= n <= 12] 2 |
| 67 | +Enter substitution elements (e.g., Cu Ni Mn): Cu Mn |
| 68 | + |
| 69 | +✅ Substitution complete. Output written to POSCAR_substituted |
| 70 | +🧬 Replacements made: |
| 71 | + - Atom index 1 → Cu |
| 72 | + - Atom index 2 → Mn |
| 73 | +``` |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## 📁 Input |
| 78 | +Ensure a file named POSCAR_CoBHT is present in the same directory. |
| 79 | +This should be a valid VASP POSCAR file readable by pymatgen. |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## 📤 Output |
| 84 | +A new file POSCAR_substituted will be generated with the substituted atoms. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## 🛠 Requirements |
| 89 | +Python 3.7+ |
| 90 | +pymatgen |
| 91 | + |
| 92 | +Install via pip: |
| 93 | + |
| 94 | +```bash |
| 95 | + |
| 96 | +pip install pymatgen |
| 97 | +``` |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +🧠 Features |
| 102 | + Works with any crystal structure containing labeled atoms |
| 103 | + Supports binary, ternary, and quaternary systems |
| 104 | + Tracks replaced atom indices for reproducibility |
| 105 | + Prepares data for machine learning and SQS generation |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## 📄 License |
| 110 | +MIT License. See LICENSE. |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +## 👨🔬 Author |
| 115 | +Developed by Naveen Dandu, with integration in materials data workflows. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## 📣 Citation |
| 120 | + |
| 121 | +If you use this tool for your research or publication, please cite: |
| 122 | + |
| 123 | +``` |
| 124 | +@software{sqs_sub_tool, |
| 125 | + author = {Naveen Dandu}, |
| 126 | + title = {SQS Substitution Tool}, |
| 127 | + year = 2025, |
| 128 | + url = {https://github.com/naveen-dandu/sqs_substitution_tool} |
| 129 | +} |
| 130 | +``` |
| 131 | + |
0 commit comments