Closed daniel-mills-cqc closed 2 years ago
The following Lisp code runs fine. I'm not totally sure this is logically equivalent to what the Python is doing, though.
(in-package :cl-quil)
(defun test ()
(let ((chip
(build-chip-from-digraph '((0 1) (0 14) (1 2) (1 13) (2 3) (2 12) (3 4) (3 11) (4 5) (4 10) (5 6) (5 9) (6 8) (7 8) (8 9) (9 10) (10 11) (11 12) (12 13) (13 14)) :architecture :cz))
(n-qubits 15)
(gates ()))
(dotimes (i n-qubits)
(push (build-gate "CZ" () (mod i n-qubits) (mod (1+ i) n-qubits))
gates))
(compiler-hook (make-instance 'parsed-program :executable-code (coerce (nreverse gates) 'vector))
chip)))
(test)
Closing since issue cannot be reproduced using only quilc
proper.
The following code snippet:
gives the error:
This is the case with the following versions:
This error does not occur if the CZs do not form a 'closed chain' . For example replacing the for loop adding the CZ gates with:
does not give an error. I cannot, however, confirm that closed chains are the problem.