code: public Complex contraction() {
          int i, j;
          Complex result = new Complex(0d, 0d);
          for (i = 0; i < rows; i++)
              for (j = 0; j < columns; j++) {
                  result.real += realmatrix[i][j];
                  result.imag += imagmatrix[i][j];
              }
          return result;
      }
docs: Calculates the contraction from a matrix