mode_transformation function

2-mode to 1-mode transformation