qubo_to_ising¶
- qubo_to_ising(qubo, *, hamiltonian_builder='native', quadratization_strength=None)[source]¶
Convert a QUBO/HUBO to a cleaned Ising Hamiltonian.
Normalizes the input, converts via the selected Ising converter, cleans constant terms, and validates the result.
- Parameters:
qubo – QUBO dict, HUBO dict, numpy matrix, BQM, or BinaryPolynomial.
hamiltonian_builder (
Literal['native','quadratized']) –"native"or"quadratized".quadratization_strength (
float|None) – Penalty for quadratization.None(default) picks an adaptive strength2 * max(|hubo coeff|)so the penalty dominates the objective for arbitrary problem scales — seeQuadratizedIsingConverter. Ignored whenhamiltonian_builder="native".
- Return type:
- Returns:
IsingResultwith cost Hamiltonian, loss constant, qubit count, and full Ising encoding.- Raises:
ValueError – If the Hamiltonian contains only constant terms.