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)
Metadata
Release files for vectra 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| vectra-0.1.3.tar.gz | 94.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vectra-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.7 kB
Release files / vectra-0.1.3.tar.gz
| Download URL | vectra-0.1.3.tar.gz |
|---|---|
| Size | 94.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a8a1343074d1065f3074bfe5d6023a63801d3176df5b05438d176a57e77bb48
|
|
BLAKE2b-256 checksum How to use checksums |
a4a78a85317d1eff36ffbe3ebe68f9607375b6617e10736755da8a9fcc141672
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 5, 2026.
Transparency logRelease files / vectra-0.1.3-py3-none-any.whl
| Download URL | vectra-0.1.3-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c66357a4b6560a90bf53f79ff8a03d72c464c6e94b77f6543542df47762396aa
|
|
BLAKE2b-256 checksum How to use checksums |
b00e4414b9bf0890bfa755de13d4f1b534d8057a9d5e7269f2d4a4e917022783
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 5, 2026.
Transparency logSecurity for vectra 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for vectra-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.