Skip to main content

Vector Transformations and Thermostats for ASE Atoms and Molecules

Project description

Vectra: Vector Transformations and Thermostats for ASE Atoms and Molecules

Vectra is a Python package designed to provide tools for vector transformations on ASE atoms and molecules, as well as specialized thermostats for molecular dynamics simulations.

Features

  • Decomposition of Quantities: Decompose total quantities (e.g., forces, momenta) into translational, rotational, and vibrational components for individual molecules or groups of atoms.
  • Decomposed Berendsen Thermostat: Apply Berendsen thermostats that operate independently on translational, rotational, and vibrational degrees of freedom.

Installation

pip install vectra

Usage

Decomposing Quantities

Decompose a quantity (like forces or velocities) for a set of atoms into translational, rotational, and vibrational components for each identified molecule.

import ase
import numpy as np
from vectra import decompose
from molify import smiles2atoms
from mace.calculators import mace_mp

atoms = smiles2atoms(smiles="O")
atoms.calc = mace_mp() # Any ASE calculator. We are using a uMLIP here.

# Get forces from the calculator
forces = atoms.get_forces()

# Decompose forces
# The 'decompose' function automatically identifies molecules based on connectivity.
decomposed_molecules = decompose(atoms, quantity=forces)

for i, (trans_c, rot_c, vib_c, component_indices) in enumerate(decomposed_molecules):
    print(f"\nMolecule {i+1} (atoms {component_indices}):")
    print("  Translational component:", trans_c)
    print("  Rotational component:", rot_c)
    print("  Vibrational component:", vib_c)

Using Decomposed Berendsen Thermostat

Apply a Berendsen thermostat that can control translational, rotational, and vibrational temperatures independently.

import ase.units
from vectra import DecomposedBerendsenThermostat
from molify import smiles2conformers, pack
from mace.calculators import mace_mp

# Create a system with multiple water molecules using smiles2conformers and pack
water = smiles2conformers(smiles="O", num_conformers=1)[0] # Get one conformer
atoms = pack([water], counts=[3], density=1000)

atoms.calc = mace_mp()

md = DecomposedBerendsenThermostat(
    atoms=atoms,
    timestep=0.5, # fs
    temperature_trans=500,
    temperature_rot=400,
    temperature_vib=300,
    tau_trans=0.5 * 100 * ase.units.fs,
    tau_rot=0.5 * 100 * ase.units.fs,
    tau_vib=0.5 * 100 * ase.units.fs,
)

md.run(1000)

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

vectra-0.1.3.tar.gz (94.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectra-0.1.3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file vectra-0.1.3.tar.gz.

File metadata

  • Download URL: vectra-0.1.3.tar.gz
  • Upload date:
  • Size: 94.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vectra-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3a8a1343074d1065f3074bfe5d6023a63801d3176df5b05438d176a57e77bb48
MD5 66af13a8fcaa9fb841918bcb1911b7e6
BLAKE2b-256 a4a78a85317d1eff36ffbe3ebe68f9607375b6617e10736755da8a9fcc141672

See more details on using hashes here.

Provenance

The following attestation bundles were made for vectra-0.1.3.tar.gz:

Publisher: publish.yaml on zincware/vectra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vectra-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: vectra-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vectra-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c66357a4b6560a90bf53f79ff8a03d72c464c6e94b77f6543542df47762396aa
MD5 d5105e492bb487f9084660f894d1171b
BLAKE2b-256 b00e4414b9bf0890bfa755de13d4f1b534d8057a9d5e7269f2d4a4e917022783

See more details on using hashes here.

Provenance

The following attestation bundles were made for vectra-0.1.3-py3-none-any.whl:

Publisher: publish.yaml on zincware/vectra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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