# Does LeapHybridCQMSampler using Integer Variable give answer as negative valued Integer?

Hello D-wave Users!

I am new to D-wave and enjoying using D-wave.

I am solving some CQM problem with LeapHybridCQMSampler.

Variable as 4 Integer, I[0] I[1] I[2] I[3]

objective function with linear summation and constraints with quadratic form summation of those variables above.

Constraint is inequality( e.g summation of quadratic form <= constant ).

I found out that D-wave solver only gives me answer with positive valued integers. But as i solve this with other solvers( used convex optimization) it gives me some negative valued integers and if i add the constraints Variables to be greater than 0 the results are the same in D-wave solver.

Since i haven't found any statement that CQM Integer variable type doesn't work for negative valued integer(or maybe i missed it, if so please let me know ), I guess there is something wrong in my code.

Please help.

Thank you for reading.

## Comments

David J(Report)Hello,

Are you able to provide a simple code example of how you are formulating the problem and the results you are seeing? We are just looking into this question, but we will likely need more information to give more of a definitive answer.

David J(Report)If you are using symbolic variables, the

Integervariable has a default lower bound of0which would explain this behaviour.Here is a link to the documentation for your convenience:

https://docs.ocean.dwavesys.com/en/stable/docs_dimod/reference/generated/dimod.quadratic.Integer.html#dimod.quadratic.Integer

See also:

https://github.com/dwavesystems/dimod/blob/472a92d32975e6cd18c3ff433108b5ac1b8ca4da/dimod/constrained.py#L698

David J(Report)Hello,

The

Problem Solving Handbook, particularly theStating the Problemand theReformulating a Problemsections might be helpful:https://docs.dwavesys.com/docs/latest/doc_handbook.html

Basically, being able to formulate the constraint as a QUBO problem is the main objective.

lee s(Report)Thank you for your valuable answer :)

Have a nice day.

lee s(Report)Thanks for your help.

Setting lower bound negative makes code work the way i intended.

I appreciate it!

By the way, i was trying to understand more fundamental principles about how CQM works(How classical computer reformulate CQM to the problem that D-wave understands and embed it in to Q-bit). More deeper than the doc on D-Wave Ocean Software Documentation or d-wave resource library on homepage. If possible could you recommend some good source(maybe some published papers) that i can refer about how CQM is solved in D-wave?

Thank you for reading :)

Please sign in to leave a comment.