qdk_chemistry.plugins.qiskit.qubit_mapper module
Qiskit-based qubit mappers to map electronic structure Hamiltonians to qubit operators.
This module provides a QiskitQubitMapper class to convert Hamiltonians to QubitOperators using different mapping strategies (“jordan-wigner”, “bravyi-kitaev”, and “parity”).
- class qdk_chemistry.plugins.qiskit.qubit_mapper.QiskitQubitMapper[source]
Bases:
QubitMapperMap an electronic structure Hamiltonian to a QubitOperator using Qiskit.
This is a third-party backend: it reads
mapping.base_encodingto select the corresponding Qiskit Nature mapper class and ignoresmapping.table. The qubit operator is built from scratch using Qiskit Nature’s own fermion-to-qubit pipeline.Warning
Because this backend chooses its transform by encoding name rather than from the Pauli table, it relies on the mapping’s
base_encodingstring being consistent with its table. This is guaranteed for factory-produced mappings (MajoranaMapping.jordan_wigner(),.bravyi_kitaev(), etc.) and is verified by cross-backend eigenvalue tests in the test suite. Manually built mappings with mismatched names will produce silently incorrect results.Tapering-based encodings (e.g. parity two-qubit reduction) are supported — each backend handles tapering in its own
_run_impl()via theQubitMapper._taper_result()helper.Both restricted (RHF) and unrestricted (UHF) Hamiltonians are supported. For unrestricted systems, separate alpha and beta one-body and two-body integrals are forwarded to Qiskit Nature’s
ElectronicEnergy.- Supported base encodings:
"jordan-wigner"→qiskit_nature.second_q.mappers.JordanWignerMapper"bravyi-kitaev"→qiskit_nature.second_q.mappers.BravyiKitaevMapper"parity"→qiskit_nature.second_q.mappers.ParityMapper
Examples
>>> from qdk_chemistry.algorithms import create >>> from qdk_chemistry.data import MajoranaMapping >>> mapper = create("qubit_mapper", "qiskit") >>> mapping = MajoranaMapping.jordan_wigner(num_modes=n_spin_orbitals) >>> qh = mapper.run(hamiltonian, mapping)
- class qdk_chemistry.plugins.qiskit.qubit_mapper.QiskitQubitMapperSettings[source]
Bases:
QubitMapperSettingsSettings configuration for a QiskitQubitMapper.