simplify calculation of phase matrices