{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "9f7da851", "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": "5577d558", "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", "flatspin is open-source software and released under a GNU GPL license\n", "\n", "Some example ASI systems are shown below:" ] }, { "cell_type": "code", "execution_count": null, "id": "8c1dc1b7", "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": "ea1a90cf", "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." ] } ], "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, 33, 61 ] }, "nbformat": 4, "nbformat_minor": 5 }