Skip to main content

A library project of Monte Carlo simulation algorithms for some statistical physics models (in particular, the Ising model and its variants).

Project description

mcmc_statphys

https://img.shields.io/pypi/v/mcmc_statphys.svg https://img.shields.io/travis/uynajgi/mcmc_statphys.svg Documentation Status

A Python package of Monte Carlo simulation algorithms for some statistical physics models (in particular, the Ising model and its variants).

Features

A simple Ising model simulation.

>>> import mcmc_statphys as mcsp
>>> model = mcsp.model.Ising(12) # 12x12 Ising model
>>> algorithm = mcsp.algorithm.Metropolis(model) # Metropolis algorithm
>>> uid = algorithm.equil_sample(T=1, max_iter=1000) # sample until equilibrium
>>> fig = mcsp.draw.Plot(algorithm)
>>> fig.curve(uid=uid, comlumn='energy') # plot the energy curve

Install

the latest version of mcmc_statphys:

$ pip install mcmc_statphys

upgrade to the latest version:

$ pip install --upgrade mcmc_statphys

Bugs

Please report any bugs that you find here. Or, even better, fork the repository on GitHub and create a pull request (PR). We welcome all changes, big or small, and we will help you make the PR if you are new to git (just ask on the issue and/or see CONTRIBUTING).

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Unreleased]

[0.4.0] - 2023-05-20

Added

  • Add imshow in draw

  • Add animate in draw

Fixed

  • Fix: Wolff and Anneal uid does not return

[0.3.0] - 2023-05-18

Added

  • Add cv in analysis to calculate the cv

  • Add spin2svd in analysis

  • Add uid2svd in analysis

[0.2.1] - 2023-05-17

Fixed

  • Fix the bug of saving _get_per_magnetization in _save_data in algorithm

Added

  • Add moudle analysis to analyze the data

  • Add moudle draw to draw the figures

  • Add method setspin in model

  • Add tqmd to show the progress bar

Doc

  • Add documentation to README

  • Add documentation to Usages

Changed

  • Change the methods in the analysis module: removed the Sample and ParameterSample classes, added Metropolis, Wolff, Anneal classes and several methods

[0.1.2] - 2023-05-15

Security

  • Add function annotations to all functions

  • Add type hints to all functions

  • Add type hints to all variables

  • Change mcmc_statphys.py to method.py

Doc

  • Add documentation to README

[0.1.1] - 2023-05-14

  • First release on PyPI.

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

mcmc_statphys-1.0.0.tar.gz (1.7 MB view hashes)

Uploaded Source

Built Distribution

mcmc_statphys-1.0.0-py2.py3-none-any.whl (50.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page