qiskit.optimization.applications.ising.partition¶
Generate Number Partitioning (Partition) instances, and convert them into a Hamiltonian given as a Pauli list.
Functions
|
Construct the Hamiltonian for a given Partition instance. |
|
Compute the value of a partition. |
- get_operator(values)[source]¶
Construct the Hamiltonian for a given Partition instance.
Given a list of numbers for the Number Partitioning problem, we construct the Hamiltonian described as a list of Pauli gates.
- Parameters
values (numpy.ndarray) – array of values.
- Returns
operator for the Hamiltonian and a constant shift for the obj function.
- Return type
tuple(WeightedPauliOperator, float)