{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "f8ac4a8e", "metadata": { "tags": [ "remove-input" ] }, "outputs": [], "source": [ "%config InlineBackend.figure_formats = ['svg']\n", "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from flatspin.model import *" ] }, { "cell_type": "markdown", "id": "3923df5c", "metadata": {}, "source": [ "# flatspin\n", "flatspin is a GPU-accelerated simulator for systems of interacting nanomagnet spins arranged on a 2D lattice, also known as Artificial Spin Ice (ASI).\n", "flatspin can simulate the dynamics of large ASI systems with thousands of interacting elements.\n", "flatspin is written in Python and uses OpenCL for GPU acceleration.\n", "flatspin comes with extra bells and whistles for analysis and visualization.\n", "\n", "Some example ASI systems are shown below:" ] }, { "cell_type": "code", "execution_count": null, "id": "b5d8d3f3", "metadata": { "tags": [ "remove-input" ] }, "outputs": [], "source": [ "params = {\n", " 'init': 'random',\n", " 'alpha': 1.0,\n", " 'use_opencl': 1,\n", " 'neighbor_distance': np.inf,\n", "}\n", "model = SquareSpinIceClosed(size=(10,10), **params)\n", "model.relax()\n", "plt.subplot(131)\n", "plt.axis('off')\n", "model.plot()\n", "\n", "model = PinwheelSpinIceDiamond(size=(10,10), **params)\n", "model.relax()\n", "plt.subplot(132)\n", "plt.axis('off')\n", "model.plot()\n", "\n", "model = KagomeSpinIce(size=(7,9), **params)\n", "model.relax()\n", "plt.subplot(133)\n", "plt.axis('off')\n", "model.plot();\n", "\n", "plt.tight_layout();" ] }, { "cell_type": "markdown", "id": "613c573b", "metadata": {}, "source": [ "Ready to learn more?\n", "Head over to [](installation) to download and install flatspin.\n", "Then dive into the [](quickstart) to get started using the simulator.\n", "\n", "## License and citation\n", "flatspin is open-source software.\n", "You are free to modify and distribute the source-code under under the [GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.en.html).\n", "\n", "flatspin is developed and maintained by an interdisciplinary group of researchers at [NTNU](https://www.ntnu.edu/ie/eecs).\n", "If you use flatspin in any work or publication, we kindly ask you to cite:\n", "\n", "[“flatspin: A Large-Scale Artificial Spin Ice Simulator”, Phys. Rev. B 106, 064408 (2022).](https://doi.org/10.1103/PhysRevB.106.064408)\n", "\n", "```{literalinclude} flatspin.bib\n", ":language: bibtex\n", ":class: toggle\n", "```" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.11.5" } }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" }, "source_map": [ 14, 22, 32, 60 ] }, "nbformat": 4, "nbformat_minor": 5 }