-
Notifications
You must be signed in to change notification settings - Fork 124
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
markf94
wants to merge
38
commits into
rigetti:master
Choose a base branch
from
ProteinQure:embedding_clean2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tbabej
force-pushed
the
embedding_clean2
branch
2 times, most recently
from
March 30, 2018 06:28
8df89b8
to
e5edf57
Compare
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)
tbabej
force-pushed
the
embedding_clean2
branch
from
March 30, 2018 06:42
e5edf57
to
d8d92ce
Compare
markf94
force-pushed
the
embedding_clean2
branch
from
April 9, 2018 03:30
704e49a
to
d8d92ce
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR depends on PR #141 and implements the following changes:
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 dictionaryRequires PR #373 to be accepted in pyquil in order for all tests to pass. (rigetti/pyquil#373)