{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"# Giant Magneto Resistance"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this example, we will learn how to play with the spin degree of freedom in a model. We will implement a crude\n",
"model for a Ferromagnetic-Normal spacer-Ferromagnetic (FNF) spin valve and compute the conductance as a function of the angle $\\theta$ between the two magnetization. The ferromagnets are model by simply adding an sd exchange term of the form\n",
"$$-J m.\\sigma$$\n",
"in the Hamiltonian where $m$ is the direction of the magnetization, $\\sigma$ a vector of Pauli matrices and $J$ the exchange constant."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from types import SimpleNamespace\n",
"from math import cos, sin, pi\n",
"\n",
"%run matplotlib_setup.ipy\n",
"from matplotlib import pyplot\n",
"\n",
"import numpy as np\n",
"import scipy.stats as reg\n",
"import kwant"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"lat = kwant.lattice.square()\n",
"\n",
"s_0 = np.identity(2)\n",
"s_z = np.array([[1, 0], [0, -1]])\n",
"s_x = np.array([[0, 1], [1, 0]])\n",
"s_y = np.array([[0, -1j], [1j, 0]])\n",
"\n",
"def onsite(site, p):\n",
" x = site.pos[0]\n",
" if x > W and x < 2*W:\n",
" return 4*s_0 + p.Exc*s_z\n",
" if x > 3*W and x < 4*W:\n",
" return 4*s_0 + p.Exc*cos(p.angle)*s_z + p.Exc*sin(p.angle)*s_x\n",
" return 4*s_0\n",
"\n",
"W = 10\n",
"H = kwant.Builder()\n",
"H[(lat(x,y) for x in range(5*W) for y in range(W))] = onsite\n",
"H[lat.neighbors()] = s_0\n",
"\n",
"sym = kwant.TranslationalSymmetry(lat.vec((1,0)))\n",
"Hlead =kwant.Builder(sym)\n",
"Hlead[(lat(0,y) for y in range(W))] = 4*s_0\n",
"Hlead[lat.neighbors()] = s_0\n",
"H.attach_lead(Hlead)\n",
"H.attach_lead(Hlead.reversed())\n",
"kwant.plot(H);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to visualize the potential, it can be useful to have color maps of it."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ps = SimpleNamespace(Exc=2., E=1.2, angle=pi)\n",
"\n",
"def V(site):\n",
" Hd = onsite(site,ps)\n",
" return (Hd[0,0] - Hd[1,1]).real\n",
"\n",
"kwant.plotter.map(H, V);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let us compute the angular magneto-resistance.\n",
"Try playing with the parameters, what do you observe? Do you understand why?\n",
"Is there anything wrong with our model?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"Hf = H.finalized()\n",
"data = []\n",
"angles = np.linspace(0,2*pi,100)\n",
"\n",
"params = SimpleNamespace(Exc=0.2, E=2.3)\n",
"for params.angle in angles:\n",
" smatrix = kwant.smatrix(Hf, params.E, args=[params])\n",
" data.append(smatrix.transmission(1, 0))\n",
" \n",
"pyplot.plot(angles, data);\n",
"pyplot.xlabel('angle')\n",
"pyplot.ylabel('Conductance in unit of $(e^2/h)$');"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"# Magnetic texture : the example of a skyrmion\n",
"Last, we can start playing with the magnetic texture, for instance a skyrmion as in the example below.\n",
"\n",
"$$H = - t \\sum_{} |i>