![]() |
Return the sz operator.
openfermion.hamiltonians.sz_operator(
n_spatial_orbitals: int
) -> openfermion.ops.FermionOperator
.. math:: \begin{align} S^{z} = \frac{1}{2}\sum{i = 1}^{n}(n{i, \alpha} - n_{i, \beta}) \end{align}
Args | |
---|---|
n_spatial_orbitals
|
number of spatial orbitals (n_qubits // 2). |
Returns | |
---|---|
operator (FermionOperator): corresponding to the sz operator over n_spatial_orbitals. |
Note:
The indexing convention used is that even indices correspond to spin-up (alpha) modes and odd indices correspond to spin-down (beta) modes.