{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "6718709f", "metadata": {}, "source": [ "# Spherical Tensors Product Operators (Spin One)\n", "- Author: Vineeth Francis Thalakottoor\n", "- Email: vineeth.thalakottoor@ens.psl.eu or vineethfrancis.physics@gmail.com" ] }, { "cell_type": "code", "execution_count": 1, "id": "27a57f94", "metadata": {}, "outputs": [], "source": [ "# Define the source path\n", "SourcePath = '/media/HD2/Vineeth/PostDoc_Simulations/Github/PyOR_V1/PyOR_Combined/PyOR/Source_Doc'\n", "\n", "# Add source path\n", "import sys\n", "sys.path.append(SourcePath)\n", "import time\n", "%matplotlib ipympl\n", "\n", "# Import PyOR package\n", "from PyOR_QuantumSystem import QuantumSystem as QunS\n", "from PyOR_Hamiltonian import Hamiltonian\n", "from PyOR_DensityMatrix import DensityMatrix\n", "from PyOR_QuantumObject import QunObj\n", "from PyOR_HardPulse import HardPulse\n", "from PyOR_Basis import Basis\n", "from PyOR_Evolution import Evolutions\n", "from PyOR_Plotting import Plotting\n", "import PyOR_SignalProcessing as Spro\n", "from PyOR_Commutators import Commutators\n", "from PyOR_QuantumLibrary import QuantumLibrary\n", "from PyOR_Relaxation import RelaxationProcess" ] }, { "cell_type": "code", "execution_count": 2, "id": "ab0e39a3", "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()" ] }, { "attachments": {}, "cell_type": "markdown", "id": "6f86d849", "metadata": {}, "source": [ "## Product Operator Basis: Spherical Tensors" ] }, { "cell_type": "code", "execution_count": 3, "id": "efb23439", "metadata": {}, "outputs": [], "source": [ "BS = Basis(QS)\n", "\n", "Basis_ST, coherence_ST, Dic_ST = BS.ProductOperators_SphericalTensor()" ] }, { "cell_type": "code", "execution_count": 4, "id": "7cd39f7c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, -1, 0, 1, -2, -1, 0, 1, 2]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "coherence_ST" ] }, { "cell_type": "code", "execution_count": 5, "id": "73333478", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['T(0,0)',\n", " 'T(1,-1)',\n", " 'T(1,0)',\n", " 'T(1,1)',\n", " 'T(2,-2)',\n", " 'T(2,-1)',\n", " 'T(2,0)',\n", " 'T(2,1)',\n", " 'T(2,2)']" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Dic_ST" ] }, { "cell_type": "code", "execution_count": 6, "id": "4f261213", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['T(0,0)', 'T(1,-1)', 'T(1,0)', 'T(1,1)', 'T(2,-2)', 'T(2,-1)', 'T(2,0)', 'T(2,1)', 'T(2,2)']\n" ] } ], "source": [ "OpB_ST = BS.String_to_Matrix(Dic_ST, Basis_ST)" ] }, { "cell_type": "code", "execution_count": 7, "id": "d0632fe6", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0.577350269189626 & 0 & 0\\\\0 & 0.577350269189626 & 0\\\\0 & 0 & 0.577350269189626\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[0.577350269189626, 0, 0],\n", "[ 0, 0.577350269189626, 0],\n", "[ 0, 0, 0.577350269189626]])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "OpB_ST['T(0,0)'].matrix" ] }, { "cell_type": "code", "execution_count": 8, "id": "41a46a96", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 0\\\\0.707106781186548 & 0 & 0\\\\0 & 0.707106781186548 & 0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, 0, 0],\n", "[0.707106781186548, 0, 0],\n", "[ 0, 0.707106781186548, 0]])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "OpB_ST['T(1,-1)'].matrix" ] }, { "cell_type": "code", "execution_count": 9, "id": "9a02a813", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 0\\\\0 & 0 & 0\\\\1.0 & 0 & 0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, 0, 0],\n", "[ 0, 0, 0],\n", "[1.0, 0, 0]])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "OpB_ST['T(2,-2)'].matrix" ] } ], "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" } }, "nbformat": 4, "nbformat_minor": 5 }