QubitMapper¶
- class QubitMapper[source]¶
Bases:
ABCThe interface for implementing methods which map from a
SparseLabelOpto a qubit operator in the form of aSparsePauliOp.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.
- Parameters:
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_lengthattribute of theSparseLabelOpbeing mapped. This is possible because theregister_lengthis considered a lower bound in aSparseLabelOp.
- Returns:
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.- Return type:
SparsePauliOp | List[SparsePauliOp | None] | Dict[str, SparsePauliOp]