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

Handful of MAKE-INSTANCE calls still using old :AMPLITUDES initarg #220

Closed
appleby opened this issue Dec 9, 2019 · 1 comment
Closed
Assignees

Comments

@appleby
Copy link
Contributor

appleby commented Dec 9, 2019

There appear to be a handful of places in qvm-app and dqvm that are still calling MAKE-INSTANCE directly to create QVMs and passing the old :AMPLITUDES initarg rather than using the new :STATE API.

To reproduce, run the pyquil tests against qvm built from master. An example of the pytest error output:

pyquil/api/_error_reporting.py:238: in wrapper
    val = func(*args, **kwargs)
pyquil/api/_qvm.py:518: in run
    random_seed=self.random_seed)
pyquil/api/_error_reporting.py:238: in wrapper
    val = func(*args, **kwargs)
pyquil/api/_base_connection.py:340: in _qvm_run
    response = post_json(self.session, self.sync_endpoint + "/qvm", payload)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

session = <requests.sessions.Session object at 0x12ac1ac88>, url = 'http://127.0.0.1:5000/qvm'
json = {'addresses': {'ro': [0]}, 'compiled-quil': 'DECLARE ro BIT[1]\nX 0\nMEASURE 0 ro[0]\n', 'gate-noise': [0.01, 0.01, 0.01], 'trials': 1000, ...}

    def post_json(session, url, json):
        """
        Post JSON to the Forest endpoint.
        """
        res = session.post(url, json=json)
        if res.status_code >= 400:
>           raise parse_error(res)
E           pyquil.api._errors.QVMError: Invalid initialization argument:
E             :AMPLITUDES
E           in call for class #<STANDARD-CLASS QVM:DEPOLARIZING-QVM>.
E           See also:
E             The ANSI Standard, Section 7.1.2
E
E           The QVM returned the above error. This could be due to a bug in the server or a
E           bug in your code. If you suspect this to be a bug in pyQuil or Rigetti Forest,
E           then please describe the problem in a GitHub issue at:
E               https://github.com/rigetti/pyquil/issues

pyquil/api/_base_connection.py:56: QVMError

For instance, in qvm/app/src/configure-qvm.lisp, there are several make-appropriate-qvm methods that wind up allocating the amplitudes themselves and passing them along to make-instance.

Likewise in the run-qvm function defined in qvm/dqvm/tests/program-tests.lisp.

@appleby
Copy link
Contributor Author

appleby commented Dec 13, 2019

Closed by #221

@appleby appleby closed this as completed Dec 13, 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

No branches or pull requests

2 participants