qc2.algorithms.utils.mappers ============================ .. py:module:: qc2.algorithms.utils.mappers .. autoapi-nested-parse:: This module creates a wrapper around qiskit-nature mappers. Classes ------- .. autoapisummary:: qc2.algorithms.utils.mappers.FermionicToQubitMapper Module Contents --------------- .. py:class:: FermionicToQubitMapper .. py:attribute:: _mappers .. py:method:: register_mapper(key: str, mapper: qiskit_nature.second_q.mappers.QubitMapper) :classmethod: Register a new mapper class with a given key. :param key: The key (name) for the mapper. :type key: str :param mapper: The mapper class to be registered. :type mapper: QubitMapper :raises ValueError: If the key is already registered. **Example** >>> from qiskit_nature.second_q.mappers import TaperedQubitMapper >>> from qc2.algorithms.utils import FermionicToQubitMapper >>> >>> FermionicToQubitMapper.register_mapper('TQM', TaperedQubitMapper) >>> mapper = FermionicToQubitMapper.from_string('tqm') .. py:method:: from_string(s) :classmethod: Retrieve the mapper class corresponding to the provided string. :param s: The string identifier of the mapper. Case-insensitive. :type s: str :returns: The corresponding mapper class. :rtype: QubitMapper :raises ValueError: If the provided string does not correspond to any known mapper. **Example** >>> from qc2.algorithms.utils import FermionicToQubitMapper >>> mapper = FermionicToQubitMapper.from_string('jw'))