Skip to content

[Feature Request] Add XQCP support for XQMXDomain.DISCRETE #1

Description

@Vincent-Djaja

Summary

Please add support for XQMXDomain.DISCRETE in the XQCP layer.

Motivation

I am using XQCP to formulate a portfolio-rebalancing optimisation problem. Each asset has a bounded discrete portfolio weight, such as an integer value from 0 to SCALE, rather than only a binary decision.

Currently, I need to encode each weight using multiple binary variables. Binary or thermometer encoding increases the number of variables and QUBO interactions significantly, especially when the portfolio contains many assets.

Direct discrete-variable support would allow the portfolio model to represent one discrete weight variable per asset more naturally and efficiently.

Intended usage

Conceptually, I would like to be able to define a model similar to:

from xqcp import Problem
from xqvm_py import XQMXDomain

problem = Problem("PortfolioRebalancing")
problem.define_model(
    size=number_of_assets,
    domain=XQMXDomain.DISCRETE,
)

The discrete variables would need either:

  • An integer range, such as 0..SCALE; or
  • An explicitly supplied set of permitted values.

For the portfolio model, the weights would also be constrained to sum to SCALE.

Desired behaviour

It would be helpful if XQCP could:

  1. Compile models using XQMXDomain.DISCRETE.
  2. Allow the permitted range or values to be specified.
  3. Generate appropriate encoder, verifier and decoder programs.
  4. Pass the resulting discrete model to compatible XQSA solver backends.
  5. Include a small example demonstrating discrete variables.

I am happy to test an implementation branch using my portfolio-rebalancing model and report any problems.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions