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.

0

Comments

4 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:

    1. Prune the target(sampler) edgelist before passing it to find_embedding so it only contains qubits you want to use.
    2. Specify chains when calling find_embedding.

    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.

    2
    Comment actions Permalink
  • 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.

    1
    Comment actions Permalink
  • Minorminer has a few chain tools that may be useful

    • fixed_chains allows you to set up a partial fixed embedding that minorminer tries to fill in with your remaining source nodes
    • restrict_chains gives you find_embedding a bit more flexibility than the fixed_chains option, but still lets you specify a set of nodes you want a variable or chain to fit in
    • suspend_chains lets you distribute nodes from your source graph across different unit cells. 

    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.

    1
    Comment actions Permalink
  • 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. 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post