Skip to content

Commit

Permalink
removed dependency on optima
Browse files Browse the repository at this point in the history
  • Loading branch information
macrologist authored and stylewarning committed Oct 13, 2023
1 parent 9856d64 commit df7e4fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
2 changes: 0 additions & 2 deletions cl-quil.asd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#:uiop
#:split-sequence
#:closer-mop
#:optima
#:cl-algebraic-data-type
#:global-vars
#:trivial-garbage ; weak hash tables
Expand Down Expand Up @@ -112,7 +111,6 @@
#:magicl/ext-lapack ; for gate fusion
#:global-vars ; Static globals
#:salza2 ; God table compression
#:optima
#+sbcl #:sb-rotate-byte
)
:pathname "src/"
Expand Down
30 changes: 12 additions & 18 deletions src/build-gate.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,18 @@ Comes in two flavors:
"Binary operator that safely applies to possibly mixed arguments of NUMBER / DELAYED-EXPRESSION objects. Returns a NUMBER when possible, and a DELAYED-EXPRESSION otherwise."
(flet ((decompose (arg)
"Returns a values tuple: PARAMS LAMBDA-PARAMS EXPRESSION DELAYEDP"
(optima:match arg
((delayed-expression (params arg-params)
(lambda-params arg-lambda-params)
(expression arg-expression))
(values
arg-params
arg-lambda-params
arg-expression
t))
((memory-ref)
(values
nil
nil
arg
t))
((constant (value val))
(values nil nil val nil))
(_
(typecase arg
(delayed-expression
(with-slots (params lambda-params expression) arg
(values params lambda-params expression t)))

(memory-ref
(values nil nil arg t))

(constant
(values nil nil (constant-value arg) nil))

(t
(values nil nil arg nil)))))
(multiple-value-bind (params-1 lambda-params-1 expression-1 delayedp-1) (decompose arg1)
(multiple-value-bind (params-2 lambda-params-2 expression-2 delayedp-2) (decompose arg2)
Expand Down

0 comments on commit df7e4fe

Please sign in to comment.