import numpy as np
import matplotlib.pyplot as plt
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/tmp/ipykernel_3799/550901145.py in <module>
      1 import numpy as np
----> 2 import matplotlib.pyplot as plt

ModuleNotFoundError: No module named 'matplotlib'

Molecular system

With OpenMM

import openmm as mm
import openmm.app as app
import openmm.unit as unit
import numpy as np

# Parameters

n_particles = 1
mass = 64.0 * unit.amu

# OpenMM topology

topology = app.Topology()

dummy_element = app.Element(0, 'DUM', 'DUM', 0.0 * unit.amu)

chain = topology.addChain('A')
for ii in range(n_particles):
    residue = topology.addResidue('DUM', chain)
    atom = topology.addAtom(name='DUM', element= dummy_element, residue=residue)
    
# OpenMM system

system = mm.System()

for ii in range(n_particles):
    system.addParticle(mass)

With this library

The python class representing this test system is fully documented in FreeParticle class API. Let’s see an example of how to interact with it:

from uibcdf_systems import FreeParticle

molecular_system = FreeParticle(n_particles=1, mass='64.0 amu')
molecular_system.parameters
{'n_particles': 1, 'mass': Quantity(value=64.0, unit=dalton), 'pbc': False}
molecular_system.coordinates
Quantity(value=array([[0., 0., 0.]], dtype=float32), unit=nanometer)
molecular_system.topology
<Topology; 1 chains, 1 residues, 1 atoms, 0 bonds>
molecular_system.system
<openmm.openmm.System; proxy of <Swig Object of type 'OpenMM::System *' at 0x7f26cc4faab0> >