QR-like factorization preserving type?

There is something known as the Smith decomposition or Smith normal form (not to be confused with Schmidt decomposition, which is essentially the singular value decomposition). The Smith normal form is defined for numbers which do not form a field, it is sufficient if they have the structure of a principal ideal domain. Integers have this structure. However, what you doing is not that, so maybe the Smith normal form is too much for what you need for your application.

2 Likes