def full(self):
        """ Transforms a TT-matrix into a full matrix"""
        N = self.n.prod()
        M = self.m.prod()
        a = self.tt.full()
        d = self.tt.d
        sz = _np.vstack((self.n, self.m)).flatten('F')
        a = a.reshape(sz, order='F')
        # Design a permutation
        prm = _np.arange(2 * d)
        prm = prm.reshape((d, 2), order='F')
        prm = prm.transpose()
        prm = prm.flatten('F')
        # Get the inverse permutation
        iprm = [0] * (2 * d)
        for i in xrange(2 * d):
            iprm[prm[i]] = i
        a = a.transpose(iprm).reshape(N, M, order='F')
        a = a.reshape(N, M)
        return a
Transforms a TT-matrix into a full matrix