{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "6718709f", "metadata": {}, "source": [ "# Zeeman basis and Singlet Triplet basis\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\" : \"H1\", \"B\" : \"H1\"}\n", "QS = QunS(Spin_list,PrintDefault=False)\n", "\n", "# initialize the system\n", "QS.Initialize()" ] }, { "attachments": {}, "cell_type": "markdown", "id": "3a59211f", "metadata": {}, "source": [ "### Set parameters" ] }, { "cell_type": "code", "execution_count": 3, "id": "275d8217", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Larmor Frequency in MHz: [-400.22802765 -400.22806765]\n" ] } ], "source": [ "# Master Equation\n", "QS.PropagationSpace = \"Liouville\"\n", "QS.MasterEquation = \"Redfield\"\n", "\n", "# B0 Field in Tesla, Static Magnetic field (B0) along Z\n", "QS.B0 = 9.4\n", "\n", "# Offset Frequency in rotating frame (Hz)\n", "QS.OFFSET[\"A\"] = 10.0\n", "QS.OFFSET[\"B\"] = 50.0\n", "\n", "# Define J coupling between Spins \n", "QS.JcoupleValue(\"A\",\"B\",5.0)\n", "\n", "# Define initial and final Spin Temperature\n", "QS.I_spintemp[\"A\"] = 300.0\n", "QS.I_spintemp[\"B\"] = 300.0\n", "QS.F_spintemp[\"A\"] = 300.0\n", "QS.F_spintemp[\"B\"] = 300.0\n", "\n", "# Define paris of spins coupled by dipolar interaction\n", "QS.Dipole_Pairs = [(\"A\",\"B\")]\n", "\n", "# Relaxation Process\n", "QS.Rprocess = \"Auto-correlated Dipolar Homonuclear\"\n", "QS.RelaxParDipole_tau = 10.0e-12\n", "QS.RelaxParDipole_bIS = [30.0e3]\n", "\n", "QS.Update()" ] }, { "attachments": {}, "cell_type": "markdown", "id": "0f7c0f44", "metadata": {}, "source": [ "### Generate Hamiltonians" ] }, { "cell_type": "code", "execution_count": 4, "id": "b27e93bc", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Larmor Frequency in MHz: [-400.22802765 -400.22806765]\n" ] } ], "source": [ "# generate Larmor Frequencies\n", "QS.print_Larmor = True\n", "Ham = Hamiltonian(QS)\n", "COMM = Commutators()\n", "Hz = Ham.Zeeman_RotFrame()\n", "\n", "# J coupling Hamiltonian\n", "Hj = Ham.Jcoupling()\n", "\n", "# Generating the commutation superoperator\n", "QS.RowColOrder = 'C'\n", "QLib = QuantumLibrary(QS)\n", "\n", "Hz_L = QLib.CommutationSuperoperator(Hz+Hj)" ] }, { "cell_type": "code", "execution_count": 5, "id": "fb63d498", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}-30.0000000759161 & 0 & 0 & 0\\\\0 & 20.0000008601147 & 0 & 0\\\\0 & 0 & -20.0000008601147 & 0\\\\0 & 0 & 0 & 30.0000000759161\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[-30.0000000759161, 0, 0, 0],\n", "[ 0, 20.0000008601147, 0, 0],\n", "[ 0, 0, -20.0000008601147, 0],\n", "[ 0, 0, 0, 30.0000000759161]])" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Hz.Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 6, "id": "7792fc79", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}1.24999997786618 & 0 & 0 & 0\\\\0 & -1.24999997786618 & 2.49999995573235 & 0\\\\0 & 2.49999995573235 & -1.24999997786618 & 0\\\\0 & 0 & 0 & 1.24999997786618\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[1.24999997786618, 0, 0, 0],\n", "[ 0, -1.24999997786618, 2.49999995573235, 0],\n", "[ 0, 2.49999995573235, -1.24999997786618, 0],\n", "[ 0, 0, 0, 1.24999997786618]])" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Hj.Inverse2PI().matrix" ] }, { "attachments": {}, "cell_type": "markdown", "id": "b1475134", "metadata": {}, "source": [ "## Zeeman Basis Kets" ] }, { "cell_type": "code", "execution_count": 7, "id": "5e2241e6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['|1/2,1/2⟩|1/2,1/2⟩',\n", " '|1/2,1/2⟩|1/2,-1/2⟩',\n", " '|1/2,-1/2⟩|1/2,1/2⟩',\n", " '|1/2,-1/2⟩|1/2,-1/2⟩']" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "QS.ZeemanBasis_Ket()" ] }, { "attachments": {}, "cell_type": "markdown", "id": "eab82b6d", "metadata": {}, "source": [ "## Zeeman Basis Bras" ] }, { "cell_type": "code", "execution_count": 8, "id": "3188bdd9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['⟨1/2,1/2|⟨1/2,1/2|',\n", " '⟨1/2,1/2|⟨1/2,-1/2|',\n", " '⟨1/2,-1/2|⟨1/2,1/2|',\n", " '⟨1/2,-1/2|⟨1/2,-1/2|']" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "QS.ZeemanBasis_Bra()" ] }, { "attachments": {}, "cell_type": "markdown", "id": "b7a67890", "metadata": {}, "source": [ "# Zeeman Basis states" ] }, { "cell_type": "code", "execution_count": 9, "id": "fae740ab", "metadata": {}, "outputs": [], "source": [ "BS = Basis(QS)\n", "Zstates, DicZ = BS.Zeeman_Basis()" ] }, { "cell_type": "code", "execution_count": 10, "id": "29936b3b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['|1/2,1/2⟩|1/2,1/2⟩', '|1/2,1/2⟩|1/2,-1/2⟩', '|1/2,-1/2⟩|1/2,1/2⟩', '|1/2,-1/2⟩|1/2,-1/2⟩']\n" ] } ], "source": [ "print(DicZ)" ] }, { "cell_type": "code", "execution_count": 11, "id": "ffead04a", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}1.0\\\\0\\\\0\\\\0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[1.0],\n", "[ 0],\n", "[ 0],\n", "[ 0]])" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Zstates[0].matrix" ] }, { "cell_type": "code", "execution_count": 12, "id": "5706a152", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(Zstates[0], Zstates, DicZ )" ] }, { "cell_type": "code", "execution_count": 13, "id": "1c40c47b", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\1.0\\\\0\\\\0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[1.0],\n", "[ 0],\n", "[ 0]])" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Zstates[1].matrix" ] }, { "cell_type": "code", "execution_count": 14, "id": "c51b7e54", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,1/2⟩|1/2,-1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(Zstates[1], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 15, "id": "caba7aa6", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\0\\\\1.0\\\\0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[ 0],\n", "[1.0],\n", "[ 0]])" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Zstates[2].matrix" ] }, { "cell_type": "code", "execution_count": 16, "id": "f0fc407b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,-1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(Zstates[2], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 17, "id": "248f6ff0", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\0\\\\0\\\\1.0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[ 0],\n", "[ 0],\n", "[1.0]])" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Zstates[3].matrix" ] }, { "cell_type": "code", "execution_count": 18, "id": "6f7f0d83", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,-1/2⟩|1/2,-1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(Zstates[3], Zstates, DicZ)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "1b36e187", "metadata": {}, "source": [ "## Singlet Triplet Basis states" ] }, { "cell_type": "code", "execution_count": 19, "id": "6a5dd7aa", "metadata": {}, "outputs": [], "source": [ "STstates, DicST = BS.SingletTriplet_Basis()" ] }, { "cell_type": "code", "execution_count": 20, "id": "f4b7f2b1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['S0 ', 'Tp ', 'T0 ', 'Tm ']\n" ] } ], "source": [ "print(DicST)" ] }, { "cell_type": "code", "execution_count": 21, "id": "cfd1279c", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\0.707106781186547\\\\-0.707106781186547\\\\0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[ 0.707106781186547],\n", "[-0.707106781186547],\n", "[ 0]])" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "STstates[0].matrix" ] }, { "cell_type": "code", "execution_count": 22, "id": "f7ed6a9e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 0.70711 |1/2,1/2⟩|1/2,-1/2⟩ + -0.70711 |1/2,-1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(STstates[0], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 23, "id": "f1a1aa11", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}1.0\\\\0\\\\0\\\\0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[1.0],\n", "[ 0],\n", "[ 0],\n", "[ 0]])" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "STstates[1].matrix" ] }, { "cell_type": "code", "execution_count": 24, "id": "72ad3da6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(STstates[1], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 25, "id": "6cc4ee19", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\0.707106781186547\\\\0.707106781186547\\\\0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[0.707106781186547],\n", "[0.707106781186547],\n", "[ 0]])" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "STstates[2].matrix" ] }, { "cell_type": "code", "execution_count": 26, "id": "6284c08d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 0.70711 |1/2,1/2⟩|1/2,-1/2⟩ + 0.70711 |1/2,-1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(STstates[2], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 27, "id": "f07ada0e", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\0\\\\0\\\\1.0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[ 0],\n", "[ 0],\n", "[1.0]])" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "STstates[3].matrix" ] }, { "cell_type": "code", "execution_count": 28, "id": "c2046787", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,-1/2⟩|1/2,-1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(STstates[3], Zstates, DicZ)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "6a966173", "metadata": {}, "source": [ "## Transformation Between Zeeman state and Singlet-Triplet state" ] }, { "cell_type": "code", "execution_count": 29, "id": "a097dc2a", "metadata": {}, "outputs": [], "source": [ "U_Z_ST = BS.BasisChange_TransformationMatrix(Zstates,STstates)" ] }, { "cell_type": "code", "execution_count": 30, "id": "8e7cef1e", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 1.0 & 0 & 0\\\\0.707106781186547 & 0 & 0.707106781186547 & 0\\\\-0.707106781186547 & 0 & 0.707106781186547 & 0\\\\0 & 0 & 0 & 1.0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, 1.0, 0, 0],\n", "[ 0.707106781186547, 0, 0.707106781186547, 0],\n", "[-0.707106781186547, 0, 0.707106781186547, 0],\n", "[ 0, 0, 0, 1.0]])" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "U_Z_ST.matrix" ] }, { "attachments": {}, "cell_type": "markdown", "id": "94cc92fc", "metadata": {}, "source": [ "## Transformation of Zeeman and J coupling Hamiltonian into Singlet-Triplet basis" ] }, { "cell_type": "code", "execution_count": 31, "id": "1613d288", "metadata": {}, "outputs": [], "source": [ "Hj_ST = BS.BasisChange_Operator(Hj,U_Z_ST)\n", "Hz_ST = BS.BasisChange_Operator(Hz,U_Z_ST)" ] }, { "cell_type": "code", "execution_count": 32, "id": "6d3c648a", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}-3.74999993359853 & 0 & 4.99168987337528 \\cdot 10^{-17} & 0\\\\0 & 1.24999997786618 & 0 & 0\\\\6.78409585029909 \\cdot 10^{-17} & 0 & 1.24999997786618 & 0\\\\0 & 0 & 0 & 1.24999997786618\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ -3.74999993359853, 0, 4.99168987337528e-17, 0],\n", "[ 0, 1.24999997786618, 0, 0],\n", "[6.78409585029909e-17, 0, 1.24999997786618, 0],\n", "[ 0, 0, 0, 1.24999997786618]])" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Hj_ST.Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 33, "id": "1720fc59", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}-3.74999993359853 & 0 & 4.99168987337528 \\cdot 10^{-17} & 0\\\\0 & 1.24999997786618 & 0 & 0\\\\6.78409585029909 \\cdot 10^{-17} & 0 & 1.24999997786618 & 0\\\\0 & 0 & 0 & 1.24999997786618\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ -3.74999993359853, 0, 4.99168987337528e-17, 0],\n", "[ 0, 1.24999997786618, 0, 0],\n", "[6.78409585029909e-17, 0, 1.24999997786618, 0],\n", "[ 0, 0, 0, 1.24999997786618]])" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Alternate way\n", "Hj.BasisChange(U_Z_ST).Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 34, "id": "d154b96a", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}-3.74999993359853 & 0 & 4.99168987337528 \\cdot 10^{-17} & 0\\\\0 & 1.24999997786618 & 0 & 0\\\\6.78409585029909 \\cdot 10^{-17} & 0 & 1.24999997786618 & 0\\\\0 & 0 & 0 & 1.24999997786618\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ -3.74999993359853, 0, 4.99168987337528e-17, 0],\n", "[ 0, 1.24999997786618, 0, 0],\n", "[6.78409585029909e-17, 0, 1.24999997786618, 0],\n", "[ 0, 0, 0, 1.24999997786618]])" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Another alternate way\n", "Hj.Basis(\"singlettriplet\").Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 35, "id": "546b8e7e", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}2.8102595185518 \\cdot 10^{-16} & 0 & 20.0000008601147 & 0\\\\0 & -30.0000000759161 & 0 & 0\\\\20.0000008601147 & 0 & 2.8102595185518 \\cdot 10^{-16} & 0\\\\0 & 0 & 0 & 30.0000000759161\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[2.8102595185518e-16, 0, 20.0000008601147, 0],\n", "[ 0, -30.0000000759161, 0, 0],\n", "[ 20.0000008601147, 0, 2.8102595185518e-16, 0],\n", "[ 0, 0, 0, 30.0000000759161]])" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Hz_ST.Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 36, "id": "6e2d91e9", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}2.8102595185518 \\cdot 10^{-16} & 0 & 20.0000008601147 & 0\\\\0 & -30.0000000759161 & 0 & 0\\\\20.0000008601147 & 0 & 2.8102595185518 \\cdot 10^{-16} & 0\\\\0 & 0 & 0 & 30.0000000759161\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[2.8102595185518e-16, 0, 20.0000008601147, 0],\n", "[ 0, -30.0000000759161, 0, 0],\n", "[ 20.0000008601147, 0, 2.8102595185518e-16, 0],\n", "[ 0, 0, 0, 30.0000000759161]])" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Alternate way\n", "Hz.BasisChange(U_Z_ST).Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 37, "id": "ddbc86d1", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}2.8102595185518 \\cdot 10^{-16} & 0 & 20.0000008601147 & 0\\\\0 & -30.0000000759161 & 0 & 0\\\\20.0000008601147 & 0 & 2.8102595185518 \\cdot 10^{-16} & 0\\\\0 & 0 & 0 & 30.0000000759161\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[2.8102595185518e-16, 0, 20.0000008601147, 0],\n", "[ 0, -30.0000000759161, 0, 0],\n", "[ 20.0000008601147, 0, 2.8102595185518e-16, 0],\n", "[ 0, 0, 0, 30.0000000759161]])" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Another alternate way\n", "Hz.Basis(\"singlettriplet\").Inverse2PI().matrix" ] }, { "cell_type": "markdown", "id": "ea4e5d4a", "metadata": {}, "source": [ "### Eigen values and Eigen Vectors of Hj" ] }, { "cell_type": "code", "execution_count": 38, "id": "c178fe57", "metadata": {}, "outputs": [], "source": [ "QLib = QuantumLibrary()" ] }, { "cell_type": "code", "execution_count": 39, "id": "176e7ff7", "metadata": {}, "outputs": [], "source": [ "eigenvalues, eigenvectors = QLib.Eigen_Split(Hj)" ] }, { "cell_type": "code", "execution_count": 40, "id": "795478b6", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}1.24999997786618 & -3.74999993359853 & 1.24999997786618 & 1.24999997786618\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([[1.24999997786618, -3.74999993359853, 1.24999997786618, 1.24999997786618]])" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eigenvalues.Inverse2PI().matrix" ] }, { "cell_type": "code", "execution_count": 41, "id": "ff4c9ac9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 0.70711 |1/2,1/2⟩|1/2,-1/2⟩ + 0.70711 |1/2,-1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(eigenvectors[0], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 42, "id": "99cec59d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 0.70711 |1/2,1/2⟩|1/2,-1/2⟩ + -0.70711 |1/2,-1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(eigenvectors[1], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 43, "id": "e04b0b00", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,1/2⟩|1/2,1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(eigenvectors[2], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 44, "id": "602954e4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ket State = 1.0 |1/2,-1/2⟩|1/2,-1/2⟩\n" ] } ], "source": [ "BS.KetState_Components(eigenvectors[3], Zstates, DicZ)" ] }, { "cell_type": "code", "execution_count": 45, "id": "28176f3e", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 1.0 & 0\\\\0.707106781186548 & 0.707106781186548 & 0 & 0\\\\0.707106781186547 & -0.707106781186547 & 0 & 0\\\\0 & 0 & 0 & 1.0\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0, 0, 1.0, 0],\n", "[0.707106781186548, 0.707106781186548, 0, 0],\n", "[0.707106781186547, -0.707106781186547, 0, 0],\n", "[ 0, 0, 0, 1.0]])" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "BS.BasisChange_TransformationMatrix(Zstates,eigenvectors).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 }