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.

Installation

Run the following to install:

pip install isingnetworks

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)

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.0.12.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

isingnetworks-1.0.12-py3-none-any.whl (4.0 kB view hashes)

Uploaded 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