Thanks for the answer below. I didn't use the method you proposed before because I am not an expert in algebra.
I tried the generic function you mentioned and didn't get it work properly:
C[Rem] := rem:
C[EuclideanNorm] := a -> degree(a,z):
C[Gcdex] := (a,b,s,t)->gcdex(a,b,z,s,t):
C[UnitPart] := sign:
A:=Matrix([[I*z-1, z+I], [z+I, z+I]]);
And I got error when calling the generic function:
Error, (in quo) wrong number (or type) of arguments
Am I making some mistakes in defining the Euclidean Domain?