qiskit-optimization
qiskit-optimization copied to clipboard
Large angles in QAOA algorithms using QuadraticProgram
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
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 🙂