This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- boilerplate functions | |
natToInt : Nat -> Int | |
natToInt Z = 0 | |
natToInt (S n) = 1 + (natToInt n) | |
natToString : Nat -> String | |
natToString n = show (natToInt n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Matrices | |
-- Vector stuff ~ maybe put Prelude.Vect | |
||| Dot product between numerical vectors | |
dot : Num a => Vect n a -> Vect n a -> a | |
dot w v = sum (zipWith (*) w v) | |
||| Numerical vector times a scalar of the appropriate type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Sigmas Module ~ Higher Sigma operators and their operator algebra | |
-- Cliff Harvey | |
-- February 2014 | |
module Sigmas where | |
import Control.Applicative | |
-- 4 basic complex phases: 1, -1, i, -i | |
data Phase = P1 | M1 | Pi | Mi deriving Eq |
NewerOlder