Status: frozen Category: research Owner: alawein Visibility: public Purpose: Magnetic logic gates and device simulation research. Next action: continue
MagLogic is a research-portfolio candidate if it clearly presents the nanomagnetic logic model, simulation assumptions, and relation to any published or prior work. Public polish should make the scientific context legible before emphasizing implementation details.
- Keep claims tied to reproducible scripts, notebooks, or documented figures.
- Confirm data provenance and license status before public promotion.
- Separate archived experiments from canonical results.
- Avoid publishing machine-local outputs or unpublished manuscript material unless explicitly cleared.
Python tools for simulating nanomagnetic logic devices using OOMMF and MuMax3 backends. Implements nanomagnetic logic simulations from Alawein et al. (IEEE Magnetics Letters, 2019) for triangular element logic gates and cellular automata, designed for reproducible research and teaching.
- Micromagnetic simulations via OOMMF and MuMax3
- Reconfigurable logic gate analysis (NAND/NOR, majority gates)
- Magnetization pattern analysis and domain structure detection
- Energy landscape calculation and topological feature detection
- Cross-platform Docker support
- Automated truth-table verification
git clone https://github.com/alawein/maglogic.git
cd maglogic
docker compose up --buildconda env create -f environment.yml
conda activate maglogic
pip install -e ".[dev]"
python scripts/validate-structure.py
PYTHONPATH=python python -c "import maglogic"PYTHONPATH=python python examples/demo_truth_table.pyfrom maglogic.demos import demo_nand_nor
result = demo_nand_nor.generate_truth_table()
print(result["truth_table"])MagLogic intentionally uses a language-boundary layout:
python/maglogic/is the canonical Python packagepython/tests/is the canonical Python test surfaceoommf/andmumax3/hold simulation assets and reference inputsmatlab/holds MATLAB reference implementationsdocs/holds repo-local documentationscripts/holds repo-local validation and maintenance helpers
This repo does not use src/<package> as its Python boundary.
See docs/architecture/STRUCTURE_DECISION.md for the canonical structure decision.
- Near term: modernize OOMMF/MuMax3 docker images, add reproducible seeds for demos.
- Mid term: expand majority-gate library and energy landscape visualizations.
- Future: add JAX-backed differentiable simulators and more CA examples.
from maglogic.demos import demo_nand_nor
# NAND mode (clock = +60 degrees)
result_nand = demo_nand_nor.run_simulation(clock_angle=60, input_A=1, input_B=1)
print(f"NAND(1,1) = {result_nand['logic_output']}")
# Generate a complete truth table
truth_table = demo_nand_nor.generate_truth_table()maglogic/
├── python/
│ ├── maglogic/ # Canonical Python package
│ └── tests/ # Python test suite
├── matlab/ # MATLAB reference implementations
├── oommf/ # OOMMF simulation files
├── mumax3/ # MuMax3 simulation files
├── examples/ # Demo scripts and notebooks
├── docker/ # Docker configuration
├── docs/ # Documentation
│ └── architecture/ # Structure decisions
└── scripts/ # Repo-local validation and maintenance helpers
python scripts/validate-structure.py
PYTHONPATH=python python -c "import maglogic"Representative tests, when dependencies are installed:
PYTHONPATH=python python -m pytest -s python/tests/test_constants.py python/tests/test_analysis.py@article{alawein2019multistate,
title={Multistate nanomagnetic logic using equilateral permalloy triangles},
author={Alawein, Meshal and others},
journal={IEEE Magnetics Letters},
volume={10},
pages={1--5},
year={2019},
doi={10.1109/LMAG.2019.2912398}
}MIT License. See LICENSE.
- Maintainer: @alawein
- Support: GitHub Issues