Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions examples/multi_spectra/driver_test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "ab8888ed",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<multi_spectra_script.MultiSpectraModule object at 0x7fe5a457bb20>\n"
]
}
],
"source": [
"import equisolve.module\n",
"module = equisolve.module.load(\"multi_spectra_script-water-dummy\")\n",
"print(module)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "f1017ca9",
"metadata": {},
"outputs": [],
"source": [
"from equisolve.mlp import EquistorePairPotential\n",
"#importlib.reload(equisolve.mlp)\n",
"potential = EquistorePairPotential(module, md_style='ase-frames')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a214ab2a",
"metadata": {},
"outputs": [],
"source": [
"import equisolve.module\n",
"equisolve.module.save(potential, \"multi_spectra_script.py\", \"multi_spectra_script-water-potential\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "688939d0",
"metadata": {},
"outputs": [],
"source": [
"import ase.io\n",
"structure = ase.io.read(\"h5o2+.extxyz\", \"0\")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "2db34cc7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Atoms(symbols='O2H5', pbc=True, cell=[100.0, 100.0, 100.0])\n"
]
},
{
"data": {
"text/plain": [
"(array([[-1073.12393409]]),\n",
" array([[[-5.74863548],\n",
" [-0.08998449],\n",
" [-1.08122148]],\n",
" \n",
" [[ 5.80579947],\n",
" [ 0.07874874],\n",
" [ 0.72255121]],\n",
" \n",
" [[-4.31114066],\n",
" [-2.92252604],\n",
" [-4.72208079]],\n",
" \n",
" [[-0.14916045],\n",
" [ 0.03117143],\n",
" [ 0.94537747]],\n",
" \n",
" [[ 3.42334933],\n",
" [-2.85755221],\n",
" [ 3.48361754]],\n",
" \n",
" [[ 5.5753905 ],\n",
" [ 2.65745457],\n",
" [-3.3545927 ]],\n",
" \n",
" [[-4.29452136],\n",
" [ 3.03945227],\n",
" [ 2.08459712]]]),\n",
" array([[0., 0., 0.],\n",
" [0., 0., 0.],\n",
" [0., 0., 0.]]),\n",
" '')"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\"Interface with equiscript to run machine learning potentials\"\"\"\n",
"from equisolve.md import IpiDriver\n",
"\n",
"\n",
"Equisolve_driver = IpiDriver\n",
"\n",
"equisolve_driver = Equisolve_driver(\"multi_spectra_script-water-potential.zip,h5o2+.extxyz\")\n",
"equisolve_driver(structure.cell, structure.positions)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dcb63dbe",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
9 changes: 9 additions & 0 deletions examples/multi_spectra/h5o2+.extxyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
7
Lattice='100 0 0 0 100 0 0 0 100'
O 5.40450e-01 -9.74850e-01 -2.16580e-01
O 2.92484e+00 -8.39252e-01 1.52397e-01
H 1.83860e-01 -1.25804e+00 -1.07875e+00
H 1.74329e+00 -9.09278e-01 -1.00395e-01
H 3.29707e+00 -1.59324e+00 6.47253e-01
H 3.53033e+00 -6.08138e-01 -5.76078e-01
H 4.23316e-02 -1.94860e-01 9.22810e-02
Binary file not shown.
Loading