<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def similarity_transformation(rot, mat):
 """ R x M x R^-1 """

    return np.dot(rot, np.dot(mat, np.linalg.inv(rot)))