<<xAct`xTensor`

$DefInfoQ=False;

DefManifold[M,4,{a,b,c,d,e,i,j,k,l,m,n,o,p,q,μ,ν,ρ,σ,α,β}]

DefMetric[-1, g[-a,-b], CD]

$Pre=Validate;

$PrePrint=ScreenDollarIndices;

DefTensor[phi[],M,PrintAs->"ϕ"]

Example2:

CD[-μ]@CD[-ν]@CD[-α]@phi[]-CD[-ν]@CD[-μ]@CD[-α]@phi[]

SortCovDs[%,CD]

Example2:

CD[-a]@CD[-b]@CD[-c]@phi[]-CD[-b]@CD[-a]@CD[-c]@phi[]

SortCovDs[%,CD]