adds and multiplies rational matrices