qiskit-community / qiskit-aqua

Quantum Algorithms & Applications (**DEPRECATED** since April 2021 - see readme for more info)
https://qiskit.org/aqua
Apache License 2.0
572 stars 376 forks source link

MaxCut VQE does not equal ExactEigen #13

Closed nonhermitian closed 6 years ago

nonhermitian commented 6 years ago

Expected Behavior

Modifying the MaxCut tutorial to have larger dimension, N=10, results in different answers for the VQE and ExactDiagonal solvers.

Current Behavior

For

w = array([[ 0.,  8.,  0.,  0.,  9.,  0., -8.,  0.,  0., -4.],
       [ 8.,  0.,  0.,  0.,  0.,  0., -5.,  0.,  5.,  9.],
       [ 0.,  0.,  0., -8.,  0.,  0., -8.,  0.,  0.,  0.],
       [ 0.,  0., -8.,  0.,  0.,  0.,  0.,  6., -8.,  0.],
       [ 9.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [-8., -5., -8.,  0.,  0.,  0.,  0.,  0.,  0., -3.],
       [ 0.,  0.,  0.,  6.,  0.,  0.,  0.,  0., -2.,  0.],
       [ 0.,  5.,  0., -8.,  0.,  0.,  0., -2.,  0.,  0.],
       [-4.,  9.,  0.,  0.,  0.,  0., -3.,  0.,  0.,  0.]])

I get ExactEigenSolver:

energy: -34.5
maxcut objective: -30.0
solution: [0. 1. 0. 0. 1. 1. 0. 1. 0. 0.]
solution objective: 30.0

where as VQE gives:

energy: -19.499999887119802
time: 638.5913169384003
maxcut objective: -14.999999887119802
solution: [1. 1. 1. 1. 0. 1. 1. 0. 1. 0.]
solution objective: 15.0

Possible Solution

Steps to Reproduce (for bugs)

Try tutorial with above graph.

Context

Wanted to make a slide highlighting this feature

Your Environment

OSX, Py36, latest Acqua

jaygambetta commented 6 years ago

@pistoia please look but it mostly depends on the classical parameters.

chunfuchen commented 6 years ago

For a large graph, the default VQE parameters might not work correctly since the Ising Hamiltonian becomes larger when the graph grows. To get the correct answer, you need to increase the depth of variational form I think.

nonhermitian commented 6 years ago

It there a way of knowing that without having to compare against the exact diagonalization? How do I know if my variational form is suitable for solving a guven graph size? Seems knowing this is critical for doing problems of non-trivial size.

jaygambetta commented 6 years ago

i agree and that is the research that needs to be done. Are there better trial functions? How does it scale. My belief is that for these optimization problems and vqe this may not be a positive outcome (see https://arxiv.org/abs/1805.12037).

chunfuchen commented 6 years ago

closed because the setting for large graph should be changed.