code: function(matrix) {
      // if not square
      if (matrix.x != matrix.y) {
        return
      }
      // return trace
      return _.filter(matrix.data, function (line, number) {
        return _.includes(line, number)
      }).length
    }
docs: computes the trace of the matrix