ffsim.qiskit.jordan_wigner¶
- ffsim.qiskit.jordan_wigner(op, norb=None, *, tol=1e-12)[source]¶
Jordan-Wigner transformation.
Transform a fermion operator to a qubit operator using the Jordan-Wigner transformation. The Jordan-Wigner transformation maps fermionic annihilation operators to qubits as follows:
\[a_p \mapsto \frac12 (X_p + iY_p)Z_1 \cdots Z_{p-1}\]In the transformed operator, the first
norbqubits represent spin-up (alpha) orbitals, and the latternorbqubits represent spin-down (beta) orbitals. As a result of this convention, the qubit index that an orbital is mapped to depends on the total number of spatial orbitals. By default, the total number of spatial orbitals is automatically determined by the largest-index orbital present in the operator, but you can manually specify the number using thenorbargument.- Parameters:
op (
FermionOperator) – The fermion operator to transform.norb (
int|None) – The total number of spatial orbitals. If not specified, it is determined by the largest-index orbital present in the operator.tol (
float) – Terms with coefficients whose real and imaginary parts are smaller than this value will be discarded.
- Return type:
- Returns:
The qubit operator as a Qiskit SparsePauliOp.
- Raises:
ValueError – Number of spatial orbitals was negative.
ValueError – Number of spatial orbitals was fewer than the number detected in the operator.