Skip to content

Installation, scripting, & data generation demo of GPU-accelerated computational micro and nanomagnetism in MuMax3. Formed & written by Onri Jay Benally, an Indigenous American quantum hardware engineer.

License

Notifications You must be signed in to change notification settings

OJB-Quantum/MuMax3-How-To

Repository files navigation

MuMax3-How-To

License

Installation, scripting, & data generation demo of computational micro and nanomagnetism in MuMax3. Formed & written by Onri Jay Benally.


image


Main MuMax3 website: (https://mumax.github.io/index.html)

Uses code heavily-modified for clarity, inspired from: (https://github.com/mumax/3) & (https://mumax.github.io/examples.html)

Some examples computed in this repository were performed on an Nvidia (RTX 4070 Ti Super) GPU, connected externally (via a Thunderbolt 4 to PCIe x16 adapter) to a Microsoft Surface Pro 8, later upgraded to a Surface Pro 10. If you are curious about this kind of GPU-accelerated computing setup, then it is best to make sure your Windows machine is Thunderbolt 4 compatible or greater. Other examples were computed directly in the Google Colab environment using available GPU resources in Colab (T4 [free], L40, A100, etc.)


To use MuMax3 in Google Colab, simply change the runtime type to one of the GPU accelerators and enter this into the first code cell:

#@title Check GPU + driver
!nvidia-smi --query-gpu="name,driver_version,compute_cap" --format=csv

Then, enter this into the second code cell:

#@title Install MuMax³ (MuMax³ 3.10 CUDA 10.1)
# Download the mumax3 binary
!wget -q https://mumax.ugent.be/mumax3-binaries/mumax3.10_linux_cuda10.1.tar.gz
!tar -xvf mumax3.10_linux_cuda10.1.tar.gz
!rm mumax3.10_linux_cuda10.1.tar.gz
!rm -rf mumax3.10 && mv mumax3.10_linux_cuda10.1 mumax3.10

# Update the PATH environment variable
import os
os.environ["PATH"] += ":/content/mumax3.10"

Now you can write the MuMax3 code and Python visualization scripts in the remaining cells. See the Google Colab notebook examples for more information.


Some Google Colab Notebooks
Run MuMax3 on the Cloud Open In Colab
Example of Hysteresis Loop Data Imported from a Local MuMax3 Installation Open In Colab
Hysteresis Loop for Dy and Tb Micromagnets, Computed on the GPU Using MuMax3 Installed in Google Colab Open In Colab
Prediction of Temperature Dependence for Dy and Tb, Computed on the GPU Using MuMax3 Installed in Google Colab Open In Colab

How to Install & Run MuMax3 Locally by Onri
Video Tutorial on How to Install MuMax3 Locally Step-by-Step
The Official MuMax3 Tutorials
Standard Problems from the Center for Theoretical and Computational Materials Science (CTCMS)
Video Example of Onri's MuMax3 Hysteresis Plots in Python
Example MuMax3 Script in TXT Format
Video Animation of Magnetic Orders
Explanation of Hysteresis Curves & Coercivity
Micromagnetism Overview

If MuMax3 is installed already, start the GUI by typing the following 2 lines into a non-admin command prompt or non-admin PowerShell:

cd <directory_to_your_MuMax3_file>
mumax3 -i <your_MuMax3_TXT_file_name.txt>

Note: MuMax3 scripts can be written as TXT file types. The above script will load and automatically run the script into a browser.

Online OVF file type visualization: (https://mumax.ugent.be/mumax-view). While using the viewer, you can load multiple OVF files to play an animation of the magnetization frame capture.


Magnetic Conversion Table

Quantity Symbol Conversion
Field $H$ $\dfrac{\mathrm{Oe}}{\mathrm{A}\cdot\mathrm{m}^{-1}}=\dfrac{10^{3}}{4\pi}=79.6$
Flux $\Phi$ $\dfrac{\mathrm{Mx}}{\mathrm{Wb}}=\dfrac{\mathrm{Mx}}{\mathrm{V}\cdot\mathrm{s}}=10^{-8}$
Flux density $B$ $\dfrac{\mathrm{G}}{\mathrm{T}}=\dfrac{\mathrm{G}}{\mathrm{Wb}\cdot\mathrm{m}^{-2}}=10^{-4}$
Magnetic moment $m$ $\dfrac{\mathrm{emu}}{\mathrm{A}\cdot\mathrm{m}^{2}}=\dfrac{\mathrm{erg}\cdot\mathrm{Oe}^{-1}}{\mathrm{A}\cdot\mathrm{m}^{2}}=\dfrac{10,\mathrm{A}\cdot\mathrm{cm}^{2}}{\mathrm{A}\cdot\mathrm{m}^{2}}=\dfrac{\mathrm{emu}}{\mathrm{J}\cdot\mathrm{T}^{-1}}=10^{-3}$
Magnetization per unit volume $M$ $\dfrac{\mathrm{emu}\cdot\mathrm{cm}^{-3}}{\mathrm{A}\cdot\mathrm{m}^{-1}}=\dfrac{\left(\mathrm{erg}\cdot\mathrm{Oe}^{-1}\right)\cdot\mathrm{cm}^{-3}}{\mathrm{A}\cdot\mathrm{m}^{-1}}=10^{3}$
Magnetization per unit mass $\sigma$ $\dfrac{\mathrm{emu}\cdot\mathrm{g}^{-1}}{\left(\mathrm{A}\cdot\mathrm{m}^{2}\right)\cdot\mathrm{kg}^{-1}}=\dfrac{\left(\mathrm{erg}\cdot\mathrm{Oe}^{-1}\right)\cdot\mathrm{g}^{-1}}{\left(\mathrm{A}\cdot\mathrm{m}^{2}\right)\cdot\mathrm{kg}^{-1}}=1$
Magnetic polarization $J$ $\dfrac{\mathrm{emu}\cdot\mathrm{cm}^{-3}}{\mathrm{T}}=\dfrac{\left(\mathrm{erg}\cdot\mathrm{Oe}^{-1}\right)\cdot\mathrm{cm}^{-3}}{\mathrm{T}}=10^{3}\mu_{0}=4\pi\cdot10^{-4}$
Volume susceptibility $\chi_{\mathrm{v}}$ $\dfrac{\left(\mathrm{emu}\cdot\mathrm{Oe}^{-1}\right)\cdot\mathrm{cm}^{-3}}{\left(\mathrm{A}\cdot\mathrm{m}^{2}\right)\cdot\left(\mathrm{A}\cdot\mathrm{m}^{-1}\right)^{-1}\cdot\mathrm{m}^{-3}}=4\pi$
Mass susceptibility $\chi_{\mathrm{m}}$ $\dfrac{\left(\mathrm{emu}\cdot\mathrm{Oe}^{-1}\right)\cdot\mathrm{g}^{-1}}{\left(\mathrm{A}\cdot\mathrm{m}^{2}\right)\cdot\left(\mathrm{A}\cdot\mathrm{m}^{-1}\right)^{-1}\cdot\mathrm{kg}^{-1}}=4\pi\cdot10^{-3}$
Permeability $\mu=\dfrac{B}{H}$ $\dfrac{\mathrm{G}\cdot\mathrm{Oe}^{-1}}{\mathrm{T}\cdot\left(\mathrm{A}\cdot\mathrm{m}^{-1}\right)^{-1}}=\mu_{0}=4\pi\cdot10^{-7}$
Relative permeability (SI) $\mu_{\mathrm{r}}$ $\dfrac{\mu_{\mathrm{SI}}}{\mu_{0}}=\mu_{\mathrm{r}}=\mu_{\mathrm{cgs}}$
Energy density $W$ $\dfrac{\mathrm{erg}\cdot\mathrm{cm}^{-3}}{\mathrm{J}\cdot\mathrm{m}^{-3}}=0.1$
Demagnetizing factor $N$ $\dfrac{N_{\mathrm{cgs}}}{N_{\mathrm{SI}}}=4\pi$
Energy product $(BH)$ $\dfrac{\mathrm{G}\cdot\mathrm{Oe}}{\mathrm{T}\cdot\left(\mathrm{A}\cdot\mathrm{m}^{-1}\right)}=\dfrac{\mathrm{G}\cdot\mathrm{Oe}}{\mathrm{J}\cdot\mathrm{m}^{-3}}=4\pi\cdot10^{1}=126$
$\dfrac{\mathrm{MG}\cdot\mathrm{Oe}}{\mathrm{kJ}\cdot\mathrm{m}^{-3}}=4\pi\cdot10^{-2}=0.126$

Mx = maxwell, G = gauss, Oe = oersted, Wb = weber, V = volt, s = second, T = tesla, m = meter, A = ampere, J = joule, kg = kilogram, g = gram, cm = centimeter, with $\mu_0=4\pi\times10^{-7}$.


Hysteresis loop, from the local MuMax3 computation data:

Hysteresis Plot_Python_Blue


Hysteresis loops for dysprosium at various low temperatures, from the MuMax3 Colab computation:

image

Ferromagnetic response for dysprosium and terbium at various low temperatures, from the MuMax3 Colab computation:

image

Magnetic material visualization example ran in MuMax3:

Vector field after 2 minutes Vector field after a couple more minutes


Magnetic geometry (300 nm x 100 nm x 3 nm) visualization in 3D using MuMax View in the browser:

ezgif-2-ce10ab426e


More examples:

Screenshot 2024-03-13 124721 Screenshot 2024-03-13 125101


Related Animated Videos for Your Reference:
Tunnel Effect
Quantum Difference Between Metals & Insulators
Magnetic Orders
Frustrated Magnets
Bose-Einstein Condensation
Nuclear Magnetic Resonance (NMR)
Transmission Electron Microscopy
Scanning Tunneling Microscopy
Scanning Electron Microscopy
Atomic Force Microscopy

image image

About

Installation, scripting, & data generation demo of GPU-accelerated computational micro and nanomagnetism in MuMax3. Formed & written by Onri Jay Benally, an Indigenous American quantum hardware engineer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published