Open
Description
Prerequisites
Before raising this issue, I have already checked that I am:
- running the latest version
- made sure that this issue has not already been filed
Describe the bug
Upon creating an instance of the NumberPartition problem with a 0
entry in the list, the problem is created with redundant qubit and terms. These terms then manifest as extra cost gates
with angle=0
.
To Reproduce
Steps to reproduce the behavior:
from openqaoa.problems import NumberPartition
np = NumberPartition([0,2,3,5,8])
np_qubo = np.qubo()
np_qubo.hamiltonian.expression
Expected behavior
The problem class should catch 0
in the list and raise a warning while removing the zero from the list, and create a problem with the remaining qubits.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.