Generate an array with custom index
Another possibility using a single Table
:
n = 5;
Table[
If[i==j, OverTilde[G], G][t[i], t[Mod[i-j, n]]],
{i, 0, n-1},
{j, 0, n-1}
] //MatrixForm //TeXForm
$\left( \begin{array}{ccccc} \tilde{G}(t(0),t(0)) & G(t(0),t(4)) & G(t(0),t(3)) & G(t(0),t(2)) & G(t(0),t(1)) \\ G(t(1),t(1)) & \tilde{G}(t(1),t(0)) & G(t(1),t(4)) & G(t(1),t(3)) & G(t(1),t(2)) \\ G(t(2),t(2)) & G(t(2),t(1)) & \tilde{G}(t(2),t(0)) & G(t(2),t(4)) & G(t(2),t(3)) \\ G(t(3),t(3)) & G(t(3),t(2)) & G(t(3),t(1)) & \tilde{G}(t(3),t(0)) & G(t(3),t(4)) \\ G(t(4),t(4)) & G(t(4),t(3)) & G(t(4),t(2)) & G(t(4),t(1)) & \tilde{G}(t(4),t(0)) \\ \end{array} \right)$
Update: Slightly streamlined version:
n = 5;
a = Array[Subscript[t, #] & /@ {##} &, {n, n}, {{0, n - 1}, {n - 1, 0}}];
m2 = MapIndexed[G @@@ RotateRight[#, #2[[1]]] &, a] /.
p:G[_, _[_, 0]] :> Operate[OverTilde, p]
m2 == m
True
Original answer:
n = 5;
ta = Array[Subscript[t, #] &, n, 0];
tb = RotateRight[ta, #] & /@ Range[0, n - 1];
m = Apply[G, Transpose[Transpose[{ta, #}] & /@ tb], {-3}];
m = ReplacePart[m, {i_, i_} :> (m[[i, i]] /. G -> OverTilde[G])];
TeXForm @ MatrixForm @ m
$\left( \begin{array}{ccccc} \tilde{G}\left(t_0,t_0\right) & G\left(t_0,t_4\right) & G\left(t_0,t_3\right) & G\left(t_0,t_2\right) & G\left(t_0,t_1\right) \\ G\left(t_1,t_1\right) & \tilde{G}\left(t_1,t_0\right) & G\left(t_1,t_4\right) & G\left(t_1,t_3\right) & G\left(t_1,t_2\right) \\ G\left(t_2,t_2\right) & G\left(t_2,t_1\right) & \tilde{G}\left(t_2,t_0\right) & G\left(t_2,t_4\right) & G\left(t_2,t_3\right) \\ G\left(t_3,t_3\right) & G\left(t_3,t_2\right) & G\left(t_3,t_1\right) & \tilde{G}\left(t_3,t_0\right) & G\left(t_3,t_4\right) \\ G\left(t_4,t_4\right) & G\left(t_4,t_3\right) & G\left(t_4,t_2\right) & G\left(t_4,t_1\right) & \tilde{G}\left(t_4,t_0\right) \\ \end{array} \right)$
Something like this?
Table[
Table[G[t[j], t[k]], {k, j, 0, -1}]~Join~Table[G[t[j], t[i]], {i, n - 1, j + 1, -1}],
{j, 0, n - 1}
]
For example, n = 4
{
{G[t[0], t[0]], G[t[0], t[3]], G[t[0], t[2]], G[t[0], t[1]]},
{G[t[1], t[1]], G[t[1], t[0]], G[t[1], t[3]], G[t[1], t[2]]},
{G[t[2], t[2]], G[t[2], t[1]], G[t[2], t[0]], G[t[2], t[3]]},
{G[t[3], t[3]], G[t[3], t[2]], G[t[3], t[1]], G[t[3], t[0]]}
}
which seems to follow the pattern.
Using nested Table
s like this usually isn't suggested, so I'll keeping working on a better method, but for now it seems to work.