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

removing old :AMPLITUDE initarg references in qvm-app #221

Merged
merged 3 commits into from
Dec 12, 2019

Conversation

sophiaponte
Copy link
Contributor

@sophiaponte sophiaponte commented Dec 10, 2019

Before the qvm state representation refactor, :AMPLITUDES was an initarg for the different QVM classes to store the wavefunction data of a qvm. This functionality is now replaced by the QVM's STATE, and :AMPLITUDES is no longer a valid initarg for any QVM. This PR changes the QVM-APP to call the :STATE initarg instead of the :AMPLITUDES initarg when make-instanceing a QVM.

This could possibly be more cleanly fixed by having more elegant make-xxx-qvm functions that can take pre-allocated amplitudes as arguments for the different types of QVMs. Since these functions do not exist, the QVM-APP uses make-instance when creating a QVM with an already allocated amplitudes vector.

@sophiaponte sophiaponte requested a review from a team as a code owner December 10, 2019 00:44
@sophiaponte sophiaponte changed the title removing old references :AMPLITUDE initarg references in qvm-app removing old :AMPLITUDE initarg references in qvm-app Dec 10, 2019
@sophiaponte
Copy link
Contributor Author

This addresses #220. I re-ran the pyquil tests with the qvm in server mode on this branch, and the errors @appleby reported seem to be fixed.

Copy link
Contributor

@appleby appleby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question about finalizers; otherwise lgtm

Copy link
Contributor

@jmbr jmbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

However, I'd like to point out that the use of the generic function and the keyword argument named num-qubits (in the initialize-instances of state-representation.lisp) is inconsistent with the use of number-of-qubits throughout the rest of the qvm. I'd like to have a consistent interface for that at some point.

Copy link
Member

@notmgsk notmgsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. See @appleby's comments, however.

@stylewarning stylewarning merged commit 0dd2132 into master Dec 12, 2019
@stylewarning stylewarning deleted the bugfix/qvm-app-allocation-initarg branch December 12, 2019 23:00
@notmgsk notmgsk mentioned this pull request Dec 18, 2019
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.

5 participants