Adding constraints to BQM model?

Is there easy way to add constraints to binary BQM (or Ising) after you have created it using parameters a (h) and b (J)?

I have a problem in which binary variables must not take certain combination of values.


Tomas Ukkonen

1

Comments

2 comments
  • I create individual Q matrices for each constraint for inspection and add them up to create a final "all baked in" qubo.

    0
    Comment actions Permalink
  • Hi Thomas,

    The code example here shows how to add constraint to an existing BQM using bqm.update(other_bqm) function.

    You can add in constraints to any existing BQM (QUBO or, Ising) but sometimes, you might end up accidently overwriting the existing constraints or objective (as seen here).

     

    Alternatively, as Mario suggested, you can build out the BQM for all the components (objective and constraints) and then combine them into one BQM.

    Here are some additional helpful resources on it:

     

    I hope this helps! 

    Please let me know if you have any questions.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post