JordanWignerMapper

class zixy.fermion.JordanWignerMapper(qubits: int | Qubits, mode_ordering: Sequence[int] | None = None)[source]

Bases: Mapper

Jordan–Wigner fermion to qubit mapper.

__init__(qubits: int | Qubits, mode_ordering: Sequence[int] | None = None)

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

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

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

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

alias of JordanWignerMapper

qubits: Qubits