qml.qchem.spinz¶
- spinz(orbitals)[source]¶
Computes the total spin projection observable ˆSz.
The total spin projection operator ˆSz is given by
ˆSz=∑α,β⟨α|ˆsz|β⟩ ˆc†αˆcβ, ⟨α|ˆsz|β⟩=szαδα,β,where szα=±1/2 is the spin-projection of the single-particle state |α⟩. The operators ˆc† and ˆc are the particle creation and annihilation operators, respectively.
- Parameters
orbitals (str) – Number of spin orbitals. If an active space is defined, this is the number of active spin-orbitals.
- Returns
the total spin projection observable ˆSz
- Return type
pennylane.Hamiltonian
- Raises
ValueError – If orbitals is less than or equal to 0
Example
>>> orbitals = 4 >>> print(spinz(orbitals)) ( -0.25 * Z(0) + 0.25 * Z(1) + -0.25 * Z(2) + 0.25 * Z(3) )