LogarithmicMapper#
- class LogarithmicMapper(*, padding=1, embed_upper=True)[source]#
Bases:
SpinMapper
A mapper for Logarithmic spin-to-qubit mapping. In this local encoding transformation, each individual spin S system is represented via the lowest lying \(2S+1\) states in a qubit system with the minimal number of qubits needed to represent \(>= 2S+1\) distinct states [1].
References
[1] S. V. Mathis, G. Mazzola and I. Tavernelli. Toward scalable simulations of lattice gauge theories on quantum computers. Phys. Rev. D, 102 (9), 094501 (2020). https://doi.org/10.1103/PhysRevD.102.094501
- প্যারামিটার:
padding (float) -- When embedding a matrix into the upper/lower diagonal block of a \(2^n\) by \(2^n\) matrix ,where \(n\) is the number of qubits, pads the diagonal of the block matrix with the value of
padding
.embed_upper (bool) --
This parameter sets whether the given matrix is embedded in the upper left hand corner or the lower right hand corner of the larger matrix. I.e. using
embed_upper
= True returns the matrix:\[\begin{split}\begin{pmatrix} \text{matrix} & 0 \\ 0 & \text{padding} * I \end{pmatrix}\end{split}\]Using embed_upper = False returns the matrix:
\[\begin{split}\begin{pmatrix} \text{padding} * I & 0 \\ 0 & \text{matrix} \end{pmatrix}\end{split}\]
Methods
- map(second_q_ops, *, register_length=None)#
Maps a second quantized operator or a list, dict of second quantized operators based on the current mapper.
- প্যারামিটার:
second_q_ops (SpinOp | List[SpinOp | None] | Dict[str, SpinOp]) -- 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 | 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]]