Skip to content

Commit

Permalink
Fix truncating fidelities > 1 - double-float-epsilon
Browse files Browse the repository at this point in the history
  • Loading branch information
notmgsk committed Dec 2, 2020
1 parent 143629c commit 2f54996
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/chip/chip-reader.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
+near-perfect-fidelity+)
((> fidelity +near-perfect-fidelity+)
;; Silent truncation.
(- 1d0 double-float-epsilon))
+near-perfect-fidelity+)
((minusp fidelity)
(error "Chip specification contained negative fidelity ~A. I don't know what to do with this value." fidelity))
((zerop fidelity)
Expand Down
2 changes: 1 addition & 1 deletion src/chip/chip-specification.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
;;;
;;; Use MAKE-ADJUSTABLE-VECTOR and VNTH for these objects.

(defconstant +near-perfect-fidelity+ 0.99999d0
(defconstant +near-perfect-fidelity+ (- 1d0 double-float-epsilon)
"Even perfect operations are typically limited in their physical realization by, say, the granularity of control electronics. (For instance, waveform IQ values might be stored as complex fixnums of some specified depth.) This constant is a mnemonic for \"supposedly perfect\" and captures some of the loss incurred by these imperfections.")

;; TODO: actually put a small value here.
Expand Down

0 comments on commit 2f54996

Please sign in to comment.