Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed dependency on optima #903

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading