{ "cells": [ { "cell_type": "markdown", "id": "a4b94702-66e7-49be-9a8a-72843377ab5c", "metadata": {}, "source": [ "# Hyperfine" ] }, { "cell_type": "code", "execution_count": 1, "id": "84f09f29-b0da-48af-b496-57d6ecf502be", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hyperfine .id: example parameter\n", " .weight = 1.0\n", " .isomer_shift = -0.11 \t dist points: 1\n", " .magnetic_field = 33.0 \t dist points: 1\n", " .magnetic_theta = 0.0 \t dist points: 1\n", " .magnetic_phi = 45.0 \t dist points: 1\n", " .quadrupole = 0.8 \t dist points: 1\n", " .quadrupole_alpha = 90.0 \t dist points: 1\n", " .quadrupole_beta = 45.0 \t dist points: 1\n", " .quadrupole_gamma = 0.0 \t dist points: 1\n", " .quadrupole_asymmetry = 0.05 \t dist points: 1\n", " .isotropic = False \t 3D distribution in mag and efg. Random mag or efg distributions are ignored.\n", " random magnetic distribution: none\t dist points: 1\n", " random quadrupole distribution: none\t dist points: 1\n", " total number of distribution points: 1\n", "\n" ] } ], "source": [ "import nexus as nx\n", "\n", "hyperfine = nx.Hyperfine(\n", " id = \"example parameter\",\n", " weight = 1, # relative weight of the site in the material\n", " isomer = -0.11, # isomer shift in mm/s\n", " magnetic_field = 33, # magnetic field in T\n", " magnetic_theta = 0, # polar angle\n", " magnetic_phi = 45, # azimuthal angle\n", " quadrupole = 0.8, # quadrupole slitting in mm/s\n", " quadrupole_alpha = 90, # ZYZ extrinsic Euler angle alpha\n", " quadrupole_beta = 45, # ZYZ extrinsic Euler angle beta\n", " quadrupole_gamma = 0, # ZYZ extrinsic Euler angle gamma\n", " quadrupole_asymmetry = 0.05, # Asymmetry parameter\n", " isomer_dist = None,\n", " magnetic_field_dist = None,\n", " magnetic_theta_dist = None,\n", " magnetic_phi_dist = None,\n", " quadrupole_dist = None,\n", " quadrupole_alpha_dist = None,\n", " quadrupole_beta_dist = None,\n", " quadrupole_gamma_dist = None,\n", " quadrupole_asymmetry_dist = None,\n", " isotropic = False) # 3D distribution in mag and EFG\n", "\n", "print(hyperfine)" ] }, { "cell_type": "code", "execution_count": 2, "id": "5b3bf740-be7b-4a7c-a4f1-4d0ff25b3645", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(33.0, 90.0, 90.0)\n", "(0.0, 0.0, 33.0)\n" ] } ], "source": [ "# Nexus frame (sigma, pi, k)\n", "# spherical (mag, polar, azimuthal)\n", "\n", "# convert a magnetic field along pi direction to spherical coordinates\n", "print(nx.MagVectorToSpherical(0, 33, 0))\n", "\n", "# convert a magnetic field along k direction to Nexus frame\n", "print(nx.MagSphericalToVector(33, 0, 0))" ] }, { "cell_type": "code", "execution_count": 3, "id": "88c8fec5-6aef-46ba-a7b6-4028b0dfb913", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2.024215767587424 1.5707963267948966 1.5707963267948966\n" ] } ], "source": [ "# input vector in the nexus coordinate system [sigma,pi,k]\n", "alpha, beta, gamma = nx.euler.VectorsToAngles([0,1,0])\n", "\n", "print(alpha, beta, gamma) # the return value of alpha is random here" ] }, { "cell_type": "code", "execution_count": 4, "id": "12687849-5f01-40f9-b273-3d99a01966f6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.0 1.5707963267948966 3.141592653589793\n" ] } ], "source": [ "# input vector in the nexus coordinate system.\n", "# vectors must be orthogonal, but do not have to be normalized\n", "Vzz = [1,0,0]\n", "Vxx = [0,0,1]\n", "Vyy = [0,1,0]\n", "alpha, beta, gamma = nx.euler.VectorsToAngles(Vzz, Vxx, Vyy)\n", "\n", "print(alpha, beta, gamma)" ] } ], "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 }