# Materials on BornAgain

file:///usr/share/doc/bornagain/html/ref/sample/material/index.html Recent content in Materials on BornAgain Hugo en-us

# Magnetization

file:///usr/share/doc/bornagain/html/ref/sample/material/magnetization.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/sample/material/magnetization.html <h2 id="magnetization">Magnetization</h2> <p>Magnetic fields are described by real-valued 3d vectors. They are always understood in units of A/m.</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">magnetic_field</span> <span class="o">=</span> <span class="n">ba</span><span class="o">.</span><span class="n">R3</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> </span></span></code></pre></div><p>Magnetic materials are constructed as</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">material</span> <span class="o">=</span> <span class="n">ba</span><span class="o">.</span><span class="n">RefractiveMaterial</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">delta</span><span class="p">,</span> <span class="n">beta</span><span class="p">,</span> <span class="n">magnetic_field</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># or</span> </span></span><span class="line"><span class="cl"><span class="n">material</span> <span class="o">=</span> <span class="n">ba</span><span class="o">.</span><span class="n">MaterialBySLD</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">sld_real</span><span class="p">,</span> <span class="n">sld_imag</span><span class="p">,</span> <span class="n">magnetic_field</span><span class="p">)</span> </span></span></code></pre></div><p>Examples are under <a href="file:///usr/share/doc/bornagain/html/ref/instr/ex/pol">Examples &gt; Instrument &gt; Neutron polarization</a>.</p>