• Members 17 posts

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?

• Members 11 posts
• Members 12 posts

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)

• arrow_forward

Thread has been moved from Quantum Computing Software.