Auxiliary function for matrix_norm Computes the permutation that moves the two given dimensions to the back
(dim0, dim1, dimn)
| 718 | """ |
| 719 | |
| 720 | def _backshift_permutation(dim0, dim1, dimn): |
| 721 | """ |
| 722 | Auxiliary function for matrix_norm |
| 723 | Computes the permutation that moves the two given dimensions to the back |
| 724 | """ |
| 725 | pos_dim0 = dim0 % dimn |
| 726 | pos_dim1 = dim1 % dimn |
| 727 | ret = [i for i in range(dimn) if i != pos_dim0 and i != pos_dim1] |
| 728 | ret.extend((pos_dim0, pos_dim1)) |
| 729 | return ret |
| 730 | |
| 731 | def _inverse_permutation(perm): |
| 732 | """ |
no test coverage detected