shifts.matrix_to_list function

Compute the list of shifts.