{ "cells": [ { "cell_type": "markdown", "id": "0fc479ca-6750-4092-a7c0-60d77c6293d3", "metadata": {}, "source": [ "# JOnes vector" ] }, { "cell_type": "code", "execution_count": 1, "id": "0e08d6e9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[0.71751273-0.58897687j 0. +0.j ]\n", " [0.66100408+0.40190631j 0. +0.j ]]\n", "\n", "with Pi analyzer\n", "[[0.71751273-0.58897687j 0. +0.j ]\n", " [0. +0.j 0. +0.j ]\n", " [0. +0.j 0. +0.j ]]\n" ] } ], "source": [ "import nexus as nx\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "iron = nx.Material.Template(nx.lib.material.Fe)\n", "\n", "layer_Fe = nx.Layer(id = \"Fe layer\",\n", " material = iron,\n", " thickness = 3000)\n", "\n", "sample1 = nx.Sample(layers = [layer_Fe])\n", "\n", "layer_Pt = nx.Layer(id = \"Pt layer\",\n", " material = nx.Material.Template(nx.lib.material.Pt),\n", " thickness = 1000)\n", "\n", "sample2 = nx.Sample(layers=[layer_Pt])\n", "\n", "beam = nx.Beam()\n", "beam.LinearSigma()\n", "\n", "exp = nx.Experiment(beam = beam,\n", " objects = [sample1, sample2],\n", " isotope = nx.lib.moessbauer.Fe57)\n", "\n", "jones_vectors = nx.JonesVectors(experiment = exp,\n", " energy = 14400)\n", "\n", "print(jones_vectors())\n", "\n", "# now we add an analyzer\n", "print(\"\\nwith Pi analyzer\")\n", "\n", "analyzer = nx.Analyzer()\n", "analyzer.LinearPi()\n", "\n", "exp.objects = [sample1, analyzer, sample2]\n", "\n", "print(jones_vectors())" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.12.0" } }, "nbformat": 4, "nbformat_minor": 5 }