Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ from ase import units
|
|
| 9 |
from ase.optimize import LBFGS
|
| 10 |
from ase.md.verlet import VelocityVerlet
|
| 11 |
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
|
| 12 |
-
from ase.md import MDLogger
|
| 13 |
from ase.io.trajectory import Trajectory
|
| 14 |
|
| 15 |
import py3Dmol
|
|
@@ -138,6 +137,27 @@ def run_md(xyz_content, charge=0, spin_multiplicity=1, steps=100, temperature=30
|
|
| 138 |
# -----------------------------
|
| 139 |
# Gradio UI
|
| 140 |
# -----------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
with gr.Blocks(theme=gr.themes.Ocean(), title="OrbMol + MD Demo") as demo:
|
| 142 |
gr.Markdown("# OrbMol Demo with Molecular Dynamics")
|
| 143 |
|
|
@@ -153,6 +173,11 @@ with gr.Blocks(theme=gr.themes.Ocean(), title="OrbMol + MD Demo") as demo:
|
|
| 153 |
inputs=[xyz_input, charge_input, spin_input],
|
| 154 |
outputs=[results_output, status_output],
|
| 155 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
with gr.Tab("Molecular Dynamics"):
|
| 158 |
xyz_input_md = gr.Textbox(label="XYZ Coordinates", lines=12)
|
|
|
|
| 9 |
from ase.optimize import LBFGS
|
| 10 |
from ase.md.verlet import VelocityVerlet
|
| 11 |
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
|
|
|
|
| 12 |
from ase.io.trajectory import Trajectory
|
| 13 |
|
| 14 |
import py3Dmol
|
|
|
|
| 137 |
# -----------------------------
|
| 138 |
# Gradio UI
|
| 139 |
# -----------------------------
|
| 140 |
+
examples = [
|
| 141 |
+
["""2
|
| 142 |
+
Hydrogen molecule
|
| 143 |
+
H 0.0 0.0 0.0
|
| 144 |
+
H 0.0 0.0 0.74""", 0, 1],
|
| 145 |
+
|
| 146 |
+
["""3
|
| 147 |
+
Water molecule
|
| 148 |
+
O 0.0000 0.0000 0.0000
|
| 149 |
+
H 0.7571 0.0000 0.5864
|
| 150 |
+
H -0.7571 0.0000 0.5864""", 0, 1],
|
| 151 |
+
|
| 152 |
+
["""5
|
| 153 |
+
Methane
|
| 154 |
+
C 0.0000 0.0000 0.0000
|
| 155 |
+
H 1.0890 0.0000 0.0000
|
| 156 |
+
H -0.3630 1.0267 0.0000
|
| 157 |
+
H -0.3630 -0.5133 0.8887
|
| 158 |
+
H -0.3630 -0.5133 -0.8887""", 0, 1]
|
| 159 |
+
]
|
| 160 |
+
|
| 161 |
with gr.Blocks(theme=gr.themes.Ocean(), title="OrbMol + MD Demo") as demo:
|
| 162 |
gr.Markdown("# OrbMol Demo with Molecular Dynamics")
|
| 163 |
|
|
|
|
| 173 |
inputs=[xyz_input, charge_input, spin_input],
|
| 174 |
outputs=[results_output, status_output],
|
| 175 |
)
|
| 176 |
+
gr.Examples(
|
| 177 |
+
examples=examples,
|
| 178 |
+
inputs=[xyz_input, charge_input, spin_input],
|
| 179 |
+
label="Try these examples"
|
| 180 |
+
)
|
| 181 |
|
| 182 |
with gr.Tab("Molecular Dynamics"):
|
| 183 |
xyz_input_md = gr.Textbox(label="XYZ Coordinates", lines=12)
|