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

HTTP 500 error ... no applicable method ... #11

Closed
rallim opened this issue Feb 6, 2017 · 1 comment
Closed

HTTP 500 error ... no applicable method ... #11

rallim opened this issue Feb 6, 2017 · 1 comment
Labels
bug 🐛 An issue that needs fixing.

Comments

@rallim
Copy link
Contributor

rallim commented Feb 6, 2017

Hi, I'm seeing the following HTTP 500 error:

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION CL-QUIL::PRINT-INSTRUCTION (24)>
when called with arguments
  (18 #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {1000014153}>).
...
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.rigetti.com/qvm

Here's a repro:

import pyquil.forest as qvm
import pyquil.quil as pq

def prog_from_file(filepath):
    """Make a Program from a file
    """
    p = pq.Program()
    with open(filepath) as fp:
        for line in fp:
            p.inst(line.rstrip('\n'))
    return p

if __name__ == '__main__':
    p = prog_from_file('/path/to/repro.quil')  # cleaner way to get a Program from a file?
    print p
    print qvm.Connection().run_and_measure(p, [2,3], 1)
    #print qvm.Connection().run(p, [2,3], 1)  # note that run appears to work

repro.quil:

X 5
X 0
H 1
CNOT 1 2
H 3
CNOT 3 4
CNOT 3 2
CNOT 5 4
H 5
MEASURE 5 [5]
MEASURE 4 [4]
CNOT 0 1
H 0
MEASURE 0 [0]
MEASURE 1 [1]
CNOT 3 2
JUMP-WHEN @THEN1 [1]
JUMP @END2
LABEL @THEN1
X 2
LABEL @END2
JUMP-WHEN @THEN7 [4]
JUMP @END8
LABEL @THEN7
X 3
LABEL @END8
JUMP-WHEN @THEN3 [0]
JUMP @END4
LABEL @THEN3
Z 2
LABEL @END4
JUMP-WHEN @THEN5 [5]
JUMP @END6
LABEL @THEN5
Z 3
LABEL @END6
CNOT 2 3

@tarballs-are-good Any clarification on the error and what triggers it? Thanks!

@stylewarning
Copy link
Contributor

@rallim, thanks very much for the bug report!

There is no problem with your code. The problem actually was that there was some stray debug code that accidentally found its way into production some time ago that wasn't caught. (Funny that debug code caused a bug.)

It's fixed now. I've tested your example and it should work fine. To verify, cxn.version() should now give 0.5.1.

@stylewarning stylewarning added bug 🐛 An issue that needs fixing. Fix Released labels Feb 6, 2017
bramathon pushed a commit that referenced this issue Oct 7, 2024
Both `CalibrationDefinition` and `Instruction` have some unnecessary
`Box`es—around a `Calibration` in the former and a `WaveformInvocation`
in the latter. This PR removes them, so only `Expression`s have a `Box`
in them (and this one is necessary due to recursive definitions).

Resolves #15, first observed in #11
bramathon pushed a commit that referenced this issue Oct 7, 2024
* Breaking: fix Program#get_blocking_frames; implement NONBLOCKING

* New: implement FENCE parsing

* New: implement DOT format export for ScheduledProgram and InstructionBlock

* Fix: parsing errors

* Fix: program display errors; linting errors

* Install insta

* Add graph layout snapshots

* Fix: label auto-generation; don't discard label-only blocks

* Add test case for graph construction

* Fix: prevent self-cycles in program graph

* Fix: return parsing error for literal integers that cannot be cast to f64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue that needs fixing.
Projects
None yet
Development

No branches or pull requests

2 participants