# Product of manifolds with non−zero non−diagonal boxes in the metric

I'm trying to construct in xAct a metric like this

where $$g_{\mu\nu}$$ is 4-dimentional, and $$g_{MN}$$ - 5-dimentional, $$A_\mu$$ - 4-vector and $$\phi$$ is a scalar field.

I already tried to do it like here Define tensor made of other tensors in xAct , but in this case, I cannot use the resulting object as a metric and calculate its Christoffel symbols, because I cannot work with the indices of the 5-dimensional space, and I was only able to do this by adding a unit vector to preserve the tensor structure. I also tried to do that with xCoba, but in this case I'm loosing all tensor structure of $$g_{\mu\nu}$$. May be someone knows how to do that? I would be glad for any help ^^ below i am attaching my code

<< xActxTensor
<< xActxCoba
DefManifold[M1, 4, IndexRange[a, f]]
DefManifold[M2, 1, IndexRange[l, s]]
DefManifold[M, {M1, M2}, {\[Alpha], \[Beta], \[Gamma], \[Mu], \[Nu], \[Rho], \[Sigma]}]
SplittingsOfManifold[M]
DefTensor[A[a], M1]
DefTensor[\[Phi][], M1]
DefTensor[F[-a, -b], M1]
IndexSet[F[-a_, -b_], PD[-a][A[-b]] - PD[-b][A[-a]]]
DefMetric[-1, g[-a, -b], cd]
DefTensor[h[l], M2]
AutomaticRules[h, MakeRule[{h[-l] h[l], 1}]]
DefMetric[-1, G[-\[Alpha], -\[Beta]], CD]
IndexSet[G[-a, -b], g[-a, -b] - \[Phi][]^2 A[-a] A[-b]]
IndexSet[G[-a, -l], \[Phi][]^2 A[-a] h[-l]]
IndexSet[G[-l, -m], \[Phi][]^2 h[-l] h[-m]]


And another way after defining $$g_{\mu\nu}$$:

DefBasis[red, TangentM, {0, 1, 2, 3, 4}, BasisColor -> red]
SplitBasis[red, {TangentM1 -> {0, 1, 2, 3}, TangentM2 -> {4}}]
DefTensor[G[-\[Alpha], -\[Beta]], M, Symmetric[{-\[Alpha], -\[Beta]}]]
values1 = Table[g[-a, -b] Basis[a, {i, -red}] Basis[
b, {j, -red}] - \[Phi][]^2 A[-a] Basis[
a, {i, -red}] A[-b] Basis[b, {j, -red}], {i, 0, 3} , {j, 0,
3}] // ContractBasis // Simplification
values = {{g[{0, -red}, {0, -red}]-A[{0, -red}]]^2 \[Phi][]^2,
g[{0, -red}, {1, -red}] - A[{0, -red}]   A[{1, -red}]  \[Phi][]^2,
g[{0, -red}, {2, -red}] - A[{0, -red}]   A[{2, -red}]  \[Phi][]^2,
g[{0, -red}, {3, -red}] -  A[{0, -red}]   A[{3, -red}]  \[Phi][]^2, \[Phi][]^2*
A[-b] Basis[b, {0, -red}] }, {g[{0, -red}, {1, -red}] -
A[{0, -red}]   A[{1, -red}]  \[Phi][]^2,
g[{1, -red}, {1, -red}] - A[{1, -red}]]^2 \[Phi][]^2,
g[{1, -red}, {2, -red}] - A[{1, -red}]   A[{2, -red}]  \[Phi][]^2,
g[{1, -red}, {3, -red}] -
A[{1, -red}]   A[{3, -red}]  \[Phi][]^2, \[Phi][]^2*
A[-b] Basis[b, {1, -red}]}, {g[{0, -red}, {2, -red}] -
A[{0, -red}]   A[{2, -red}]  \[Phi][]^2,
g[{1, -red}, {2, -red}] - A[{1, -red}]   A[{2, -red}]  \[Phi][]^2,
g[{2, -red}, {2, -red}] -A[{2, -red}]]^2 \[Phi][]^2, g[{2, -red}, {3, -red}] - A[{2, -red}]   A[{3, -red}]  \[Phi][]^2, \[Phi][]^2* A[-b] Basis[b, {2, -red}]}, {g[{0, -red}, {3, -red}] - A[{0, -red}]   A[{3, -red}]  \[Phi][]^2, g[{1, -red}, {3, -red}] - A[{1, -red}]   A[{3, -red}]  \[Phi][]^2,
g[{2, -red}, {3, -red}] - A[{2, -red}]   A[{3, -red}]  \[Phi][]^2,
g[{3, -red}, {3, -red}] - A[{3, -red}]]^2 \[Phi][]^2, \[Phi][]^2*
A[-b] Basis[b, {3, -red}]}, {\[Phi][]^2*
A[-b] Basis[b, {0, -red}], \[Phi][]^2*
A[-b] Basis[b, {1, -red}], \[Phi][]^2*
A[-b] Basis[b, {2, -red}], \[Phi][]^2*
A[-b] Basis[b, {3, -red}], \[Phi][]^2}} // ContractBasis
G = CTensor[values, {-red, -red}]
SetCMetric[G, red, SignatureOfMetric -> {1, 3, 0}]