Skip to content

Commit 121c873

Browse files
braised-babbagestylewarning
authored andcommitted
use cl-quil/frontend
1 parent ec13e07 commit 121c873

12 files changed

+27
-22
lines changed

qvm-app.asd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:version (:read-file-form "VERSION.txt")
1010
:depends-on (
1111
;; Quil parsing
12-
(:version #:cl-quil "1.17.0")
12+
(:version #:cl-quil/frontend "1.26.0")
1313
;; Command line argument parsing
1414
#:command-line-arguments
1515
;; ASDF-companion utility library

qvm-tests.asd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:description "Regression tests for the QVM."
77
:author "Robert Smith <[email protected]>"
88
:license "Apache License 2.0 (See LICENSE.txt)"
9-
:depends-on (#:cl-quil
9+
:depends-on (#:cl-quil/frontend
1010
#:qvm
1111
#:qvm-examples
1212
#:alexandria

qvm.asd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
;; Finalizers and portable GC calls
3131
#:trivial-garbage
3232
;; Quil parsing and analysis
33-
(:version #:cl-quil "1.17.0")
33+
(:version #:cl-quil/frontend "1.26.0")
3434
;; Portable random number generator
3535
#:mt19937
3636
;; For allocation info.

src/channel-qvm.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@
201201
(check-type p01 (double-float 0.0d0 1.0d0))
202202
(check-type p10 (double-float 0.0d0 1.0d0))
203203
(check-type p11 (double-float 0.0d0 1.0d0))
204-
(assert (cl-quil::double= 1.0d0 (+ p00 p10)))
205-
(assert (cl-quil::double= 1.0d0 (+ p01 p11)))))
204+
(assert (quil::double= 1.0d0 (+ p00 p10)))
205+
(assert (quil::double= 1.0d0 (+ p01 p11)))))
206206

207207
(defun check-all-povms (seq)
208208
"Call CHECK-POVM on each element of SEQ."

src/compile-gate.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,11 +541,11 @@ If the gate can't be compiled, return (VALUES NIL NIL).")
541541
:documentation "A list of qubit-mref pairs to store, in order."))
542542
(:documentation "A pseudo-instruction for measuring all qubits simultaneously."))
543543

544-
(defmethod cl-quil::%max-qubit ((isn measure-all))
544+
(defmethod quil::%max-qubit ((isn measure-all))
545545
(loop :for qubit-mref :in (measure-all-storage isn)
546546
:maximize (car qubit-mref)))
547547

548-
(defmethod cl-quil::print-instruction-generic ((instr measure-all) stream)
548+
(defmethod quil::print-instruction-generic ((instr measure-all) stream)
549549
(format stream "{ MEASURE-ALL to ~D location~:P }"
550550
(length (measure-all-storage instr))))
551551

src/depolarizing-noise.lisp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ It should be that PX + PY + PZ <= 1.
7070
(return-from add-depolarizing-noise))))))
7171

7272
;;; Noise gets added to only the qubits being changed.
73-
(defmethod transition :after ((qvm depolarizing-qvm) (instr cl-quil:application))
74-
(dolist (arg (cl-quil:application-arguments instr))
75-
(when (typep arg 'cl-quil:qubit)
73+
(defmethod transition :after ((qvm depolarizing-qvm) (instr quil:application))
74+
(dolist (arg (quil:application-arguments instr))
75+
(when (typep arg 'quil:qubit)
7676
(let ((instr-qubits (quil:qubit-index arg)))
7777
(add-depolarizing-noise qvm (list instr-qubits)
7878
(probability-gate-x qvm)
7979
(probability-gate-y qvm)
8080
(probability-gate-z qvm))))))
8181

8282
;;; Noise gets added to every qubit after a RESET.
83-
(defmethod transition :after ((qvm depolarizing-qvm) (instr cl-quil:reset))
83+
(defmethod transition :after ((qvm depolarizing-qvm) (instr quil:reset))
8484
(declare (ignore instr))
8585
(dotimes (q (number-of-qubits qvm))
8686
(add-depolarizing-noise qvm (list q)
@@ -90,8 +90,8 @@ It should be that PX + PY + PZ <= 1.
9090

9191
;;; Noise gets added to only the qubit being measured, before
9292
;;; measurement occurs.
93-
(defmethod transition :before ((qvm depolarizing-qvm) (instr cl-quil:measurement))
94-
(let ((q (cl-quil:qubit-index (cl-quil:measurement-qubit instr))))
93+
(defmethod transition :before ((qvm depolarizing-qvm) (instr quil:measurement))
94+
(let ((q (quil:qubit-index (quil:measurement-qubit instr))))
9595
(add-depolarizing-noise qvm (list q)
9696
(probability-measure-x qvm)
9797
(probability-measure-y qvm)

src/noise-models.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@
237237
(lambda (instr)
238238
(and (typep instr 'quil:gate-application)
239239
(quil::plain-operator-p (quil:application-operator instr))
240-
(string= gate (cl-quil::application-operator-root-name instr)))))
240+
(string= gate (quil::application-operator-root-name instr)))))
241241

242242
(defun match-any-gates (&rest gates)
243243
"The returned function is true if there is any intersection between the instruction's gate and GATES."
244244
(lambda (instr)
245245
(and (typep instr 'quil:gate-application)
246246
(quil::plain-operator-p (quil:application-operator instr))
247-
(member (cl-quil::application-operator-root-name instr) gates :test #'string=))))
247+
(member (quil::application-operator-root-name instr) gates :test #'string=))))
248248

249249
(defun match-all-nq-gates (n)
250250
"The returned function is true if the instruction operates on N qubits."
@@ -277,4 +277,4 @@
277277
(defun match-instr-idxs (parsed-prog &rest idxs)
278278
"The returned function is true if the index of the INSTR in the program PARSED-PROG matches IDXS."
279279
(lambda (instr)
280-
(member (position instr (cl-quil::parsed-program-executable-code parsed-prog) :test 'eq) idxs)))
280+
(member (position instr (quil::parsed-program-executable-code parsed-prog) :test 'eq) idxs)))

src/package.lisp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
(:shadowing-import-from #:mt19937
1111
#:random)
1212

13+
#+(or sbcl ecl ccl)
14+
(:local-nicknames (:quil :cl-quil.frontend))
15+
1316
;; config.lisp
1417
(:export
1518
#:parallelization-limit ; TYPE

src/stabilizer-qvm.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
(:documentation "A gate application that's actually a Clifford."))
128128

129129
(defmethod quil::print-instruction-generic ((instr clifford-application) stream)
130-
(format stream "<clifford>~{ ~/cl-quil:instruction-fmt/~}"
130+
(format stream "<clifford>~{ ~/quil:instruction-fmt/~}"
131131
(quil:application-arguments instr)))
132132

133133
(defmethod print-object ((o clifford-application) stream)

src/transition.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Return just the resulting (possibly modified) QVM after executing INSTR. (Histor
3636
gc-time bytes-alloc)
3737
(multiple-value-prog1 (measuring-gc (gc-time bytes-alloc) (call-next-method))
3838
(format *trace-output* "~&; Transition ~A took ~D ms (gc: ~D ms; alloc: ~D bytes)~%"
39-
(with-output-to-string (s) (cl-quil:print-instruction instr s))
39+
(with-output-to-string (s) (quil:print-instruction instr s))
4040
(round (* (/ 1000 internal-time-units-per-second)
4141
(- (get-internal-real-time) start)))
4242
gc-time

0 commit comments

Comments
 (0)