Mapper¶
- class zixy.fermion.Mapper(qubits: int | Qubits, mode_ordering: Sequence[int] | None = None)[source]¶
Bases:
objectBase class for fermion to qubit mappers.
- __init__(qubits: int | Qubits, mode_ordering: Sequence[int] | None = None)[source]¶
Initialize the mapper.
- Parameters:
qubits – The qubits, or number thereof.
mode_ordering – The ordering of the modes with respect to the qubits. If
None, the modes are ordered in the same way as the qubits.
- encode(fermion_string: String[Any, Any, Any], coeff: complex = 1.0) ComplexTermSum[source]¶
Encode a fermionic string to qubit operators.
- Parameters:
fermion_string – The fermionic string to encode.
coeff – A factor to multiply the encoded string by.
- Returns:
The encoded linear combination of qubit Pauli strings.
- encode_complex(fermion_string: String[Any, Any, Any], coeff: complex = 1.0) ComplexTermSum[source]¶
Encode a fermionic string to complex qubit operators.
- Parameters:
fermion_string – The fermionic string to encode.
coeff – A complex factor to multiply the encoded string by.
- Returns:
The encoded linear combination of complex qubit Pauli strings.
- encode_real(fermion_string: String[Any, Any, Any], coeff: float = 1.0) RealTermSum[source]¶
Encode a fermionic string to real qubit operators.
- Parameters:
fermion_string – The fermionic string to encode.
coeff – A real factor to multiply the encoded string by.
- Returns:
The encoded linear combination of real qubit Pauli strings.
- impl_type: type[JordanWignerMapper] | type[BravyiKitaevMapper] | type[ParityMapper] | type[ParaparticularMapper]¶