qiskit-optimization
qiskit-optimization copied to clipboard
The tutorial of converters needs to explain how solutions are interpreted
What is the expected enhancement?
The tutorial of converters explains how we apply convert only.
But, it is also important how we interpret solutions from the converted problem to the original problem.
Moreover, we need to explain that users don't need to use converters manually in most cases and the algorithms apply converters properly.
https://qiskit.org/documentation/optimization/tutorials/02_converters_for_quadratic_programs.html
Somewhat related, it would also be very nice if the documentation explained any special considerations to consider when choosing the order in which to apply multiple converters. For instance, in the constructor to QuadraticProgramToQubo:
https://github.com/Qiskit/qiskit-optimization/blob/d3bcf30941010068dc89031bb0a2cd5bc1835b7c/qiskit_optimization/converters/quadratic_program_to_qubo.py#L48-L56
Is there any particular reason that IntegerToBinary is before LinearEqualityToPenalty yet is after LinearInequalityToPenalty and InequalityToEquality?
(Ideally, there should also be a comment at that location in the code to explain why the above order makes sense there.)
Hello @t-imamichi, @garrison, is this issue still open? Do you think I can help with this? I am new to open source contributions, I have only raised 1 pull request so far. I found this to be an interesting issue since I would myself like to understand the topics you have mentioned. Once I understand, I can document these, but let me know if it's too soon to try this, given my less experience with open source. If I can take this up and then, if I get stuck in understanding something, I hope I can discuss it here.
@gprs1809 Thank you for your interest in this project. Are you familiar with Qiskit optimization? This issue requires the knowledge of the internals of Qiskit optimization to write details in the tutorial.
@garrison Sorry to forget to reply to your question. IntegerToBinary should come after all integer variables are defined. Since InequalityToEquality introduces integer slack variables, InequalityToEquality should be called before IntegerToBinary.
I agree that we should write such conditions in the tutorial and/or the source code comments.
@t-imamichi , I have used Qiskit optimization, but I can't say I am familiar with its internals yet. I definitely would like to dive deeper into the details of the internals of Qiskit optimization. I think I am well versed with python, but I am very new to open source. If you could guide me on how I can do this, it would be really great, but let me know if I can even take this up?
You can work on it if you wish. I suggest checking out the guide first and investigate the details of interpret.
Hello @t-imamichi , I worked on this issue and have raised a pull request: https://github.com/Qiskit/qiskit-optimization/pull/378. As you said, it required being familiar with the internals of qiskit-optimization. So I looked into the source codes and it was a great learning experience. Let me know if everything looks okay. If you think I can change something, please let me know, I would like to make sure I make the changes as expected.
done by #378