Skip to main content

Mamonca - interactive Magnetic Monte Carlo code

Project description

Magnetic Metropolis Monte Carlo following classical Boltzmann statistics

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

How to compile

Download all files and run python setup.py build_ext --inplace.

How to launch a simple calculation

Suppose we have a bcc Fe system created by pyiron (e.g. via structure = Project('.').create_structure('Fe', 'bcc', 2.83).repeat(10)) and a Heisenberg coefficient J=0.1 (eV). Then the magnetic interactions can be calculated by:

from pyiron import Project
from mc import MC

structure = Project('.').create_structure(
    element='Fe',
    bravais_basis='bcc',
    lattice_constant=2.85
)

structure.set_repeat(10)
J = 0.1 # eV
first_shell_tensor = structure.get_shell_matrix()[0]

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

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

The results can be analysed by attributes like get_mean_energy() or get_magnetic_moments.

For more info, take a look at mc.pyx.

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.3.tar.gz (57.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for mamonca-0.0.3.tar.gz
Algorithm Hash digest
SHA256 08e755366dfbb6c916fbf801629fc6a68a0a6e432a408d3096094fad60c63c8e
MD5 634cbbbbce2b94dc3661417eefc49311
BLAKE2b-256 c19954c22b54d2b736a25a7672ffc38fd16bc67d424451602d27a2f1af8a854c

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