Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning if 0 is passed in numbers_list in NumberPartition problem #209

Open
2 tasks done
vishal-ph opened this issue Mar 21, 2023 · 1 comment
Open
2 tasks done
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@vishal-ph
Copy link
Collaborator

vishal-ph commented Mar 21, 2023

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.

@vishal-ph vishal-ph added enhancement New feature or request good first issue Good for newcomers unitary_fund A feature supported by an UF grant and removed unitary_fund A feature supported by an UF grant labels May 17, 2023
@lumapools
Copy link

Hi, I just created a PR that handles this issue. Could a maintainer please assign me to this ?
(I had to close the previous PR as it contained a different not-yet-merged PR modifications)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants