Skip to content

Commit

Permalink
dropped superfluous flet
Browse files Browse the repository at this point in the history
  • Loading branch information
macrologist committed Feb 7, 2024
1 parent 75ea5ab commit f77ad83
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/addresser/logical-schedule.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,12 @@ Returns the reduction of all bumped values by COMBINE-VALUES, and a hash table m
(defun lschedule-calculate-log-fidelity (lschedule chip-spec)
"Computes sqrt( ∑ ln(f_i)^2 ) where f_i is a fidelity associated with
an instruction i, i ranging over all instructions in the LSCHEDULE"
(flet ((log-squared (x) (expt (log x) 2)))
(let ((running-fidelity 0d0))
(map-lschedule-in-topological-order
lschedule
(lambda (instr)
(incf running-fidelity (log-squared (get-instruction-fidelity instr chip-spec)))))
(sqrt running-fidelity))))
(let ((running-fidelity 0d0))
(map-lschedule-in-topological-order
lschedule
(lambda (instr)
(incf running-fidelity (expt (log (get-instruction-fidelity instr chip-spec)) 2))))
(sqrt running-fidelity)))

(defun lschedule-calculate-fidelity (lschedule chip-spec)
"Calculate fidelity as the minimum fidelity of the individual instructions."
Expand Down

0 comments on commit f77ad83

Please sign in to comment.