Skip to main content

mamonca - interactive Magnetic Monte Carlo code

Project description

mamonca - interactive Magnetic Monte Carlo

This code allows you to launch Metropolis Monte Carlo simulations via Heisenberg Landau models (with various polynomial degrees) from a jupyter notebook.

Model

mamonca is based on the Heisenberg Landau model of the format:

$$\mathcal H = -\frac{1}{2}\sum_{ij,\kappa}J_{ij,\kappa}m_i^{2\kappa+1}m_j^{2\kappa+1} + \sum_{i,\kappa} A_{i,\kappa} m_i^{2\kappa}$$

where $i$ and $j$ go over all atoms and $\kappa$ is the exponent ($\kappa=1$ and $A_{i,\kappa}=0$ for all $i$ and $\kappa$ for the classical Heisenberg model). The evaluation takes place either via Metropolis Monte Carlo (MC) method or spindynamics (SD). MC has the advantage of converging very fast, while SD also delivers the kinetics.

How to compile

mamonca can be installed directly from conda:

conda install -c conda-forge mamonca

In order to use build it from the repository, run

git clone https://github.com/samwaseda/mamonca
cd mamonca
python setup.py build_ext --user

First steps:

In the following simple (but complete) example, we create a bcc Fe system using pyiron (install via conda install pyiron) and launch a Metropolis Monte Carlo simulation with a Heisenberg coefficient J=0.1 (eV) for the first nearest neighbor pairs:

from pyiron_atomistics import Project
from mamonca import MC

basis = Project('.').create.structure.bulk(
    name='Fe',
    cubic=True
)

# Repeat the structure 10 times in each direction
structure = basis.repeat(10)
J = 0.1 # eV
neighbors = structure.get_neighbors()
first_shell_tensor = neighbors.get_shell_matrix()[0]

mc = MC(len(structure))
mc.set_heisenberg_coeff(J * first_shell_tensor)

mc.run(temperature=300, number_of_iterations=1000)

More complete list of examples can be found in notebooks/first_steps.ipynb

How to set inputs and get outputs

As a rule of thumb, you can set all input parameters via functions starting with set_. Similarly, output values can be obtained via functions whose names start with get_. Most notably, you can get all basic output values via get_output() in a dictionary. Otherwise, take a look at the list of auto-complete and see their docstrings

Dependencies

  • Cython
  • numpy

Notes

  • Currently only Linux installation is supported
  • You can run tests located in the tests folder

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

mamonca-0.0.8.tar.gz (17.9 kB view details)

Uploaded Source

File details

Details for the file mamonca-0.0.8.tar.gz.

File metadata

  • Download URL: mamonca-0.0.8.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for mamonca-0.0.8.tar.gz
Algorithm Hash digest
SHA256 f238b958604f49934fbe72638864ed89dcc2e3909750c5de51dd47c28948ada8
MD5 75d37827b9b3f7406656ee4045bf935d
BLAKE2b-256 6978223324f1bb83af870ba067353b514d9dfe83cf5a852e9d36cc37a500a012

See more details on using hashes here.

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