{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# PyOR Quantum\n", "## Author: Vineeth Thalakottoor\n", "## Introduction to Spin Operators (Single Spin)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Define the source path\n", "SourcePath = '/media/HD2/Vineeth/PostDoc_Simulations/Github/PyOR_V1/PyOR_Combined/Source_Doc'\n", "\n", "# Add source path\n", "import sys\n", "sys.path.append(SourcePath)\n", "\n", "# Import PyOR package\n", "from PyOR_QuantumSystem import QuantumSystem as QunS" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Define the spin system\n", "Spin_list = {\"A\" : \"H2\"}\n", "QS = QunS(Spin_list,PrintDefault=False)\n", "\n", "# initialize the system\n", "QS.Initialize()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 0.70710676908493 & 0\\\\0.70710676908493 & 0 & 0.70710676908493\\\\0 & 0.70710676908493 & 0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, 0.70710676908493, 0],\n", "[0.70710676908493, 0, 0.70710676908493],\n", "[ 0, 0.70710676908493, 0]])" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# \"X\" spin operator\n", "QS.Ax.matrix" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & - 0.70710676908493 i & 0\\\\0.70710676908493 i & 0 & - 0.70710676908493 i\\\\0 & 0.70710676908493 i & 0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, -0.70710676908493*I, 0],\n", "[0.70710676908493*I, 0, -0.70710676908493*I],\n", "[ 0, 0.70710676908493*I, 0]])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# \"Y\" spin operator\n", "QS.Ay.matrix" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}1.0 & 0 & 0\\\\0 & 0 & 0\\\\0 & 0 & -1.0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[1.0, 0, 0],\n", "[ 0, 0, 0],\n", "[ 0, 0, -1.0]])" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# \"Z\" spin operator\n", "QS.Az.matrix" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 1.41421353816986 & 0\\\\0 & 0 & 1.41421353816986\\\\0 & 0 & 0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[0, 1.41421353816986, 0],\n", "[0, 0, 1.41421353816986],\n", "[0, 0, 0]])" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# \"+\"\" spin operator\n", "QS.Ap.matrix" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 0\\\\1.41421353816986 & 0 & 0\\\\0 & 1.41421353816986 & 0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, 0, 0],\n", "[1.41421353816986, 0, 0],\n", "[ 0, 1.41421353816986, 0]])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# \"-\"\" spin operator\n", "QS.Am.matrix" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'H2'" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Particle Parameter: Nuclies name\n", "QS.A.name" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Particle Parameter: Spin quantum number\n", "QS.A.spin" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "41065000.0" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Particle Parameter: gyromagnetic ratio\n", "QS.A.gamma" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2.86e-29" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Particle Parameter: Quadrupole vale\n", "QS.A.quadrupole" ] } ], "metadata": { "kernelspec": { "display_name": "base", "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.7" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }