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

Large angles in QAOA algorithms using QuadraticProgram #398

Open
omarshehab opened this issue Jul 8, 2022 · 1 comment
Open

Large angles in QAOA algorithms using QuadraticProgram #398

omarshehab opened this issue Jul 8, 2022 · 1 comment

Comments

@omarshehab
Copy link
Contributor

Environment

  • Qiskit Optimization version: 0.2.3
  • Python version: 3.9.5
  • Operating system: Darwin

What is happening?

In the parametrized circuits for variational algorithms, the single qubit gate angles should be mod pi.

Job ID: 62b9ccb5e1377dc645097e3a . System: Hanoi. Line 101 of QASM is rz(-806806790.6729735) q[13];

Could anyone help me understand why the angle is so large? Shouldn't it be mod pi?

How can we reproduce the issue?

Check the code for job id 62b9ccb5e1377dc645097e3a on Hanoi.

What should happen?

The angle shouldn't be as big as -806806790.6729735. It should be mod pi.

Any suggestions?

No response

@Cryoris
Copy link
Contributor

Cryoris commented Nov 15, 2022

The possible parameter values depend on the optimizer you're using, and if it supports bounds there. In general it's difficult to set bounds because some optimizers might perform differently for different kinds of bounds (periodic, asymptotic, flat, ...) and you can change the sensitivity of the circuit parameters (e.g. RZ(x) vs RZ(1000 * x)).

If you want to restrict the parameter bounds in the optimization you could pass an optimizer with fixed bounds. We could also think about having Parameter objects that are bound to a certain region, where users could specify how the bounds are enforced -- unless there's only one clear way to do it 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants