Skip to main content

Compare if two molecules are equivalent.

Project description

comparemol

This package is used to compare if two molecules are equivalent.

Installation

This package requires Python 3.8.

pip install comparemol

Usage

Compare if two molecules are equivalent

from comparemol import Mol
# define types and coordinates
types1 = [0, 0]
types2 = [0, 0]
coords1 = [[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]]
coords2 = [[0.0, 0.0, 0.0], [1.73205081, 0.0, 0.0]]
# define two molecules
mol1 = Mol(types1, coords1)
mol2 = Mol(types2, coords2)
# compare whether they are equivalent
assert mol1 == mol2

Rotate forces to match coordinates

from comparemol import get_rotation
# define rotation: mol2 -> mol1
r = get_rotation(mol1, mol2)
# rotate forces
force2 = [[1.73205081, 0.0, 0.0]]
force1 = r.apply(force2)

Load from a dpdata System

Load a molecule from a dpdata System:

from comparemol import Mol
# system: dpdata.System
mol = Mol.load_from_dpdata(system)

Note that only the first frame is loaded.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comparemol-0.0.2.tar.gz (10.4 kB view hashes)

Uploaded Source

Built Distribution

comparemol-0.0.2-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page