sham

Constructs spin Hamiltonian operators.

Syntax
[F,Gx,Gy,Gz] = sham(Sys)
H = sham(Sys,B)
... = sham(Sys,B,'sparse')
Description

This function returns the spin Hamiltonian or its components. Sys is the structure defining the spin system, the optional B is the 3-element external magnetic field vector (in mT) in the molecular frame of the spin system.

If no magnetic field is given, sham returns the four Hamiltonian components F, Gx, Gy and Gz. F is the Hamiltonian containing all field-independent interactions, and the other three matrices are the components of the Zeeman interaction Hamiltonian for the three principal directions of the molecular frame of the spin system (see zeeman).

If a magnetic field B is given, sham returns the overall Hamiltonian H.

F and H are in MHz, the components Gx, Gy and Gz are in MHz/mT.

The general form of the spin Hamiltonian and the terms contained in it are explained in the section about the spin system structure.

If 'sparse' is given as third argument, the Hamiltonian matrix is returned in sparse format instead of full format.

Examples

The Hamiltonian of a simple S=I=1/2 system is

g = [2 2 2]; A = [1 1 2]*100; B = [0 0 340];
Sy = struct('S',.5,'g',g,'Nucs','1H','A',A);
H = sham(Sy,B)
H =
   1.0e+03 *
    4.8015         0         0         0
         0    4.7160    0.0500         0
         0    0.0500   -4.8160         0
         0         0         0   -4.7015

To get its eigenvalues in GHz and their associated eigenvectors, use

[V,E] = eig(H); E = diag(E).'/1e3, V
E =
   -4.8162   -4.7015    4.7162    4.8015

V =
         0         0         0    1.0000
   -0.0052         0   -1.0000         0
    1.0000         0   -0.0052         0
         0    1.0000         0         0
See also

eeint, hfine, nnint, nquad, zeeman, zfield