ond, etc). Otherwise, all electrons are included.
</p>

<p>
If <code>'sparse'</code> is given as third argument, the Hamiltonian matrix is returned in sparse format
instead of full format.
</p>

<!-- ====================================================== -->
<div class="subtitle">Examples</div>

<p>
The zero-field term <img src="eqn/ham_zf1.png" alt="[eqn]"><!--MATH $\boldsymbol{S}^\mr{T}D\boldsymbol{S}$ --> of a
simple spin system
</p>

<pre class="matlab">
Sys = struct('S',1,'g',2,'D',[1680 110]);
</pre>
