This is called "eye" in the matrix routines perhaps it should be the same here. Should it be called 'identity' instead of 'unit'? I thought you meant a matrix full of 1s when you said unit matrix.