s_operators#
Generator functions for various spinrelated operators.
When dealing with nonorthonormal orbitals, you need to make sure that you include the overlap matrices when using the methods below. This ensures that the operators can resolve any spin contamination that may be present in your orbitals.
The overlap matrices that you provide have to be computed in the same basis in which the spin operator is encoded. If you are working in the molecular orbital (MO) basis, the overlap can be easily constructed starting from the atomic orbital (AO) overlap matrix, which can be obtained from any standard quantum chemistry program (for example from the get_oplp() method in PySCF). This AO overlap matrix can be transformed to the MO basis using the AOtoMO transformation matrix, $C$, according to the following equation:
For restricted spin orbitals (i.e. \(C_\alpha == C_\beta\)), the equation above simplifies to the identity matrix (because the MOs will be orthonormal), in which case you can omit the overlap arguments below). Otherwise, you must include the correct overlap. For example, the overlapmatrix between the $`alpha`$ and $`beta`$spin orbitals is:
Functions

Constructs the $S^$ operator. 

Constructs the $S^+$ operator. 

Constructs the $S^x$ operator. 

Constructs the $S^y$ operator. 

Constructs the $S^z$ operator. 
 s_minus_operator(num_spatial_orbitals, overlap=None)[source]#
Constructs the $S^$ operator.
The $S^$ operator is defined as:
\[S^ = \sum_{i,j} s_{ij}^{\beta,\alpha} \hat{a}_{i}^{\dagger} \hat{a}_{j},\]where $s$ denotes the overlapmatrix between the $beta$ and $alpha$spin orbitals.
Note
The overlap input to this method is related to the input of the other methods (
s_plus_operator()
,s_x_operator()
, ands_y_operator()
) by its transpose, because the following relation holds:\[s_{ij}^{\beta,\alpha} = \left(s_{ij}^{\alpha,\beta}\right)^T.\]Note that for orthonormal orbitals this overlapmatrix will become the identity matrix, simplifying the operator above to become:
S^ = sum_{i=1}^{n} hat{a}_{i+n}^{dagger} hat{a}_{i}
where, $n$ denotes the index of the spatial orbital. Since Qiskit Nature employs the blocked spinordering convention, the creation operator above is applied to the \(\beta\)spin orbital and the annihilation operator is applied to the corresponding \(\alpha\)spin orbital.
 Parameters:
num_spatial_orbitals (int) – the size of the operator which to generate.
overlap (np.ndarray  None) – the overlapmatrix between the $beta$ and $alpha$spin orbitals. When this is None, the overlapmatrix is assumed to be identity, resulting in the second definition above.
 Returns:
The $S^$ operator of the requested size.
 Return type:
 s_plus_operator(num_spatial_orbitals, overlap=None)[source]#
Constructs the $S^+$ operator.
The $S^+$ operator is defined as:
\[S^+ = \sum_{i,j} s_{ij}^{\alpha,\beta} \hat{a}_{i}^{\dagger} \hat{a}_{j},\]where $s$ denotes the overlapmatrix between the $alpha$ and $beta$spin orbitals.
Note that for orthonormal orbitals this overlapmatrix will become the identity matrix, simplifying the operator above to become:
\[S^+ = \sum_{i=1}^{n} \hat{a}_{i}^{\dagger} \hat{a}_{i+n},\]where, $n$ denotes the index of the spatial orbital. Since Qiskit Nature employs the blocked spinordering convention, the creation operator above is applied to the \(\alpha\)spin orbital and the annihilation operator is applied to the corresponding \(\beta\)spin orbital.
 Parameters:
num_spatial_orbitals (int) – the size of the operator which to generate.
overlap (np.ndarray  None) – the overlapmatrix between the $alpha$ and $beta$spin orbitals. When this is None, the overlapmatrix is assumed to be identity, resulting in the second definition above.
 Returns:
The $S^+$ operator of the requested size.
 Return type:
 s_x_operator(num_spatial_orbitals, overlap=None)[source]#
Constructs the $S^x$ operator.
The $S^x$ operator is defined as:
\[S^x = \frac{1}{2} \left(S^+ + S^\right)\] Parameters:
num_spatial_orbitals (int) – the size of the operator which to generate.
overlap (np.ndarray  None) – the overlapmatrix between the $alpha$ and $beta$spin orbitals. When this is None, the overlapmatrix is assumed to be identity.
 Returns:
The $S^x$ operator of the requested size.
 Return type:
 s_y_operator(num_spatial_orbitals, overlap=None)[source]#
Constructs the $S^y$ operator.
The $S^y$ operator is defined as:
\[S^y = \frac{i}{2} \left(S^+  S^\right)\] Parameters:
num_spatial_orbitals (int) – the size of the operator which to generate.
overlap (np.ndarray  None) – the overlapmatrix between the $alpha$ and $beta$spin orbitals. When this is None, the overlapmatrix is assumed to be identity.
 Returns:
The $S^y$ operator of the requested size.
 Return type:
 s_z_operator(num_spatial_orbitals)[source]#
Constructs the $S^z$ operator.
The $S^z$ operator is defined as:
\[S^z = \frac{1}{2} \sum_{i=1}^{n} \left( \hat{a}_{i}^{\dagger}\hat{a}_{i}  \hat{a}_{i+n}^{\dagger}\hat{a}_{i+n} \right),\]where, $n$ denotes the index of the spatial orbital. Since Qiskit Nature employs the blocked spinordering convention, this means that the above corresponds to evaluating the number operator (\(\hat{a}^{\dagger}\hat{a}\)) once on the \(\alpha\)spin orbital and once on the \(\beta\)spin orbital and taking their difference.
Note
Contrary to the other methods in this module, this one does not require the inclusion of an overlapmatrix for nonorthonormal orbitals, because it does not mix the $alpha$ and $beta$spin contributions.
 Parameters:
num_spatial_orbitals (int) – the size of the operator which to generate.
 Returns:
The $S^z$ operator of the requested size.
 Return type: