I am running vqe algorithm in qasm_simulator and cannot get the optimal solution. Are there any methods for finding the optimal value of depth for variational form and max_iter for optimizer parameters? What exactly does the depth parameter?
Depth is the number of repetitions of the basic circuit of the variational form. By adding more repetitions the expectation is that it can cover a larger part of the Hilbert space and hopefully include the solution space that a shallower one could not. Now each basic circuit has parameters so it can be varied. Adding more repetitions adds more parameters and results in a larger parameter space for the optimization which thus can get more difficult for the optimizer as it increases.
max_trials is used by SPSA that you are using. You may need to increase this number to allow the optimizer enough to find a minimum. SPSA will always go to that limit before returning.
I take it the solution is found ok on a state_vector simulator, its just when you try qasm simulator that you are having difficulty finding the solution.