From 58ce333074ec8f0680d8f80a6208968db0e48ca8 Mon Sep 17 00:00:00 2001 From: Charles Zhang Date: Fri, 17 Dec 2021 16:01:43 -0800 Subject: [PATCH] Add native CCNOT compilation test. This is to help ensure building chip specs and the bare minimum compilation of higher order objects keeps working. --- tests/compilation-tests.lisp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/compilation-tests.lisp b/tests/compilation-tests.lisp index 9c7a40424..4bb850bd1 100644 --- a/tests/compilation-tests.lisp +++ b/tests/compilation-tests.lisp @@ -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))))