quantum_launcher.utils#
Summary#
Functions:
Convert a QUBO into a quadratic Hamiltonian in the form of a SparsePauliOp. |
Reference#
- quantum_launcher.utils.qubo_to_hamiltonian(qubo: Iterable[Iterable[int]] | Dict[Tuple[str, str], float], offset: float = 0) SparsePauliOp [source]#
Convert a QUBO into a quadratic Hamiltonian in the form of a SparsePauliOp.
- Parameters:
qubo (Iterable[Iterable[int]] | Dict[Tuple[str, str], float]) – Quadratic Unconstrained Binary Optimization written in the form of matrix or dictionary[Tuple[key, key], value].
offset (float, optional) – The offset (constant) value that will be added to identity. Defaults to 0.
- Returns:
_description_
- Return type:
SparsePauliOp