Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New 'embedding' argument for QAOA #143

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

markf94
Copy link
Contributor

@markf94 markf94 commented Mar 30, 2018

This PR depends on PR #141 and implements the following changes:

  • new QAOA argument embedding which is a way of mapping the logical problem to the QPU hardware graph. One maps each logical qubit to a physical qubit of choice by means of a dictionary
  • new QAOA function unembed_problem() which applies the inverse embedding in order to return the correct solution string (in get_string()
  • added extensive documentation to Read the Docs

Requires PR #373 to be accepted in pyquil in order for all tests to pass. (rigetti/pyquil#373)

@markf94 markf94 changed the title New 'embedding' New 'embedding' argument for QAOA Mar 30, 2018
@tbabej tbabej force-pushed the embedding_clean2 branch 2 times, most recently from 8df89b8 to e5edf57 Compare March 30, 2018 06:28
markf94 and others added 27 commits March 30, 2018 02:42
Ising instances can have many variables but almost no bias terms
so a dictionary is naturally a better choice in order to account
for sparse bias vectors
Ising instances can make use of arbitrary qubits
especially when we have to map to a QPU hardware
graph. Makes much more sense to extract the qubit
indices and compute n_nodes like this.
allows for user-defined mixer/driver hamiltonian
in order to enforce hard constraints
tests & docs also updated
added extensive documentation for the Ising QAOA wrapper
added images
added ising_qaoa to index.rst
added extensive documentation for the Ising QAOA wrapper
added images
added ising_qaoa to index.rst
the embedding dictionary is a great tool for QPU
users since it allows a manual mapping to the hardware

using the ``embedding`` one can avoid dead qubits and choose
the qubits with the best specs for execution
accomodating for the new ``embedding`` argument in
the QAOA class. the embedding removes the need for
qubit_indices
QAOA solution string must be unembedded since it will
be ordered by indices in the logical space
in order to get the correct wavefunction for analysis we need
to get the correct number of states. if we shift qubits 0,1 to
qubits 4,5 then we have 2**5 possible states in terms of the
wavefunction (most of them will be uninteresting to us)
in a seperate pull request to the pyquil repo we will
propose to remove this sequence of gates that implement
the identity operation. First of all, the operation is superfluous
and second of all it messes up the wavefunction calculation since
qubit 0 was hardcoded to always be used for this sequence of gates.
It becomes a problem if we embedded our problem on qubit 3,4 and want
to get the wavefunction since it will always try to involve qubit 0.
doing it this way removes the need for code
repetition in maxcut_qaoa, ising_qaoa and so on.
this way we handle the unembedding logic in the
get_string() method and make it much easier to use
for the user.
included support for argument change from n_qubits
to qubits (list)
Adding measurement instructions and then running with measure_and_run
makes all trials sample the same state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants