Quantum Computing, Quantum Computer, Simulator, From Scratch.
part: (define (range-map start probs obs roll i n) (if (= i n) (error "No observation from circuit - invalid state") (if (= (list-ref probs i) 0) (range-map start probs obs roll (+ i 1) n) (if (and (>= roll start) (< roll (+ start (list-ref probs i)))) (list-ref obs i) (range-map (+ start (list-ref