EntangledQuery
  • Threads
  • Categories
  • Users
  • Seminar
  • forum
  • group
  • theaters
  • search
  1. Threads
  2. Qiskit
chevron_left Qiskit

How to formulate a problem with integer portfolio output in Qiskit PortfolioOptimization

  • forum 2 replies
  • last reply by Meng Nov. 2, 2021
  • Last
  • link
    CattyM
    Members 17 posts
    Nov. 1, 2021, 4:31 a.m. Nov. 1, 2021, 4:31 a.m.
    link

    I know by default quadratic program defined by PortfolioOptimization in qiskit has binary portfolio output, i.e. x_i's are defined as binaries indicating whether to select a certain option. If it is allowed to select more than one time for every option, i.e. x_i's are integers, how do I formulate this problem in PortfolioOptimization?

  • link
    eltonjohn007
    Members 11 posts
    Nov. 1, 2021, 10:20 a.m. Nov. 1, 2021, 10:20 a.m.
    link

    This can be specified by the argument bounds. See github.com/Qiskit/qiskit-finance/blob/main/qiskit_finance/applications/optimization/portfolio_optimization.py.

    However, this is a very simplified example. In reality, very few people optimize portfolios with binary/a few discrete choices of weights.

  • link
    SchrodingersMouse
    Members 12 posts
    Nov. 1, 2021, 10:22 a.m. Nov. 1, 2021, 10:22 a.m.
    link

    You can use the bounds parameter of PortfolioOptimization. By default, bounds = None, which assume that all variables x_i are binaries.

    If you want to release the constrain, you can set bounds = [(x_1_min, x_1_max), (x_2_min, x_2_max), ...] where x_i_max/x_i_min is the upper/lower bound of x_i, and the length of the list has to equal to the number of variable. If all variables share the same upper bound, you can simplify the input as bounds = [(x_lower_bound, x_upper_bound)] * num_variable.

    Example:

    x_lower_bound = 0
    x_upper_bound = budget
    num_variable = 4
    portfolio = PortfolioOptimization(expected_return, covariance, risk_factor, budget, bounds=[(x_lower_bound, x_upper_bound)] * num_variable)
    

    johnzl and JackSong like this.

    favorite 2

  • arrow_forward

    Thread has been moved from Quantum Computing Software.

    • By Meng on Nov. 2, 2021, 1:40 p.m..

There are no more posts in this thread.

  • EntangledQuery