def METHOD_NAME(self, U, mu_target=None):
    Nd = len(U)
    if mu_target not in self.cache:
        code = []
        Nret = 0
        path = g.path
        for mu in range(Nd):
            if mu_target is not None and mu_target != mu:
                continue
            O = [nu for nu in range(Nd) if nu != mu]
            code_mu = []
            for nu in O:
                # 1x1 staples
                s0 = self.beta * self.c0 / U[0].otype.shape[0]
                code_mu.append(
                    (Nret, -1 if len(code_mu) == 0 else Nret, s0, path().f(nu).f(mu).b(nu))
                )
                code_mu.append(
                    (Nret, -1 if len(code_mu) == 0 else Nret, s0, path().b(nu).f(mu).f(nu))
                )
                # 2x1 staples
                s1 = self.beta * self.c1 / U[0].otype.shape[0]
                dst = -1 if len(code_mu) == 0 else Nret
                code_mu.append(
                    (
                        Nret,
                        dst,
                        s1,
                        path().f(nu, 2).f(mu).b(nu, 2),
                    )
                )
                dst = Nret
                code_mu.append(
                    (
                        Nret,
                        Nret,
                        s1,
                        path().b(nu, 2).f(mu).f(nu, 2),
                    )
                )
                code_mu.append(
                    (
                        Nret,
                        Nret,
                        s1,
                        path().f(nu).f(mu, 2).b(nu).b(mu),
                    )
                )
                code_mu.append((Nret, Nret, s1, path().b(nu).f(mu, 2).f(nu).b(mu)))
                code_mu.append((Nret, Nret, s1, path().b(mu).b(nu).f(mu, 2).f(nu)))
                code_mu.append((Nret, Nret, s1, path().b(mu).f(nu).f(mu, 2).b(nu)))
            code = code + code_mu
            Nret += 1
        self.cache[mu_target] = g.parallel_transport_matrix(U, code, Nret)
    ret = self.cache[mu_target](U)
    if mu_target is not None:
        ret = [ret]
    return ret