quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
452 stars 73 forks source link

Feature/expose options in rpc #840

Closed bramathon closed 1 year ago

bramathon commented 2 years ago

Adds four options to the RPC entry-point.

The options are modeled after the implementation of state-aware, setting the corresponding global variables using a let statement in process-program.

In addition, anonymous gate definitions are now printed with the program.

stylewarning commented 2 years ago

i'm accepting these changes with the proviso that they're "internal" options and may change in the future (though there are no plans to)

stylewarning commented 2 years ago

@bramathon do the tests pass locally for you just fine?

stylewarning commented 2 years ago

Runner says:

; caught ERROR:
;   READ error during COMPILE-FILE:
;   
;     Package QUIL does not exist.
;   
;       Line: 5, Column: 46, File-Position: 184
;   
;       Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/runner/work/quilc/quilc/app/tests/utils.lisp" {1007F1B223}>

Looks like we need to add a package-local nickname (#:quil #:cl-quil) to QUILC-TESTS package, or change quil: to cl-quil: on qualified symbols.

stylewarning commented 1 year ago

@bramathon I fixed the package naming issue on master. As such, I'll go ahead and merge this.

stylewarning commented 1 year ago
$ make test-quilc
[... bunch of compiler output ...]
QUILC-TESTS (Suite)
  TEST-FAITHFULNESS
    Testing file CCNOTs
    Testing file CNOT-partial-rewiring
    Testing file johannes
    Testing file some-CZs
..........................................................................[ OK ]
  TEST-EASY-VERSION-CALL..................................................[ OK ]
  TEST-QUIL-TO-NATIVE-QUIL-ENDPOINT.......................................[ OK ]
  TEST-QUIL-TO-NATIVE-QUIL-OPTIONS........................................[ OK ]
  TEST-QUIL-TO-NATIVE-QUIL-PROTOQUIL-ENDPOINT.............................[ OK ]
  TEST-QUIL-TO-NATIVE-QUIL-ENDPOINT-OVERRIDES-SERVER......................[ OK ]
  TEST-NATIVE-QUIL-TO-BINARY-ENDPOINT.....................................[ OK ]
  TEST-GENERATE-RB-SEQUENCE-ENDPOINT......................................[ OK ]
  TEST-CONJUGATE-PAULI-BY-CLIFFORD-ENDPOINT...............................[ OK ]
  TEST-REWRITE-ARITHMETIC-ENDPOINT........................................[ OK ]
  TEST-QUIL-TO-NATIVE-QUIL-ON-NONTRIVIAL-FEATURES.........................[ OK ]
  TEST-QUIL-SAFELY-RESOLVE................................................[ OK ]
  TEST-UPDATE-AVAILABLE...................................................[ OK ]
  TEST-PROCESS-PROGRAM....................................................[ OK ]
  TEST-SPECIAL-BINDINGS-LET*..............................................[ OK ]
  TEST-STRIP-FINAL-HALT-RESPECTING-REWIRINGS..............................[ OK ]