@@ -8,24 +8,48 @@ torch-sim
88
99 * - Official website
1010 - How is metatomic supported?
11- * - https://radical-ai .github.io/torch-sim/
12- - In the official version
11+ * - https://torchsim .github.io/torch-sim/
12+ - Via the `` metatomic-torchsim `` package
1313
14- Supported model outputs
14+ How to install the code
1515^^^^^^^^^^^^^^^^^^^^^^^
1616
17- Only the :ref: ` energy < energy-output >` output is supported.
17+ Install the integration package from PyPI:
1818
19- How to install the code
19+ .. code-block :: bash
20+
21+ pip install metatomic-torchsim
22+
23+ For the full TorchSim documentation, see https://torchsim.github.io/torch-sim/.
24+
25+ Supported model outputs
2026^^^^^^^^^^^^^^^^^^^^^^^
2127
22- The code is available in the `` torch-sim `` package, see the corresponding
23- ` installation instructions < https://radical-ai.github.io/torch-sim/user/introduction.html#installation >`_ .
28+ Only the :ref: ` energy < energy-output >` output is supported. Forces and stresses
29+ are derived via autograd .
2430
2531How to use the code
2632^^^^^^^^^^^^^^^^^^^
2733
28- You can find the documentation for metatomic models in torch-sim `here
29- <https://radical-ai.github.io/torch-sim/tutorials/metatomic_tutorial.html> `_,
30- and generic documentation on torch-sim `there
31- <radical-ai.github.io/torch-sim/> `_.
34+ .. code-block :: python
35+
36+ import ase.build
37+ import torch_sim as ts
38+ from metatomic_torchsim import MetatomicModel
39+
40+ model = MetatomicModel(" model.pt" , device = " cpu" )
41+
42+ atoms = ase.build.bulk(" Si" , " diamond" , a = 5.43 , cubic = True )
43+ sim_state = ts.initialize_state(atoms, device = model.device, dtype = model.dtype)
44+
45+ results = model(sim_state)
46+ print (results[" energy" ]) # shape [1]
47+ print (results[" forces" ]) # shape [n_atoms, 3]
48+ print (results[" stress" ]) # shape [1, 3, 3]
49+
50+ API documentation
51+ -----------------
52+
53+ .. autoclass :: metatomic_torchsim.MetatomicModel
54+ :show-inheritance:
55+ :members:
0 commit comments