# 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 I I I

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.

• 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.

• If you are using symbolic variables, the Integer variable has a default lower bound of 0 which would explain this behaviour.
https://github.com/dwavesystems/dimod/blob/472a92d32975e6cd18c3ff433108b5ac1b8ca4da/dimod/constrained.py#L698

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?

• Hello,

The Problem Solving Handbook, particularly the Stating the Problem and the Reformulating a Problem sections 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.