Implement api ruby-matrix to q-matrix