Quantum Computing, Quantum Computer, Simulator, From Scratch.
shots)]) (let ([obs (measure-mat q)]) (if (hash-has-key? results obs) (hash-set! results obs (+ (hash-ref results obs) 1)) (hash-set! results obs 1)))) results)) By default, we measure 1024 times, but we can vary this based on our requirements. Let us take this function for a spin. (counts (qubit 1