Your first ESR spectrum¶
This model combines transition frequencies, thermal population differences and tip-field-weighted transition strengths with Lorentzian lines.
The linewidth is supplied by the user. The model does not calculate absolute current contrast, saturation or driven time evolution.
import numpy as np
import plotly.graph_objects as go
import plotly.io as pio
from spinfinity import ESR, SpinSys, hamil, plotting
pio.renderers.default = "plotly_mimetype+notebook"
# Use "fixed" for compact plots, or "no" to suppress display.
plotting.set_display_mode("responsive")
Build the spin Hamiltonian¶
Use an external field of 0.5 T and a small tilted tip field. For tip="f", the fields add on the readout spin.
BTip affects the static Hamiltonian and the phenomenological transition/detection weighting. It is not an independently specified RF amplitude B1.
spin = SpinSys([0.5])
spin.B = [0.0, 0.0, 0.5] # T
spin.BTip = [0.01, 0.0, 0.01] # T
spin.tip = "f"
spin.gfactorvector = [2.0]
spin.T = 0.2 # K
hamil.calc_EigEnergies(spin, rebuildH=True)
resonance = spin.E_All_inGHz[1] - spin.E_All_inGHz[0]
print(f"Transition frequency: {resonance:.6f} GHz")
Transition frequency: 14.278914 GHz
Calculate the spectrum¶
lw is the Lorentzian full width at half maximum (FWHM), in GHz. We prescribe 0.02 GHz = 20 MHz.
The package plotting function returns a figure, the frequency grid and the calculated signal. We use thermal populations and keep the raw signal with norm=False; its scale is phenomenological, not a current in A.
linewidth = 0.02 # GHz
frequency = np.linspace(resonance - 0.25, resonance + 0.25, 1001)
ESR.plot_FreqSweep(
spin,
freq_array=frequency,
AllowPumping=False,
lw=linewidth,
norm=False,
output=False,
);