pylattica is a package for fast prototyping of lattice models for chemistry and materials science
Project description
pylattica - A Framework for Lattice and Cellular Automata Simulation
pylattica is a Python library for prototyping and constructing cellular automaton and lattice models. The core features of these models are:
- There is a simulation state that evolves over time by repeatedly applying some unchanging rule
- The state of the simulation has a topology defined by a network of sites (i.e. each site has an unchanging set of neighbor sites)
- Each site has a state value associated with it that could change at each simulation step
- The future state of a site is determined by the state of its neighbor sites
These rules capture many common models in chemistry and materials science. For instance, in the Ising Model, spins are updated with probabilities related to the neighboring spins. In a Lattice Gas Automaton, the velocities of particles are determined collisions with neighboring particles. In lattice Monte Carlo simulations of surface catalysis, adsorption, desorption, and surface diffusion are dependent on the occupancy of neighboring sites.
pylattica aims to provide a general framework for prototyping these types of lattice simulations. It prioritizes providing a straightforward method for experimenting with different interaction rules and interaction neighborhoods. It provides some simple utilities for analyzing simulation states, and in the case of square grid systems, it provides visualization tools for the system state itself. Additionally, since this tool is focused on materials science, there is functionality for mapping system states to CIF files (for use in crystal lattice simulations).
Documentation
Detailed documentation for this library can be found here.
Examples
Example notebooks are included in docs/examples
.
Development
Building Documentation
The docs for this project are built using mkdocs. To build the documentation
pip install '.[docs]'
mkdocs build
To run the documentation server locally:
mkdocs serve
Linting
This project uses the black
package for style and formatting, and prospector
for type checking and other lint warnings. These packages are not listed as dependencies of this project, so you can install them manually. This is partially because this project doesn't rely on specific versions of them, and we expect developers to have their own installations already. You can run them as follows:
To assess the changes that will happen if you run the black
linter, run the following:
black --check src
To automatically make the changes, remove the --check
flag:
black src
To run all other linters with prospector, use this:
prospector
In the top of this repository.
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
Built Distribution
File details
Details for the file pylattica-0.1.2.tar.gz
.
File metadata
- Download URL: pylattica-0.1.2.tar.gz
- Upload date:
- Size: 33.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 379313c5fcfcfbe21b03338cbc23849bc37bf35ab7637be86b943f9539af6914 |
|
MD5 | 34be1456a2921aed55c76eaffe8280af |
|
BLAKE2b-256 | ff41960013c8772ba3355ef5447ff45403f89d803e108d0e6f3f86f1d98786ba |
File details
Details for the file pylattica-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: pylattica-0.1.2-py3-none-any.whl
- Upload date:
- Size: 47.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c847b91ad7b46b640c701e3c0cdb76aba69ba2fb3426b8b034cbaa62955f528 |
|
MD5 | 15e765170c69c77b136722ecbf10d383 |
|
BLAKE2b-256 | 5a5e8fe983426434d18adb4ca29fe1a4155f108027a5b541e049b8798bc59717 |