Python Organic Crystal Simulation Environment (pyocse)

0.1.3 · active · verified Thu Apr 16

Python Organic Crystal Simulation Environment (pyocse) is a library designed for simulating organic crystals. It facilitates tasks like automated force field generation for CHARMM and handling crystal structures and molecules. The current stable version is 0.1.3, with releases being infrequent, primarily tied to significant feature additions and core updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `pyocse.data.Molecule` object, specifically by converting an `ase.Atoms` object. It then shows how to access basic molecular properties and interact with the underlying `ase` object for more detailed atomic manipulation, highlighting the interoperability.

from pyocse.data import Molecule
from ase.build import molecule as ase_build_molecule

# Create an ASE Atoms object for water
h2o_ase = ase_build_molecule("H2O")

# Initialize a pyocse Molecule from the ASE object
mol_h2o = Molecule(ase_atom=h2o_ase, name="Water")

print(f"Molecule Name: {mol_h2o.name}")
print(f"Number of Atoms in pyocse Molecule: {len(mol_h2o.atoms)}")
print(f"Atom symbols: {[atom.symbol for atom in mol_h2o.atoms]}")

# Access the underlying ASE Atoms object for ASE-specific methods
if mol_h2o.ase_atom:
    print(f"Positions of first atom (via ASE): {mol_h2o.ase_atom.get_positions()[0]}")
else:
    print("Underlying ASE Atoms object not available.")

view raw JSON →