Example Workflows
Use the Quickstart Guide to launch the NIM before running the following examples.
For the request format and required atomic data fields, refer to API Reference. Note the BMDAtomicData fields (atoms) and MDConfig fields (config) tables.
Install the Python libraries used in the following code samples:
Supported Ensembles
Configure the ensemble using the config object:
NVE (Microcanonical) - Constant Energy:
NVT (Canonical) - Langevin Thermostat:
NPT (Isothermal-Isobaric) - MC Barostat:
Restart Simulations
Continue a simulation from a previous state by using the final snapshot as shown in the following code sample:
Concurrent Requests
The inference API accepts multiple concurrent requests; the server processes them and returns responses in order. There is no dedicated async or polling API. You can achieve concurrent behavior by issuing multiple requests (for example, from separate threads or processes).
Concurrent behavior example (Python)
Asynchronous example (Python)
Use asyncio with an async HTTP client. Install aiohttp (for example,
pip install aiohttp) and run the following:
Analyzing Trajectories
The trajectory output can be analyzed to compute thermodynamic properties, as shown in the following Python code sample: