Skip to main content

This package is the implementation of the Ising Model on complex networks.

Project description

Ising Model on Networks

This is a python package which simulates the Ising model on complex networks.

Given any network built using the networkx package as input, this package runs Monte Carlo simulations on random source nodes and evaluates the model according to the Metropolis algorithm, and returns the magnetization and the energy of the system.

Version 1.0.2: This has an added visualizer to plot the output graphs.

Version 1.0.4: The Github repo has an added ipynb that can be referred to for instructions about usage.

Version 1.0.10: A new parallel implementation has been added.

Version 1.1.1: Two much faster functions have been added for both serial and parallel simulations.

Version 1.1.3: Added functions to calculate Curie temperature and decay time.

Version 1.1.4: Added a function to compute average degree

Installation

Run the following to install:

pip install isingnetworks

Additional packages required:

pip install joblib

Usage

Import the class:

from isingnetworks import IsingModel

Create a graph (g) using networkx.

Create an intance of the IsingModel class:

model = IsingModel(g)

Using the viz function:

model.set_J(val_of_J)
model.set_iterations(no_of_iterations)
model.set_initial_state(0) # 0 or 1

# Serial Implementation
model.viz(temperature_array)

# Parallel Implementation
model.viz_parallel(temperature_array)

# Faster Implementations
model.viz_fast(temperature_array)
model.viz_fast_parallel(temperature_array)

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

isingnetworks-1.1.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

isingnetworks-1.1.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file isingnetworks-1.1.4.tar.gz.

File metadata

  • Download URL: isingnetworks-1.1.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for isingnetworks-1.1.4.tar.gz
Algorithm Hash digest
SHA256 dc529f021628f65e3dd0aacfa416dece15912b872baff0b1af92030927f9ad38
MD5 bdc5758946d95a7875c7193103099705
BLAKE2b-256 80f489684c72d3e9bf84f46ffbcb4a7cfe2caeeea28cf125fee8633a269bc36e

See more details on using hashes here.

File details

Details for the file isingnetworks-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: isingnetworks-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for isingnetworks-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4bb2c12b25c68dcf2208b1aeb6d31d67df18280a74cccb018417526c34a98ebd
MD5 38ae964ca94a6b95b6f28387117bcd6c
BLAKE2b-256 c60805948f47193081e637426bb7a2f6856fb964226967e8763a11d404196b28

See more details on using hashes here.

Supported by

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