Annealing returns too many variables.

I'm running into an issue with running an annealing problem on DWave hardware. My code looks something like

sampler = DWaveSampler()
solver = EmbeddingComposite(sampler)
response = solver.sample(qubo_instance)

where qubo_instance is of type dimod.BinaryQuadraticModel, and I have confirmed that it has 42 variables in the instance that I am testing. In response, however, the Samples returned by the API have 159 variables. I have no idea where the extra 117 variables came from, what they represent, or how to eliminate them.

0

Comments

3 comments
  • Hello,

    Would it be possible to provide a minimal example of your code that can be run and show the variables in question printed out in the input and output? It's important to understand exactly how and where you are seeing this information, as often there are intermediate steps that don't generally show up in the samplesets or results at the end.

    I have a feeling they might be slack variables or chain qubits, but it's difficult to say without having an explicit code example to examine.

    This page has some information on slack variables:
    https://docs.dwavesys.com/docs/latest/handbook_reformulating.html#constraints-linear-inequality-penalty-functions

    This page explains chains:
    https://docs.dwavesys.com/docs/latest/c_gs_7.html?highlight=chains#chains

    It's possible you might be seeing something else, but hopefully these give you some more insight into where variables are introduced.

    0
    Comment actions Permalink
  • Hey David,

    Providing a minimal example of my code that can be run would be a bit difficult. I'm constructing a BQM by explicitly constructing the matrix and vector, and the code for that is quite complicated. The issue here is almost certainly not slack variables, as the only slack variables in the problem should be those that I explicitly introduced in my construction of the BQM. I suspect that the issue is the chain qubits, specifically that unembedding is not occurring. Despite that, I'm not sure what might cause unembedding to not occur. If the minor embedding were performed manually I would understand unembedding not happening automatically, but since the minor embedding here is being done automatically, I don't understand why the unembedding is not occurring.

    0
    Comment actions Permalink
  • Hello,

    We would need some kind of reproduction steps in order to know: what exactly you are seeing, how you are producing it with your code, what the variables look like, etc.
    It might be possible to take your code and cut out the middle section with all of the problem formulation, use some test data values (i.e. all 1s or some pattern of 0s and 1s), and check the output has similar extra variables showing up.
    Otherwise the best we can do is to give more general advice, such as making sure you are inputting the values you expect and the output is the expected format, etc.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post