You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ensure applicable symbolic-accepting compilers are included (#669)
When we changed the way occ-tbl metrics were calculated, it caused
quilc to find particularly good collections of compilers ("compiler
paths") for certain gate sets. These particularly good compiler paths
were better than before! But there was a hitch... the better compilers
were also less flexible in what they matched against, though that
wasn't apparent from the binding patterns themselves. In particular,
in some cases, the better compilers were ones that also did _not_
accept symbolic parameters (e.g., a memory reference). This means
these better compilers failed to take into account inputs like
`RX(theta) 0` even though the pattern `RX(_) _` was compilable.
The fix in this commit has two facets:
- First, we use heuristics to determine if a compiler can accept
symbolic parameters. This heuristic can be improved, but works
fine for one-parameter compilers, which are the real-world cases
that failed.
- Second, even if we find a better compiler path when warming the
chip spec, as long as a symbolic-accepting path was found, it's
included in the list of compilers. This may still fail, if the
entire path doesn't allow symbolic compilers. This was too
complicated to check for this commit with too little gain.
This fixes both issues reported in issue #667.
;; Instantiate PARAMS with symbolic arguments. Used as a helper
366
+
;; below.
367
+
(let ((gen (symbolic-param-generator)))
368
+
(mapcar (lambda (p)
369
+
(if (symbolp p)
370
+
(funcall gen)
371
+
p))
372
+
params)))
373
+
356
374
(defgenericinstantiate-binding (binding)
357
375
(:documentation"When possible, construct the unique instruction on which BINDING will match. If any of the binding's arguments are unspecified (i.e. match against any qubit), those arguments will be filled-in with unique qubit indices.")
0 commit comments