Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
ced9fb3
1
Parent(s):
15cff3c
reorganize examples
Browse files
app.py
CHANGED
@@ -218,339 +218,462 @@ def main():
|
|
218 |
As you try each one, look at how the inputs change below, and the simulation outputs change on the right. Feel free to try changing some of the settings below and re-run the simulations to see how the results can vary.
|
219 |
"""
|
220 |
)
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
],
|
268 |
-
[
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
"
|
275 |
-
"
|
276 |
-
|
277 |
-
|
278 |
-
"High-entropy alloys are materials with 4 or more elements, and this example shows the OMat model can also be applied to HEAs. This particular HEA is equimolar Cr/Fe/Ni/Sn, but could exist in other lattice configurations. ",
|
279 |
],
|
280 |
-
[
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
0,
|
292 |
-
1,
|
293 |
-
"This example shows the OC20 model can be applied to small molecules on a catalyst surface, and that OC20 has recently been extended with datasets for multi-adsorbate interactions. Notice some of the adsorbates wrap around the periodic boundary conditions. Some of the adsorbates are weakly bound and desorbing from the surface based on this starting configuration.",
|
294 |
],
|
295 |
-
[
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
200,
|
301 |
-
20,
|
302 |
-
1.0,
|
303 |
-
300.0,
|
304 |
-
"NVE",
|
305 |
-
"OMat",
|
306 |
-
0,
|
307 |
-
1,
|
308 |
-
"This example is an experimentally solved crystal structure for a thiolate protected gold nanocluster from an[open-access academic paper](https://pubs.rsc.org/en/content/articlelanding/2016/sc/c5sc02134k) and [available in the COD](https://www.crystallography.net/cod/1540567.html). This is a fun example because it combines small molecules, inorganic materials, and surface chemistry, so it's not so clear which task to use. Try the OMat, OMol, and OC20 tasks to see how the results differ! Further, the experimental paper reported different crystal structures based on the charge and spin multiplicity, so try changing the charge and spin multiplicity to see how the results differ.",
|
309 |
],
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
],
|
325 |
-
[
|
326 |
-
|
327 |
-
|
328 |
-
/ "./examples/ethylene_carbonate.xyz"
|
329 |
-
),
|
330 |
-
500,
|
331 |
-
20,
|
332 |
-
1.0,
|
333 |
-
1000.0,
|
334 |
-
"NVE",
|
335 |
-
"OMol",
|
336 |
-
-1,
|
337 |
-
2,
|
338 |
-
"With charge of -1 and spin multiplicity of 2, this radical anion version of ethylene carbonate is much less stable than the neutral version and can undergo spontaneous ring-opening at high temperatures, which initiates the formation of a battery's solid/electrolyte interface (SEI). If the simulation doesn't show a ring opening reaction, try clicking the molecular dynamic buttons again to see another short simulation. Only OMol currently supports arbitrary charge/spin multiplicity.",
|
339 |
],
|
340 |
-
[
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
1,
|
352 |
-
"This is a solvated structure of a small protein fragment using the OMol task. Very little is likely happen in a very short MD simulations. Try increasing the number of MD steps to see how the protein moves. You can also try using the OMat task, but be careful with the results since the OMat task is not trained on solvated systems.",
|
353 |
],
|
354 |
-
[
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
200,
|
360 |
-
20,
|
361 |
-
1.0,
|
362 |
-
300.0,
|
363 |
-
"NVE",
|
364 |
-
"ODAC",
|
365 |
-
0,
|
366 |
-
1,
|
367 |
-
"This is a metal organic framework (MOF) structure using the ODac task. You might study structures like if designing MOFs for direct air capture calculations. Look carefully for the red/gray CO2 molecule in the pores of the MOF! You can also try the OMol and OMat tasks to see if the results differ.",
|
368 |
],
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
"
|
373 |
-
|
374 |
-
"High-entropy alloy",
|
375 |
-
"Catalyst surface/adsorbate",
|
376 |
-
"Ligated gold nanoparticle crystal",
|
377 |
-
"Neutral ethylene carbonate",
|
378 |
-
"Radical anion ethylene carbonate",
|
379 |
-
"Solvated protein",
|
380 |
-
"CO2 in a metal organic framework",
|
381 |
-
],
|
382 |
-
inputs=[
|
383 |
-
input_structure,
|
384 |
-
md_steps,
|
385 |
-
prerelax_steps,
|
386 |
-
md_timestep,
|
387 |
-
temperature_k,
|
388 |
-
md_ensemble,
|
389 |
-
task_name,
|
390 |
-
total_charge,
|
391 |
-
spin_multiplicity,
|
392 |
-
explanation_buffer,
|
393 |
-
],
|
394 |
-
outputs=[
|
395 |
-
output_traj,
|
396 |
-
output_text,
|
397 |
-
reproduction_script,
|
398 |
-
explanation,
|
399 |
-
],
|
400 |
-
fn=run_md_simulation,
|
401 |
-
run_on_click=True,
|
402 |
-
cache_examples=True,
|
403 |
-
label="Molecular Dynamics Examples",
|
404 |
-
)
|
405 |
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
|
|
433 |
],
|
434 |
-
[
|
435 |
-
|
436 |
-
|
437 |
-
/ "./examples/metal_cplx.pdb"
|
438 |
-
),
|
439 |
-
300,
|
440 |
-
0.05,
|
441 |
-
"OMol",
|
442 |
-
1,
|
443 |
-
6,
|
444 |
-
False,
|
445 |
-
"This metal complex showcases the UMA's ability to handle complicated transition metal complexes with ligands, spin, and charge.",
|
446 |
],
|
447 |
-
[
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
1,
|
457 |
-
True,
|
458 |
-
"This organic crystal showcases the UMA's ability to handle organic molecular crystals using the OMC task, using a random packing of a molecule from OE62. You could also try using the OMol or OMat tasks and see how the simulations differ!",
|
459 |
],
|
460 |
-
[
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
300,
|
466 |
-
0.05,
|
467 |
-
"OMat",
|
468 |
-
0,
|
469 |
-
1,
|
470 |
-
True,
|
471 |
-
"This inorganic crystal from the Materials Project showcases the UMA's ability to handle inorganic materials using the OMat task. You should be careful with the output energies since the analysis might require careful application of the Materials Project GGA/GGA+U correction schemes.",
|
472 |
],
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
],
|
483 |
-
[
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
"
|
491 |
-
|
492 |
-
1,
|
493 |
-
False,
|
494 |
-
"This example shows the OC20 model can be applied to small molecules on a catalyst surface, and that OC20 has recently been extended with datasets for multi-adsorbate interactions. Notice some of the adsorbates wrap around the periodic boundary conditions. Some of the adsorbates are weakly bound and desorbing from the surface based on this starting configuration.",
|
495 |
],
|
496 |
-
[
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
],
|
508 |
-
[
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
300,
|
514 |
-
0.05,
|
515 |
-
"ODAC",
|
516 |
-
0,
|
517 |
-
1,
|
518 |
-
False,
|
519 |
-
"This is a porous material similar to a zeolite using the ODac task. You might study structures like if designing materials for direct air capture (DAC) calculations. Look carefully for the co-adsorption between CO2 and two water molecules in the pore, which you might study if you were interested in the effect of humidity on DAC performance! You can also try the OMol and OMat tasks to see if the results differ.",
|
520 |
],
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
"
|
525 |
-
|
526 |
-
|
527 |
-
"Inorganic crystal",
|
528 |
-
"High-entropy alloy",
|
529 |
-
"Catalyst surface/adsorbate",
|
530 |
-
"Solvated protein",
|
531 |
-
"Co-adsorbed H2O/CO2 in a porous material",
|
532 |
-
],
|
533 |
-
inputs=[
|
534 |
-
input_structure,
|
535 |
-
optimization_steps,
|
536 |
-
fmax,
|
537 |
-
task_name,
|
538 |
-
total_charge,
|
539 |
-
spin_multiplicity,
|
540 |
-
relax_unit_cell,
|
541 |
-
explanation_buffer,
|
542 |
-
],
|
543 |
-
outputs=[
|
544 |
-
output_traj,
|
545 |
-
output_text,
|
546 |
-
reproduction_script,
|
547 |
-
explanation,
|
548 |
-
],
|
549 |
-
fn=run_relaxation_simulation,
|
550 |
-
run_on_click=True,
|
551 |
-
cache_examples=True,
|
552 |
-
label="Relaxation examples!",
|
553 |
-
)
|
554 |
|
555 |
gr.Markdown(
|
556 |
"""
|
|
|
218 |
As you try each one, look at how the inputs change below, and the simulation outputs change on the right. Feel free to try changing some of the settings below and re-run the simulations to see how the results can vary.
|
219 |
"""
|
220 |
)
|
221 |
+
|
222 |
+
with gr.Accordion(
|
223 |
+
"UMA can handle many different materials/chemical structures!",
|
224 |
+
open=True,
|
225 |
+
):
|
226 |
+
gr.Examples(
|
227 |
+
examples=[
|
228 |
+
[
|
229 |
+
str(
|
230 |
+
Path(__file__).parent
|
231 |
+
/ "./examples/metal_cplx.pdb"
|
232 |
+
),
|
233 |
+
100,
|
234 |
+
20,
|
235 |
+
1.0,
|
236 |
+
300.0,
|
237 |
+
"NVE",
|
238 |
+
"OMol",
|
239 |
+
1,
|
240 |
+
6,
|
241 |
+
"This metal complex showcases the UMA's ability to handle complicated transition metal complexes with ligands, spin, and charge.",
|
242 |
+
],
|
243 |
+
[
|
244 |
+
str(
|
245 |
+
Path(__file__).parent
|
246 |
+
/ "./examples/organic_molecular_crystal.cif"
|
247 |
+
),
|
248 |
+
200,
|
249 |
+
20,
|
250 |
+
1.0,
|
251 |
+
300.0,
|
252 |
+
"NVE",
|
253 |
+
"OMC",
|
254 |
+
0,
|
255 |
+
1,
|
256 |
+
"This organic crystal showcases the UMA's ability to handle organic molecular crystals using the OMC task, using a random packing of a molecule from OE62. You could also try using the OMol or OMat tasks and see how the simulations differ!",
|
257 |
+
],
|
258 |
+
[
|
259 |
+
str(
|
260 |
+
Path(__file__).parent
|
261 |
+
/ "./examples/inorganic_crystal.cif"
|
262 |
+
),
|
263 |
+
200,
|
264 |
+
20,
|
265 |
+
1.0,
|
266 |
+
300.0,
|
267 |
+
"NVE",
|
268 |
+
"OMat",
|
269 |
+
0,
|
270 |
+
1,
|
271 |
+
"This inorganic crystal from the Materials Project showcases the UMA's ability to handle inorganic materials using the OMat task. You should be careful with the output energies since the analysis might require careful application of the Materials Project GGA/GGA+U correction schemes.",
|
272 |
+
],
|
273 |
+
[
|
274 |
+
str(
|
275 |
+
Path(__file__).parent / "./examples/HEA.cif"
|
276 |
+
),
|
277 |
+
200,
|
278 |
+
20,
|
279 |
+
1.0,
|
280 |
+
300.0,
|
281 |
+
"NVE",
|
282 |
+
"OMat",
|
283 |
+
0,
|
284 |
+
1,
|
285 |
+
"High-entropy alloys are materials with 4 or more elements, and this example shows the OMat model can also be applied to HEAs. This particular HEA is equimolar Cr/Fe/Ni/Sn, but could exist in other lattice configurations. ",
|
286 |
+
],
|
287 |
+
[
|
288 |
+
str(
|
289 |
+
Path(__file__).parent
|
290 |
+
/ "./examples/catalyst.traj"
|
291 |
+
),
|
292 |
+
200,
|
293 |
+
20,
|
294 |
+
1.0,
|
295 |
+
300.0,
|
296 |
+
"NVE",
|
297 |
+
"OC20",
|
298 |
+
0,
|
299 |
+
1,
|
300 |
+
"This example shows the OC20 model can be applied to small molecules on a catalyst surface, and that OC20 has recently been extended with datasets for multi-adsorbate interactions. Notice some of the adsorbates wrap around the periodic boundary conditions. Some of the adsorbates are weakly bound and desorbing from the surface based on this starting configuration.",
|
301 |
+
],
|
302 |
+
[
|
303 |
+
str(
|
304 |
+
Path(__file__).parent
|
305 |
+
/ "./examples/gold_nanoparticle_crystal.cif"
|
306 |
+
),
|
307 |
+
200,
|
308 |
+
20,
|
309 |
+
1.0,
|
310 |
+
300.0,
|
311 |
+
"NVE",
|
312 |
+
"OMat",
|
313 |
+
0,
|
314 |
+
1,
|
315 |
+
"This example is an experimentally solved crystal structure for a thiolate protected gold nanocluster from an[open-access academic paper](https://pubs.rsc.org/en/content/articlelanding/2016/sc/c5sc02134k) and [available in the COD](https://www.crystallography.net/cod/1540567.html). This is a fun example because it combines small molecules, inorganic materials, and surface chemistry, so it's not so clear which task to use. Try the OMat, OMol, and OC20 tasks to see how the results differ! Further, the experimental paper reported different crystal structures based on the charge and spin multiplicity, so try changing the charge and spin multiplicity to see how the results differ.",
|
316 |
+
],
|
317 |
+
[
|
318 |
+
str(
|
319 |
+
Path(__file__).parent
|
320 |
+
/ "./examples/ethylene_carbonate.xyz"
|
321 |
+
),
|
322 |
+
500,
|
323 |
+
20,
|
324 |
+
1.0,
|
325 |
+
1000.0,
|
326 |
+
"NVE",
|
327 |
+
"OMol",
|
328 |
+
0,
|
329 |
+
1,
|
330 |
+
"Ethylene carbonate is a common electrolyte in batteries, and an important precursor to the solid/electrolyte interface (SEI) formation. This example is the neutral version of ethylene carbonate and it is quite stable even at high temperatures! Try the radical anion version of ethylene carbonate in the next example.",
|
331 |
+
],
|
332 |
+
[
|
333 |
+
str(
|
334 |
+
Path(__file__).parent
|
335 |
+
/ "./examples/protein.pdb"
|
336 |
+
),
|
337 |
+
200,
|
338 |
+
20,
|
339 |
+
1.0,
|
340 |
+
300.0,
|
341 |
+
"NVE",
|
342 |
+
"OMol",
|
343 |
+
0,
|
344 |
+
1,
|
345 |
+
"This is a solvated structure of a small protein fragment using the OMol task. Very little is likely happen in a very short MD simulations. Try increasing the number of MD steps to see how the protein moves. You can also try using the OMat task, but be careful with the results since the OMat task is not trained on solvated systems.",
|
346 |
+
],
|
347 |
+
[
|
348 |
+
str(
|
349 |
+
Path(__file__).parent
|
350 |
+
/ "./examples/MOF_CO2.traj"
|
351 |
+
),
|
352 |
+
200,
|
353 |
+
20,
|
354 |
+
1.0,
|
355 |
+
300.0,
|
356 |
+
"NVE",
|
357 |
+
"ODAC",
|
358 |
+
0,
|
359 |
+
1,
|
360 |
+
"This is a metal organic framework (MOF) structure using the ODac task. You might study structures like if designing MOFs for direct air capture calculations. Look carefully for the red/gray CO2 molecule in the pores of the MOF! You can also try the OMol and OMat tasks to see if the results differ.",
|
361 |
+
],
|
362 |
],
|
363 |
+
example_labels=[
|
364 |
+
"Transition metal complex",
|
365 |
+
"Organic molecular crystal",
|
366 |
+
"Inorganic crystal",
|
367 |
+
"High-entropy alloy",
|
368 |
+
"Catalyst surface/adsorbate",
|
369 |
+
"Ligated gold nanoparticle crystal",
|
370 |
+
"Neutral ethylene carbonate",
|
371 |
+
"Solvated protein",
|
372 |
+
"CO2 in a metal organic framework",
|
|
|
373 |
],
|
374 |
+
inputs=[
|
375 |
+
input_structure,
|
376 |
+
md_steps,
|
377 |
+
prerelax_steps,
|
378 |
+
md_timestep,
|
379 |
+
temperature_k,
|
380 |
+
md_ensemble,
|
381 |
+
task_name,
|
382 |
+
total_charge,
|
383 |
+
spin_multiplicity,
|
384 |
+
explanation_buffer,
|
|
|
|
|
|
|
385 |
],
|
386 |
+
outputs=[
|
387 |
+
output_traj,
|
388 |
+
output_text,
|
389 |
+
reproduction_script,
|
390 |
+
explanation,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
],
|
392 |
+
fn=run_md_simulation,
|
393 |
+
run_on_click=True,
|
394 |
+
cache_examples=True,
|
395 |
+
label="Molecular Dynamics Examples",
|
396 |
+
)
|
397 |
+
|
398 |
+
with gr.Accordion(
|
399 |
+
"UMA with OMol head can handle complex charge and spin multiplicity!",
|
400 |
+
open=False,
|
401 |
+
):
|
402 |
+
gr.Examples(
|
403 |
+
examples=[
|
404 |
+
[
|
405 |
+
str(
|
406 |
+
Path(__file__).parent
|
407 |
+
/ "./examples/ethylene_carbonate.xyz"
|
408 |
+
),
|
409 |
+
500,
|
410 |
+
20,
|
411 |
+
1.0,
|
412 |
+
1000.0,
|
413 |
+
"NVE",
|
414 |
+
"OMol",
|
415 |
+
0,
|
416 |
+
1,
|
417 |
+
"Ethylene carbonate is a common electrolyte in batteries, and an important precursor to the solid/electrolyte interface (SEI) formation. This example is the neutral version of ethylene carbonate and it is quite stable even at high temperatures! Try the radical anion version of ethylene carbonate in the next example.",
|
418 |
+
],
|
419 |
+
[
|
420 |
+
str(
|
421 |
+
Path(__file__).parent
|
422 |
+
/ "./examples/ethylene_carbonate.xyz"
|
423 |
+
),
|
424 |
+
500,
|
425 |
+
20,
|
426 |
+
1.0,
|
427 |
+
1000.0,
|
428 |
+
"NVE",
|
429 |
+
"OMol",
|
430 |
+
-1,
|
431 |
+
2,
|
432 |
+
"With charge of -1 and spin multiplicity of 2, this radical anion version of ethylene carbonate is much less stable than the neutral version and can undergo spontaneous ring-opening at high temperatures, which initiates the formation of a battery's solid/electrolyte interface (SEI). If the simulation doesn't show a ring opening reaction, try clicking the molecular dynamic buttons again to see another short simulation. Only OMol currently supports arbitrary charge/spin multiplicity.",
|
433 |
+
],
|
434 |
],
|
435 |
+
example_labels=[
|
436 |
+
"Neutral ethylene carbonate",
|
437 |
+
"Radical anion ethylene carbonate",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
],
|
439 |
+
inputs=[
|
440 |
+
input_structure,
|
441 |
+
md_steps,
|
442 |
+
prerelax_steps,
|
443 |
+
md_timestep,
|
444 |
+
temperature_k,
|
445 |
+
md_ensemble,
|
446 |
+
task_name,
|
447 |
+
total_charge,
|
448 |
+
spin_multiplicity,
|
449 |
+
explanation_buffer,
|
|
|
|
|
450 |
],
|
451 |
+
outputs=[
|
452 |
+
output_traj,
|
453 |
+
output_text,
|
454 |
+
reproduction_script,
|
455 |
+
explanation,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
],
|
457 |
+
fn=run_md_simulation,
|
458 |
+
run_on_click=True,
|
459 |
+
cache_examples=True,
|
460 |
+
label="Molecular Dynamics Examples",
|
461 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
|
463 |
+
gr.Examples(
|
464 |
+
examples=[
|
465 |
+
[
|
466 |
+
str(
|
467 |
+
Path(__file__).parent
|
468 |
+
/ "./examples/bis(EDA)Cu.xyz"
|
469 |
+
),
|
470 |
+
300,
|
471 |
+
0.05,
|
472 |
+
"OMol",
|
473 |
+
1,
|
474 |
+
1,
|
475 |
+
False,
|
476 |
+
"This is a super fun example of a transition metal complex that changes its geometry based on the assumed charge/spin multiplicity and actually has different local minima. It highlights the ability of the OMol task to handle these additional inputs. In this first example it forms a tetragonal geometry - try clicking on the next example (with charge=+2 and spin multiplicity 2) to see the other local minima!",
|
477 |
+
],
|
478 |
+
[
|
479 |
+
str(
|
480 |
+
Path(__file__).parent
|
481 |
+
/ "./examples/bis(EDA)Cu.xyz"
|
482 |
+
),
|
483 |
+
300,
|
484 |
+
0.05,
|
485 |
+
"OMol",
|
486 |
+
2,
|
487 |
+
2,
|
488 |
+
False,
|
489 |
+
"This is a super fun example of a transition metal complex that changes its geometry based on the assumed charge/spin multiplicity and actually has different local minima. In contrast to the previous example (charge=+1 and spin multiplicity 1), this one forms a square planar geometry.",
|
490 |
+
],
|
491 |
],
|
492 |
+
example_labels=[
|
493 |
+
"bis(EDA)Cu TM complex with charge=1, spin=1",
|
494 |
+
"bis(EDA)Cu TM complex with charge=2, spin=2",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
],
|
496 |
+
inputs=[
|
497 |
+
input_structure,
|
498 |
+
optimization_steps,
|
499 |
+
fmax,
|
500 |
+
task_name,
|
501 |
+
total_charge,
|
502 |
+
spin_multiplicity,
|
503 |
+
relax_unit_cell,
|
504 |
+
explanation_buffer,
|
|
|
|
|
|
|
505 |
],
|
506 |
+
outputs=[
|
507 |
+
output_traj,
|
508 |
+
output_text,
|
509 |
+
reproduction_script,
|
510 |
+
explanation,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
],
|
512 |
+
fn=run_relaxation_simulation,
|
513 |
+
run_on_click=True,
|
514 |
+
cache_examples=True,
|
515 |
+
label="Relaxation examples!",
|
516 |
+
)
|
517 |
+
with gr.Accordion(
|
518 |
+
"UMA can use different output heads for the same structures", open=False
|
519 |
+
):
|
520 |
+
gr.Examples(
|
521 |
+
examples=[
|
522 |
+
[
|
523 |
+
str(
|
524 |
+
Path(__file__).parent
|
525 |
+
/ "./examples/organic_molecular_crystal.cif"
|
526 |
+
),
|
527 |
+
200,
|
528 |
+
20,
|
529 |
+
1.0,
|
530 |
+
300.0,
|
531 |
+
"NVE",
|
532 |
+
"OMC",
|
533 |
+
0,
|
534 |
+
1,
|
535 |
+
"This organic crystal showcases the UMA's ability to handle organic molecular crystals using the OMC task, using a random packing of a molecule from OE62. You could also try using the OMol or OMat tasks and see how the simulations differ!",
|
536 |
+
],
|
537 |
+
[
|
538 |
+
str(
|
539 |
+
Path(__file__).parent
|
540 |
+
/ "./examples/organic_molecular_crystal.cif"
|
541 |
+
),
|
542 |
+
200,
|
543 |
+
20,
|
544 |
+
1.0,
|
545 |
+
300.0,
|
546 |
+
"NVE",
|
547 |
+
"OMol",
|
548 |
+
0,
|
549 |
+
1,
|
550 |
+
"This organic crystal showcases the UMA's ability to handle organic molecular crystals using the OMol task, using a random packing of a molecule from OE62. You could also try using the OMol or OMat tasks and see how the simulations differ!",
|
551 |
+
],
|
552 |
+
[
|
553 |
+
str(
|
554 |
+
Path(__file__).parent
|
555 |
+
/ "./examples/gold_nanoparticle_crystal.cif"
|
556 |
+
),
|
557 |
+
200,
|
558 |
+
20,
|
559 |
+
1.0,
|
560 |
+
300.0,
|
561 |
+
"NVE",
|
562 |
+
"OMol",
|
563 |
+
0,
|
564 |
+
1,
|
565 |
+
"This example is an experimentally solved crystal structure for a thiolate protected gold nanocluster from an[open-access academic paper](https://pubs.rsc.org/en/content/articlelanding/2016/sc/c5sc02134k) and [available in the COD](https://www.crystallography.net/cod/1540567.html). This is a fun example because it combines small molecules, inorganic materials, and surface chemistry, so it's not so clear which task to use. Try the OMat, OMol, and OC20 tasks to see how the results differ! Further, the experimental paper reported different crystal structures based on the charge and spin multiplicity, so try changing the charge and spin multiplicity to see how the results differ.",
|
566 |
+
],
|
567 |
+
[
|
568 |
+
str(
|
569 |
+
Path(__file__).parent
|
570 |
+
/ "./examples/gold_nanoparticle_crystal.cif"
|
571 |
+
),
|
572 |
+
200,
|
573 |
+
20,
|
574 |
+
1.0,
|
575 |
+
300.0,
|
576 |
+
"NVE",
|
577 |
+
"OMat",
|
578 |
+
0,
|
579 |
+
1,
|
580 |
+
"This example is an experimentally solved crystal structure for a thiolate protected gold nanocluster from an[open-access academic paper](https://pubs.rsc.org/en/content/articlelanding/2016/sc/c5sc02134k) and [available in the COD](https://www.crystallography.net/cod/1540567.html). This is a fun example because it combines small molecules, inorganic materials, and surface chemistry, so it's not so clear which task to use. Try the OMat, OMol, and OC20 tasks to see how the results differ! Further, the experimental paper reported different crystal structures based on the charge and spin multiplicity, so try changing the charge and spin multiplicity to see how the results differ.",
|
581 |
+
],
|
582 |
+
[
|
583 |
+
str(
|
584 |
+
Path(__file__).parent
|
585 |
+
/ "./examples/gold_nanoparticle_crystal.cif"
|
586 |
+
),
|
587 |
+
200,
|
588 |
+
20,
|
589 |
+
1.0,
|
590 |
+
300.0,
|
591 |
+
"NVE",
|
592 |
+
"OC20",
|
593 |
+
0,
|
594 |
+
1,
|
595 |
+
"This example is an experimentally solved crystal structure for a thiolate protected gold nanocluster from an[open-access academic paper](https://pubs.rsc.org/en/content/articlelanding/2016/sc/c5sc02134k) and [available in the COD](https://www.crystallography.net/cod/1540567.html). This is a fun example because it combines small molecules, inorganic materials, and surface chemistry, so it's not so clear which task to use. Try the OMat, OMol, and OC20 tasks to see how the results differ! Further, the experimental paper reported different crystal structures based on the charge and spin multiplicity, so try changing the charge and spin multiplicity to see how the results differ.",
|
596 |
+
],
|
597 |
+
[
|
598 |
+
str(
|
599 |
+
Path(__file__).parent
|
600 |
+
/ "./examples/MOF_CO2.traj"
|
601 |
+
),
|
602 |
+
200,
|
603 |
+
20,
|
604 |
+
1.0,
|
605 |
+
300.0,
|
606 |
+
"NVE",
|
607 |
+
"OMol",
|
608 |
+
0,
|
609 |
+
1,
|
610 |
+
"This is a metal organic framework (MOF) structure using the ODac task. You might study structures like if designing MOFs for direct air capture calculations. Look carefully for the red/gray CO2 molecule in the pores of the MOF! You can also try the OMol and OMat tasks to see if the results differ.",
|
611 |
+
],
|
612 |
+
[
|
613 |
+
str(
|
614 |
+
Path(__file__).parent
|
615 |
+
/ "./examples/MOF_CO2.traj"
|
616 |
+
),
|
617 |
+
200,
|
618 |
+
20,
|
619 |
+
1.0,
|
620 |
+
300.0,
|
621 |
+
"NVE",
|
622 |
+
"ODAC",
|
623 |
+
0,
|
624 |
+
1,
|
625 |
+
"This is a metal organic framework (MOF) structure using the ODac task. You might study structures like if designing MOFs for direct air capture calculations. Look carefully for the red/gray CO2 molecule in the pores of the MOF! You can also try the OMol and OMat tasks to see if the results differ.",
|
626 |
+
],
|
627 |
+
[
|
628 |
+
str(
|
629 |
+
Path(__file__).parent
|
630 |
+
/ "./examples/MOF_CO2.traj"
|
631 |
+
),
|
632 |
+
200,
|
633 |
+
20,
|
634 |
+
1.0,
|
635 |
+
300.0,
|
636 |
+
"NVE",
|
637 |
+
"OMat",
|
638 |
+
0,
|
639 |
+
1,
|
640 |
+
"This is a metal organic framework (MOF) structure using the ODac task. You might study structures like if designing MOFs for direct air capture calculations. Look carefully for the red/gray CO2 molecule in the pores of the MOF! You can also try the OMol and OMat tasks to see if the results differ.",
|
641 |
+
],
|
642 |
],
|
643 |
+
example_labels=[
|
644 |
+
"Organic crystal with OMol task",
|
645 |
+
"Organic crystal with OMC task",
|
646 |
+
"Ligated nanoparticle with OMol",
|
647 |
+
"Ligated nanoparticle with OMat",
|
648 |
+
"Ligated nanoparticle with OC20",
|
649 |
+
"CO2 in a MOF with OMol",
|
650 |
+
"CO2 in a MOF with ODAC",
|
651 |
+
"CO2 in a MOF with OMat",
|
|
|
|
|
|
|
652 |
],
|
653 |
+
inputs=[
|
654 |
+
input_structure,
|
655 |
+
md_steps,
|
656 |
+
prerelax_steps,
|
657 |
+
md_timestep,
|
658 |
+
temperature_k,
|
659 |
+
md_ensemble,
|
660 |
+
task_name,
|
661 |
+
total_charge,
|
662 |
+
spin_multiplicity,
|
663 |
+
explanation_buffer,
|
664 |
],
|
665 |
+
outputs=[
|
666 |
+
output_traj,
|
667 |
+
output_text,
|
668 |
+
reproduction_script,
|
669 |
+
explanation,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
670 |
],
|
671 |
+
fn=run_md_simulation,
|
672 |
+
run_on_click=True,
|
673 |
+
cache_examples=True,
|
674 |
+
label="Molecular Dynamics Examples",
|
675 |
+
)
|
676 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
|
678 |
gr.Markdown(
|
679 |
"""
|