Skip to main content

A framework for simulations of interacting particles

Project description

Atooms

pypi version license Binder DOI pipeline coverage report

atooms is a high-level Python framework for simulations of interacting particles, such as molecular dynamics or Monte Carlo.

This is the core package: it provides a consistent interface to the basic objects of particle-based simulations. [Feature packages](Feature packages) are built on top of it and implement complex simulation methods and analysis tools.

Quick start

Here is a small example for setting up a mixture of two types of particles, A and B, in a periodic elongated cell. The number density is set to unity.

from atooms.system import System

system = System(N=64)
system.replicate(times=4, axis=0)
system.composition = {'A': 128, 'B': 128}
system.density = 1.0

Particles in the central part of the cell get a random displacement and are folded back into the simulation cell

import numpy

for p in system.particle:
    if abs(p.position[0]) < system.cell.side[0] / 4:
        p.position += 0.5 * (numpy.random.random() - 0.5)
        p.fold(system.cell)
system.show('ovito')

Simulation data are stored in trajectory files, which are easy to manipulate and convert with atooms. Here, we write the system species and positions in a single-frame trajectory file using the xyz format.

from atooms.trajectory import TrajectoryXYZ

with TrajectoryXYZ('input.xyz', 'w') as th:
    th.variables = ['species', 'position']  # actually, this is the default
    th.write(system)

The trajectory file can now be used to start a simulation using one the available simulation backends or your own code.

Features

  • Focus on a simple and expressive interface
  • API refined over the years towards consistency
  • Modular and extensible design via namespace packages
  • Semantic versioning - for what is worth
  • Easy to interface: in-house codes and custom formats are first-class citizens
  • Support for efficient simulation backends, with a focus on GPU codes

Documentation

Check out the tutorial for more examples and the public API for more details.

Org-mode and jupyter notebooks are available under docs. You can run them interactively on Binder.

Installation

From the python package index

pip install atooms

From the code repository

git clone https://framagit.org/atooms/atooms.git
cd atooms
make install

Contributing

You are welcome to contribute to this project! Please have a look at these guidelines.

Feature packages

Atooms is modular: it is easy to add new functionalities, and just those you actually need.

Feature packages are available from the atooms main repository. They are installed in the atooms namespace to prevent name clashing. If you want to add your own feature package to the atooms namespace, structure it this way

atooms/your_package
atooms/your_package/__init__.py

where __init__.py contains

from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

Install your_package and you are ready to go

import atooms.your_package

Authors

Daniele Coslovich: https://www.units.it/daniele.coslovich/

Thanks go to Francesco Turci, Geert Kapteijns, Romain Simon, Michele Matteucci for their contributions.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

atooms-3.28.3.tar.gz (170.3 kB view details)

Uploaded Source

Built Distribution

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

atooms-3.28.3-py3-none-any.whl (168.6 kB view details)

Uploaded Python 3

File details

Details for the file atooms-3.28.3.tar.gz.

File metadata

  • Download URL: atooms-3.28.3.tar.gz
  • Upload date:
  • Size: 170.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for atooms-3.28.3.tar.gz
Algorithm Hash digest
SHA256 1f776ba978769d9cefe991011344612c28156c1cd851d8973b472ee0809de5ea
MD5 fef0b3fa2c18ee44653cd3a1e5897064
BLAKE2b-256 638bb2617fc7bbfab8263a19de4ef5574d7438b53b7eafa8f9b240fd8f245cb8

See more details on using hashes here.

File details

Details for the file atooms-3.28.3-py3-none-any.whl.

File metadata

  • Download URL: atooms-3.28.3-py3-none-any.whl
  • Upload date:
  • Size: 168.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for atooms-3.28.3-py3-none-any.whl
Algorithm Hash digest
SHA256 82eb0b01bd917d6ce49a8f0f10e50618d5d35888b0157fb251a312c2cd44cef5
MD5 a3904f17c25f2ab9950c6e8f32a0ec3d
BLAKE2b-256 88c78acc61d3d020af2407ab8e56a551d3c3220b2797550f46af36e179c0c9b6

See more details on using hashes here.

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