TaperedQubitMapper#
- class TaperedQubitMapper(mapper, z2symmetries=<qiskit.quantum_info.analysis.z2_symmetries.Z2Symmetries object>)[source]#
Bases:
QubitMapper
The wrapper around qubit mappers implementing the logic to reduce the size of a problem (operator) based on mathematical
Z2Symmetries
that can be automatically detected in the operator.The following attributes can be read and updated once the
TaperedQubitMapper
object has been constructed.- mapper#
Object defining the mapping of second quantized operators to Pauli operators.
- z2symmetries#
Symmetries to use to reduce the Pauli operators.
- প্যারামিটার:
mapper (QubitMapper) --
QubitMapper
object implementing the mapping of second quantized operators to Pauli operators.z2symmetries (Z2Symmetries) --
Z2Symmetries
object defining the symmetries to use to reduce the Pauli operators.
- রেইজেস:
ValueError -- If the input mapper is already a
TaperedQubitMapper
.
Methods
- map(second_q_ops, *, register_length=None)[source]#
Maps a second quantized operator or a list, dict of second quantized operators based on the current mapper.
- প্যারামিটার:
second_q_ops (SparseLabelOp | List[SparseLabelOp | None] | Dict[str, SparseLabelOp]) -- A second quantized operator, or list thereof.
register_length (int | None) -- when provided, this will be used to overwrite the
register_length
attribute of theSparseLabelOp
being mapped. This is possible because theregister_length
is considered a lower bound in aSparseLabelOp
.
- রিটার্নস:
A qubit operator in the form of a
SparsePauliOp
, or list (resp. dict) thereof if a list (resp. dict) of second quantized operators was supplied.- রিটার্ন টাইপ:
SparsePauliOp | None | List[SparsePauliOp | None] | Dict[str, SparsePauliOp | None]
- map_clifford(second_q_ops, *, register_length=None)[source]#
Maps a second quantized operator or a list, dict of second quantized operators based on the internal mapper. Then, composes all mapped pauli operators with the clifford operations defined by the internal
Z2Symmetries
to prepare for the symmetry reduction. This composition gives isospectral operators and exposes redundant qubits for later tapering.- প্যারামিটার:
second_q_ops (SparseLabelOp | List[SparseLabelOp | None] | Dict[str, SparseLabelOp]) -- A second quantized operator, or list (resp. dict) thereof.
register_length (int | None) -- when provided, this will be used to overwrite the
register_length
attribute of the operator being mapped. This is possible because theSparseLabelOp. (register_length is considered a lower bound in a) --
- রিটার্নস:
A qubit operator in the form of a
SparsePauliOp
, or list (resp. dict) thereof if a list (resp. dict) of second quantized operators was supplied.- রিটার্ন টাইপ:
SparsePauliOp | List[SparsePauliOp | None] | Dict[str, SparsePauliOp]
- classmethod mode_based_mapping(second_q_op, register_length=None)#
Utility method to map a
SparseLabelOp
to a qubit operator using a pauli table.- প্যারামিটার:
second_q_op (SparseLabelOp) -- the SparseLabelOp to be mapped.
register_length (int | None) -- when provided, this will be used to overwrite the
register_length
attribute of the operator being mapped. This is possible because theregister_length
is considered a lower bound.
- রিটার্নস:
The qubit operator corresponding to the problem-Hamiltonian in the qubit space.
- রেইজেস:
QiskitNatureError -- If number length of pauli table does not match the number of operator modes, or if the operator has unexpected label content
- রিটার্ন টাইপ:
- classmethod pauli_table(register_length)#
Generates a Pauli-lookup table mapping from modes to pauli pairs.
The generated table is processed by
QubitMapper.sparse_pauli_operators()
.- প্যারামিটার:
register_length (int) -- the register length for which to generate the table.
- রিটার্নস:
A list of tuples in which the first and second Pauli operator the real and imaginary Pauli strings, respectively.
- রিটার্ন টাইপ:
list[tuple[qiskit.quantum_info.operators.symplectic.pauli.Pauli, qiskit.quantum_info.operators.symplectic.pauli.Pauli]]
- classmethod sparse_pauli_operators(register_length)#
Generates the cached
SparsePauliOp
terms.This uses
QubitMapper.pauli_table()
to construct a list of operators used to translate the second-quantization symbols into qubit operators.- প্যারামিটার:
register_length (int) -- the register length for which to generate the operators.
- রিটার্নস:
Two lists stored in a tuple, consisting of the creation and annihilation operators, applied on the individual modes.
- রিটার্ন টাইপ:
tuple[list[qiskit.quantum_info.operators.symplectic.sparse_pauli_op.SparsePauliOp], list[qiskit.quantum_info.operators.symplectic.sparse_pauli_op.SparsePauliOp]]
- taper_clifford(pauli_ops, *, check_commutes=True, suppress_none=True)[source]#
Applies the symmetry reduction on a
SparsePauliOp
or a list (resp. dict). This method implies that the second quantized operators were already mapped to Pauli operators and composed with the clifford operations defined in the symmetry, for example using themap_clifford
method.- প্যারামিটার:
pauli_ops (SparsePauliOp | List[SparsePauliOp | None] | Dict[str, SparsePauliOp]) -- A pauli operator already evolved with the symmetry clifford operations.
check_commutes (bool) -- If the commutativity of operators with symmetries must be checked before any calculation.
suppress_none (bool) -- If None should be placed in the output list where an operator did not commute with symmetry, to maintain order, or whether that should be suppressed where the output list length may then be smaller than the input.
- রিটার্নস:
A qubit operator in the form of a
SparsePauliOp
, or list (resp. dict) thereof if a list (resp. dict) of second quantized operators was supplied.- রিটার্ন টাইপ:
SparsePauliOp | None | List[SparsePauliOp | None] | Dict[str, SparsePauliOp | None]