qiskit-optimization icon indicating copy to clipboard operation
qiskit-optimization copied to clipboard

Auto adjustment of `GroverOptimizer.num_value_qubits`

Open t-imamichi opened this issue 4 years ago • 5 comments

What is the expected enhancement?

If GroverOptimizer.num_value_qubits is too small, it may result in an infinite loop due to overflow. It would be great if

  1. GroverOptimizer adjusts a sufficient value of num_value_qubits automatically, and/or
  2. GroverOptimizer raise a warning message if num_value_qubits is too small.

t-imamichi avatar Apr 28 '21 08:04 t-imamichi

@t-imamichi I went into this issue and I'm interested in fixing this. Could you tell me what too small means? Is there a paper or we should experiment with choosing this value?

iuliazidaru avatar Apr 29 '21 07:04 iuliazidaru

Thank you for having an interest in this issue. Here is the tutorial of GroverOptimizer. https://qiskit.org/documentation/optimization/tutorials/04_grover_optimizer.html I have no idea how to fix this issue currently. It might be difficult.

t-imamichi avatar Apr 29 '21 08:04 t-imamichi

Thank you for your answer. I'm creating some experiments and let you know about the results.

iuliazidaru avatar Apr 29 '21 10:04 iuliazidaru

It looks like num_value_qubits can be set starting with 1 and the algorithm works. The right solution is not always found. When increasing it the execution time starts to increase. It may get to a point when it get's disconnected in Jupyter output ( It happens that the result is there but the cell is still in running mode. I stopped the cell and the result appeared). I attach some tests.

grover_research.ipynb.txt

@t-imamichi Do you have a specific example for num_value_qubits too small?

iuliazidaru avatar May 05 '21 10:05 iuliazidaru

For example, if you set num_values_qubits smaller in the unit test, it does not pass. https://github.com/Qiskit/qiskit-optimization/blob/6a7642d84e43c5a33c60630363633905992f8cc7/test/algorithms/test_grover_optimizer.py#L194

t-imamichi avatar May 06 '21 12:05 t-imamichi