Two interacting spins¶
Combine electronic spins $S_0=1$ and $S_1=1/2$:
$$ H=J\,\mathbf{S}_0\cdot\mathbf{S}_1+D S_{0z}^{2}-g\mu_B B_z(S_{0z}+S_{1z}). $$
Use $J=0.1$ meV, $D=0.02$ meV and $B_z=0.5$ T. Positive Hamiltonian exchange is antiferromagnetic; positive $D$ is easy-plane anisotropy. The external field acts on both spins. Dipolar and transverse-anisotropy terms are omitted.
import numpy as np
import plotly.io as pio
from spinfinity import SpinSys, hamil, plotting
pio.renderers.default = "plotly_mimetype+notebook"
# Use "fixed" for compact plots, or "no" to suppress display.
plotting.set_display_mode("responsive")
spin = SpinSys([1.0, 0.5])
spin.B = [0.0, 0.0, 0.5] # T
spin.BTip = [0.0, 0.0, 0.0] # T
spin.gfactorvector = [2.0, 2.0]
spin.Dvector[0] = 0.02 # meV
hamil.assign_ExchangeInteraction(spin, [(0, 1, [0.1, 0.1, 0.1])])
Solve the coupled system¶
The Hilbert-space dimension is $(2S_0+1)(2S_1+1)=6$. The exchange helper assigns [Jxx, Jyy, Jzz] in meV; equal components give isotropic exchange.
These coefficients are stored in Jvector, not the separate dimensionless tunneling parameter J. Rebuild after changing an interaction.
hamil.calc_EigStates(spin, rebuildH=True)
print("Hilbert-space dimension:", spin.dimensionOfMatrix)
print("Relative energies (meV):", np.round(spin.E_All, 6))
print("Product basis:", spin.basisStates)
for state in spin.states:
print(state)
Hilbert-space dimension: 6 Relative energies (meV): [0. 0.057884 0.0994 0.144568 0.202452 0.273052] Product basis: ['|1.0,0.5>' '|1.0,-0.5>' '|-0.0,0.5>' '|-0.0,-0.5>' '|-1.0,0.5>' '|-1.0,-0.5>'] |0> (E = 0.0) = -0.777+0.000j|1.0,-0.5>+0.629+0.000j|-0.0,0.5> |1> (E = 0.0579) = -0.777+0.000j|-1.0,0.5>+0.629+0.000j|-0.0,-0.5> |2> (E = 0.0994) = +1.000+0.000j|1.0,0.5> |3> (E = 0.1446) = -0.777+0.000j|-0.0,0.5>-0.629+0.000j|1.0,-0.5> |4> (E = 0.2025) = -0.777+0.000j|-0.0,-0.5>-0.629+0.000j|-1.0,0.5> |5> (E = 0.2731) = +1.000+0.000j|-1.0,-0.5>
Energy levels and eigenstate composition¶
The first plot places energies against $\langle S_{0z}+S_{1z}\rangle$. A product state in the second plot is written $|m_0,m_1\rangle$. Exchange mixes states with the same total $m_z$.
Each probability-map row sums to one; it is not a population distribution over energy eigenstates. Both figures are resized before their first display.
hamil.plot_EnergyVsS(spin, type="z", energyscale="meV");
hamil.plot_EigenMatrix(spin);