How can I request the same set of qubits in running the same problem multiple times?
I'd like to run the same problem using exactly the same set of qubits between submissions. Is there a way that I can request, say, qubits 1-n? My understanding is that `EmbeddingComposite()` heuristically finds an embedding, and its manual counterparts allow one to specify the connectivity between qubits, but not the specific qubits in hardware.
Comments
If you use FixedEmbeddingComposite, you can specify the embedding, which is the mapping of BQM variables to actual qubits. If you don't have an embedding you can call minorminer.find_embedding directly with the source adjacency graph (BQM quadratic and linear terms) and the target adjacency graph (sampler edgelist) to get one.
Reusing an embedding is easy, just pass it to FixedEmbeddingComposite again.
If you want to specify qubits before generating an embedding, I can think of two options:
I have used method 1 before, but you have to be careful with how you prune. Find_embedding may have difficulty finding embeddings, and embedding and chain size can be much larger than if the entire sampler graph was available.
I have not used method 2, I only know about it from the docs. If I understood it correctly, you can specify chains for your BQM variables and the algorithm will try to fill the rest.
Hopefully someone more experienced with minorminer can comment on method 2, or propose something better altogether.
Thank-you for your help, Mike. One further, related question to anyone who might be able to answer is: can one specify for a given problem a certain 'connectivity' between qubits, and find an embedding to match this request? For example, say I wanted to map a problem to the four middle qubits of a unit cell, but I didn't care what unit cell the problem was embedded in. Is it as simple as using minorminer, using a specified edgelist? This would only work, I believe, in special cases.
I think it's possible, it just depends on if you can write a filter to remove edges with qubits that don't satisfy your requirements. If you only want your problem to be limited to certain qubits in any unit cell, then I believe it would be as simple as using minorminer with a specified edgelist. However, If you want each of your problem's variables to be contained in their own unit cell, I think you would have to check the embedding every time you receive one from minorminer.
Minorminer has a few chain tools that may be useful
You could use suspend_chains to place each of your problem variables in its own unit cell if you wanted. Let me know if you would like an example of any of these.
Please sign in to leave a comment.