-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add some more tests for DEFEXPI functionality #501
Conversation
@@ -984,20 +984,22 @@ If ENSURE-VALID is T, then a memory reference such as 'foo[0]' will result in an | |||
:arguments qubit-list)))) | |||
|
|||
(defun pauli-term->matrix (term arguments parameters parameter-names) | |||
(let* ((prefactor-fn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering where this commit snuck off to.
8b4f729
to
798c87c
Compare
The only suggested test not added is an explicit test involving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubber stamping a bit here, but I am always in favor of moar tests :-)
Suggestion: test against |
(let* ((cpp (compiler-hook (parse-quil prog-text) chip)) | ||
(m (parsed-program-to-logical-matrix cpp))) | ||
(is (quil::double= 1d0 (abs (magicl:ref m 0 0)))) | ||
(loop :for j :below (magicl:matrix-rows m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magicl:identityp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is checking identityp
up to phase.
(declare (ignorable ,@parameter-names)) | ||
,(delayed-expression-expression (pauli-term-prefactor term))))) | ||
(apply | ||
(compile nil `(lambda ,parameter-names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not for this commit, but we might instead simply interpret the expression instead of calling the compiler.
i think this is a good suggestion. Could @jmbr or @ecpeterson make a "good-first-issue" for this? |
I will. |
cf. #498 (review)