Skip to content
Snippets Groups Projects
Commit 65e57c24 authored by Ivan Kondov's avatar Ivan Kondov
Browse files

added test for shape consistency of masses, momenta and positions

parent ba2f7650
No related branches found
No related tags found
No related merge requests found
......@@ -161,6 +161,8 @@ class ManyParticlePhysicalSystem:
self.mass = np.array(mass)
self.cell = np.array(cell)
self.ff = ff
assert self.mass.shape == self.q.shape == self.p.shape
assert self.mass.shape == self.q0.shape == self.p0.shape
self.kinetic_energy = sum(p**2/(2*m) for p, m in zip(self.p, self.mass))
self.potential_energy = self.ff.get_potential_energy('cartesian')
self.hamiltonian = (self.potential_energy, self.kinetic_energy)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment