Skip to main content

active

pypi version license pipeline coverage report

active is a simulation backend for atooms, a high-level framework for particle-based simulations. This backend implements active matter systems, e.g. the Vicsek model as described in Vicsek et al. (1995) and in Grégoire and Chaté (2004).

Quick start

Here we have a simulation of an active matter system based on the Vicsek model. First of all, we need to setup a 2D atooms system.

import numpy
import atooms
from atooms.system import System

n = 200
dim = 2
system = System(N = n)
system.cell = [32. for i in range(dim)]
for p in system.particle:

	p.orientation = numpy.random.uniform(-numpy.pi,numpy.pi)
	p.position = [L*numpy.random.uniform() for i in range(dim)]
	p.fold(system.cell)

Having done so, we can run a simple Vicsek model simulation as follows. We need to provide the system size n, its noise amplitude eta, velocity v0, and density rho.

from atooms.active.vicsek import Vicsek
from atooms.active.neighbors import VicsekNeighbors
from atooms.simulation import Simulation

eta = 0.4
v0 = 0.5
rho = 0.5

backend = Vicsek(system, eta, v0, noise='vectorial')
neighbors = VicsekNeighbors(system, method='kdtree')
bck.neighbors = neighbors

Simulation(backend).run(10)

This simulation employs the so-called 'vectorial' noise implementation (discussed in Grégoire and Chaté) and the scipy-based kD-tree neighbor search algorithm.

A basic API is also available. We can run the same simulation as follows

from atooms.active.api import vm

vm('input.xyz', file_out='output.xyz', npart=2048, eta=0.4, rho=2.0, nsteps=1000, config_number=10)

or, from the command line

api.py input.xyz --file-out output.xyz --npart 2048 --eta 0.4 --rho 2.0 --nsteps 1000 --config-number 10

Features

  • Seamless integration with atooms framework
  • Various nearest neighbors algorithms available
  • Easy extension to new variations of the Vicsek model
  • Support for user-provided code

Dependencies

  • gfortran 11.3.0
  • python 3.10
    • argh 0.28.1
    • atooms 3.17.0
    • f2py-jit 0.9.2
    • numpy
    • scipy (optional)

Documentation

Check out the tutorial for more detailed examples and the public API for more detail.

Installation

From the Python Package Index

pip install atooms.active[full]

to get all optional dependencies (i.e. scipy). A lightweight installation can be performed as well

pip install atooms.active

From the code repository

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

Authors

Iacopo Ricci: https://iricci.frama.io/

Huge thanks to Prof. Daniele Coslovich for his careful supervision and for his profound insights.

Metadata

Release files for atooms.active 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atooms.active 1.0.4
File Size Uploaded
atooms.active-1.0.4.tar.gz 25.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atooms.active 1.0.4
File Interpreter ABI Platform
atooms.active-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 53.1 kB

Release files / atooms.active-1.0.4.tar.gz

Download URL atooms.active-1.0.4.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f09e42ffb71915a63de64159fd7de1530ea13d991de6416a5c1e218ad5f8aa0f
BLAKE2b-256 checksum
How to use checksums
75f81ca1313e5d571b0f9d28a383f47b9564ea77f7cfe4138b13de02145390f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / atooms.active-1.0.4-py3-none-any.whl

Download URL atooms.active-1.0.4-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9a5344dda5c50f060a6c4caf5551ae516335b90954753d54f0853f4b01c6940
BLAKE2b-256 checksum
How to use checksums
411f2c77c60edb040841c3deb364aee4382df3b936e854585f9b6ec61e06b189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

1.0.5

2 release files

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page