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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file comparemol-0.0.2.tar.gz.

File metadata

  • Download URL: comparemol-0.0.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for comparemol-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0afb26d6a98c2c2d7821abc5e8aa344dc405794f13bcab135fa67559169dd060
MD5 5117799cb20fe79c0390144037da3364
BLAKE2b-256 dc09c499175e96c7d6e7c123a4048d7de6c5380ab19d53a2ff51c63eb7b0bca2

See more details on using hashes here.

File details

Details for the file comparemol-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: comparemol-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for comparemol-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 59b989bb161f20f41ad239a079d1692268fe7f98d5ef8c969a61dbc751322cea
MD5 b9309738c5a9b34bc01bd0cd117a9975
BLAKE2b-256 4cef603db62a96072e55ee4e50a0fccad1176fee8573dde4abb0534cdc9fe053

See more details on using hashes here.

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