SpinMCPack
This software package implements a Monte Carlo simulation for spin systems. It takes the Heisenberg Hamiltonian parameters and the model type ('Ising', 'XY', or '3D') as input, producing the relaxed spin configurations across a specified temperature range and relevant average magnetic properties as output.
Install / Use
/learn @Akram-Ibrahim/SpinMCPackREADME
SpinMCPack - Spin Monte Carlo Simulation Package
SpinMCPack is a Python package designed for performing Monte Carlo (MC) simulations of spin systems. It supports Ising, XY, and 3D Heisenberg models. Is also features options for incorporating external magnetic and electric fields.
Features
- Supports Ising, XY, and 3D Heisenberg models.
- Configurable parameters include temperature, spin orientations, supercell size, interaction parameters, number of equilibration steps, ensemble size, sampling interval, angular resolution of spins, and external field strength.
- Provides convergence and phase transition plots for energy, magnetization, topological charge, and their susceptibilities.
Prerequisites
- Python 3
- Required libraries: numpy, ase, pandas, matplotlib, tqdm, scipy
Installation
Clone the repository:
Usage
Edit template.py:
- Modify parameters such as number of cells, magnetic interaction parameters, sample size, sampling interval, angular resolution of spin orientations, etc., as needed.
- Usage:
python template.py <temperature> <sampling_sweep> <B_z> <E_z>
This command runs the simulation using a submission script (submission-script) which can be adjusted according to user-specific computational resources.
Output Files
- Energies: saved in the
energiesdirectory. - Spin configurations: saved in the
spin_configsdirectory. - Convergence plots are saved for Energy, Normalized Magnetization, and Topological Charge.
Key Components
Spin_MonteCarlo_Simulator: Main class for running MC simulations.monte_carlo_simulation(): Executes the MC simulation.calculate_site_energies(): Calculates energies from neighboring spins.
File Descriptions
template.py: Script to initiate and run simulations.SpinMC.py: Core implementation of theSpin_MonteCarlo_Simulatorclass.
The model provided in this repository was utilized to generate the results discussed in the manuscript: arXiv:2409.19082.
Related Skills
product-manager-skills
24PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
