we tried running the Portfolio Optimization code using qiskit with the optimizer:Sequential Least SQuares Programming optimizer.

FOr 10 stocks, it ran fine, For, 21 stocks it hung up. COuld anyone suggest why so?

  • $\begingroup$ what do you mean hang up, are there any error pop up. $\endgroup$
    – poig
    Jun 23 at 20:25
  • 1
    $\begingroup$ What's up with weird capitalization and overall bad formatting? You should provide more details about your problem. $\endgroup$
    – MonteNero
    Jun 24 at 3:26

1 Answer 1


For 10 stocks it uses a less number of qubits than for the 21 stocks. Try to get the number of variables your model is using , by get_num_var , and then use the appropriate backend for it to run. There are many quantum simulators provided by IBM, ranging from 32 qubits to 5000 qubits.

New contributor
Another Random Guy is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.