How to create Ising Hamiltonian and implement it with qiskit (the output should be in the form of WeightedPauliOperator
) for the following problem:
$$ H = A \big(K - \sum_{i}^{N} t_i x_i \big)^2\\ x_i=\{0,1\}\\ t_i \in \mathbb{N}_{>0}\\ K\in \mathbb{N}\\ A \in \mathbb{R}_{>0}\\ $$
I want to choose any number of variables $x_i$, that the sum $\sum_{i}^{N} t_i x_i$ will equal exactly $K$.