Quantum Computing, Quantum Computer, Simulator, From Scratch.
(define hadamard (matrix [[h-factor h-factor] [h-factor (- h-factor)]])) (define gH (apply-op hadamard)) (define q0 (qubit 1 0)) ; just qubit |0> ;; shortcuts (define H hadamard) (define X pauli-x) (define Y pauli-y) (define Z pauli-z) apply-op is a higher-order function that takes a matrix gate