-
Notifications
You must be signed in to change notification settings - Fork 132
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
LinearEqualityToPenalty converter: accept list of penalty terms as input #14
Comments
Can I work on this? |
Just to clarify, when the user provides a single value for penalty, should they use float or a a list with one float or it doesn't matter? |
Sure. If you can help us, that would be great. It doesn't matter that much, but just a single float seems more reasonable. |
I agree that single float is better. It will be then backwards compatible. I added the following code to
|
…of penalty terms (#1294) * now penalty can either be a single float (backward compatible) or a list of float that applies to linear constraints correspondingly * updated docstring for the change
Hey @a-matsuo @HassanNaseri could you guys take a look at qiskit-community/qiskit-aqua#1322? Thanks! |
@TDHTTTT @HassanNaseri |
@TDHTTTT @HassanNaseri |
Requested Feature
LinearEqualityToPenalty converter only accepts a single scalar input as penalty factor. Better results can be usually obtained by applying higher penalty factors to broken constraints. This requires LinearEqualityToPenalty to accept a list of penalty terms as input, including separate penalty factor for each constraint. If user provides none or a single value for penalty, the already existing process can be followed.
Why?
Once a solution is obtained, it is easy to evaluate the constraints and find the broken ones. Then the penalty terms for those broken constraints can be increased and the problem can be solved again. In the future, Qiskit may implement checking for broken constraints, but for time being this can be done by the user. Anyhow, having a list of penalties as input is mandatory for any iterative tuning.
The text was updated successfully, but these errors were encountered: