Skip to content

Commit

Permalink
Add native CCNOT compilation test.
Browse files Browse the repository at this point in the history
This is to help ensure building chip specs and the bare minimum
compilation of higher order objects keeps working.
  • Loading branch information
karlosz committed Dec 18, 2021
1 parent faf897e commit 58ce333
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/compilation-tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ CNOT 0 2"))
;; test on quality of compilation, and not on correctness.
(is (>= 6 (length 2q-code)))))

(deftest test-native-ccnot-compilation ()
"Test that we can compile a trivial program on a chip specification with a native CCNOT gate."
(let* ((chip (quil::build-ccnot-chip))
(ccnot-prog (parse "CCNOT 0 1 2")))
(not-signals error
(compiler-hook ccnot-prog chip))))

(deftest test-cswap-compiles-with-qs ()
"Test that CSWAP compiles with QS-COMPILER. (Don't test the output's validity.)"
(let ((result (quil::qs-compiler (quil::build-gate "CSWAP" () 0 1 2))))
Expand Down

0 comments on commit 58ce333

Please sign in to comment.