diff --git a/Data/Array/Repa/Algorithms/Matrix.hs b/Data/Array/Repa/Algorithms/Matrix.hs
--- a/Data/Array/Repa/Algorithms/Matrix.hs
+++ b/Data/Array/Repa/Algorithms/Matrix.hs
@@ -18,11 +18,16 @@
 	, mmultP,      mmultS
 
           -- * Transposition.
-        , transpose2P, transpose2S) 
+        , transpose2P, transpose2S
+
+          -- * Trace.
+        , trace2P, trace2S)
+
 where
 import Data.Array.Repa                  as R
 import Data.Array.Repa.Eval             as R
 import Data.Array.Repa.Unsafe           as R
+import Control.Monad
 import Control.Monad.ST.Strict
 
 
@@ -108,3 +113,29 @@
         new_extent              = swap (extent arr)
 {-# NOINLINE transpose2S #-}
 
+
+-- Trace ------------------------------------------------------------------------
+-- | Get the trace of a (square) 2D matrix, in parallel.
+trace2P :: Monad m => Array U DIM2 Double -> m Double
+trace2P x 
+ = liftM (safeHead . toList) $ sumP $ slice y (Z :. (0 :: Int) :. All)
+ where
+    safeHead []     = error "repa-algorithms: trace2P empty list"
+    safeHead (x':_) = x'
+
+    y               = unsafeBackpermute (extent x) f x
+    f (Z :. i :. j) = Z :. (i - j) `mod` nRows:. j
+    Z :. nRows :. _nCols = extent x
+
+
+-- | Get the trace of a (square) 2D matrix, sequentially.
+trace2S :: Array U DIM2 Double -> Double
+trace2S x 
+ = safeHead $ toList $ sumS $ slice y (Z :. (0 :: Int) :. All)
+ where
+    safeHead []     = error "repa-algorithms: trace2S empty list"
+    safeHead (x':_) = x'
+
+    y               =  unsafeBackpermute (extent x) f x
+    f (Z :. i :. j) = Z :. (i - j) `mod` nRows:. j
+    Z :. nRows :. _nCols = extent x
diff --git a/repa-algorithms.cabal b/repa-algorithms.cabal
--- a/repa-algorithms.cabal
+++ b/repa-algorithms.cabal
@@ -1,5 +1,5 @@
 Name:                repa-algorithms
-Version:             3.2.3.1
+Version:             3.2.4.1
 License:             BSD3
 License-file:        LICENSE
 Author:              The DPH Team
