|
11 | 11 | { |
12 | 12 | "cell_type": "markdown", |
13 | 13 | "source": [ |
14 | | - "# Create Nanoribbon Edge Passivation\n", |
15 | | - "Passivate nanoribbon edges by detecting and adding passivants to undercoordinated atoms (atoms with fewer neighbors than bulk).\n", |
| 14 | + "# Create Edge Passivation\n", |
| 15 | + "Passivate material edges by detecting and adding passivants to undercoordinated atoms (atoms with fewer neighbors than bulk).\n", |
16 | 16 | "\n", |
17 | 17 | "<h2 style=\"color:green\">Usage</h2>\n", |
18 | 18 | "\n", |
|
60 | 60 | "\n", |
61 | 61 | "# Passivation parameters\n", |
62 | 62 | "PASSIVANT = \"H\" # Chemical element for passivating atom\n", |
63 | | - "BOND_LENGTH = 1.0 # Distance from atom to passivant, in Angstroms\n", |
| 63 | + "BOND_LENGTH = 1.09 # Distance from atom to passivant, in Angstroms\n", |
64 | 64 | "\n", |
65 | 65 | "# Undercoordinated atoms search algorithm parameters\n", |
66 | | - "COORDINATION_THRESHOLD = 5 # Coordination threshold, below which passivation is applied to the atom\n", |
67 | | - "COORDINATION_SEARCH_RADIUS = 2.5 # Distance to look for neighbors for coordination, in Angstroms\n", |
68 | | - "SEARCH_DEPTH = 5.0 # How deep to look for surface atoms, in Angstroms. Ignored for 2D materials\n", |
| 66 | + "COORDINATION_THRESHOLD = 2 # Coordination threshold, below which passivation is applied to the atom\n", |
| 67 | + "COORDINATION_SEARCH_RADIUS = 3.0 # Distance to look for neighbors for coordination, in Angstroms\n", |
| 68 | + "MAX_BONDS_TO_PASSIVATE = 1 # Maximum number of bonds to passivate\n", |
| 69 | + "\n", |
| 70 | + "SYMMETRY_TOLERANCE = 0.1 # Tolerance for symmetry analysis of existing bonds\n", |
69 | 71 | "\n", |
70 | 72 | "# Visualization parameters\n", |
71 | 73 | "SHOW_INTERMEDIATE_STEPS = True\n", |
|
142 | 144 | { |
143 | 145 | "cell_type": "markdown", |
144 | 146 | "source": [ |
145 | | - "## 2. Analyze Coordination Numbers and Select Threshold\n" |
| 147 | + "## 2. Analyze Coordination Numbers and Select Threshold\n", |
| 148 | + "### 2.1. Plot RDF to estimate coordination search radius" |
146 | 149 | ], |
147 | 150 | "metadata": { |
148 | 151 | "collapsed": false |
149 | 152 | }, |
150 | 153 | "id": "b5940fc50c11c7b8" |
151 | 154 | }, |
| 155 | + { |
| 156 | + "cell_type": "code", |
| 157 | + "outputs": [], |
| 158 | + "source": [ |
| 159 | + "from utils.plot import plot_rdf\n", |
| 160 | + "\n", |
| 161 | + "plot_rdf(nanoribbon, cutoff=10.0)" |
| 162 | + ], |
| 163 | + "metadata": { |
| 164 | + "collapsed": false |
| 165 | + }, |
| 166 | + "id": "575e8fba623c06e4", |
| 167 | + "execution_count": null |
| 168 | + }, |
| 169 | + { |
| 170 | + "cell_type": "markdown", |
| 171 | + "source": [ |
| 172 | + "### 2.2. GEt coordination numbers and set coordination threshold" |
| 173 | + ], |
| 174 | + "metadata": { |
| 175 | + "collapsed": false |
| 176 | + }, |
| 177 | + "id": "b89dc754926f1ce4" |
| 178 | + }, |
152 | 179 | { |
153 | 180 | "cell_type": "code", |
154 | 181 | "outputs": [], |
|
161 | 188 | " passivant=PASSIVANT,\n", |
162 | 189 | " bond_length=BOND_LENGTH\n", |
163 | 190 | ")\n", |
164 | | - "coordination_numbers = sorted(list(get_unique_coordination_numbers(config)))\n", |
| 191 | + "coordination_numbers = get_unique_coordination_numbers(config, cutoff=COORDINATION_SEARCH_RADIUS)\n", |
165 | 192 | "print(f\"Unique coordination numbers: {coordination_numbers}\")\n", |
166 | 193 | "\n", |
167 | 194 | "coordination_threshold = COORDINATION_THRESHOLD\n", |
168 | 195 | "if IS_COORDINATION_SELECTION_INTERACTIVE:\n", |
169 | 196 | " coordination_threshold = await select_coordination_threshold(\n", |
170 | 197 | " coordination_numbers, COORDINATION_THRESHOLD\n", |
171 | | - " ) \n", |
172 | | - " \n", |
| 198 | + " )\n", |
| 199 | + "\n", |
173 | 200 | "print(f\"\\nSelected coordination threshold: {coordination_threshold}\")\n", |
174 | 201 | "print(f\"Atoms with coordination < {coordination_threshold} will be passivated\")" |
175 | 202 | ], |
|
199 | 226 | "\n", |
200 | 227 | "builder_params = CoordinationBasedPassivationBuilderParameters(\n", |
201 | 228 | " shadowing_radius=COORDINATION_SEARCH_RADIUS,\n", |
202 | | - " depth=SEARCH_DEPTH,\n", |
203 | | - " coordination_threshold=coordination_threshold\n", |
| 229 | + " coordination_threshold=coordination_threshold,\n", |
| 230 | + " bonds_to_passivate=MAX_BONDS_TO_PASSIVATE,\n", |
| 231 | + " symmetry_tolerance=SYMMETRY_TOLERANCE\n", |
204 | 232 | ")\n", |
205 | 233 | "\n", |
206 | 234 | "builder = CoordinationBasedPassivationBuilder(build_parameters=builder_params)" |
|
268 | 296 | { |
269 | 297 | "cell_type": "markdown", |
270 | 298 | "source": [ |
271 | | - "### 5. Pass data to the outside runtime\n" |
| 299 | + "## 5. Pass data to the outside runtime\n" |
272 | 300 | ], |
273 | 301 | "metadata": { |
274 | 302 | "collapsed": false |
|
281 | 309 | "source": [ |
282 | 310 | "from utils.jupyterlite import set_materials\n", |
283 | 311 | "\n", |
| 312 | + "passivated_nanoribbon.name = f\"{nanoribbon.name} passivated\"\n", |
284 | 313 | "set_materials(passivated_nanoribbon)" |
285 | 314 | ], |
286 | 315 | "metadata": { |
|
0 commit comments