\(\(T[q_, p_, Φ_, en_] := 
        Block[{σ = 2\ π\ p/q, 
            TT}, 
		TT\  = {{en\  - \ 
                  2\ Cos[\(-Φ\)], \(-1\)}, {1, 
                0}}; 
		Do[
            TT = {{en - 2\ Cos[σ\ j\  - Φ], \(-1\)}, {1, 
                    0}}\  . \ TT, {j, 1, 
              q - 1}]; 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TT[\([1, 1]\)]\  + \ TT[\([2, 2]\)]
];\)\)

Plot[Abs[f[p]], {p, 0, 2  π}];

\(\(Test[q_, p_] := \ 
        Block[{}, 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ T[q, 
                p, ky, en]\  + \ 2\ Cos[q*ky]\  - \ 
              T[q, p, π/\((2\ q)\), en] // 
            Simplify
		];\)\)

T[6, p, en] // Simplify

T[8, p, en] // Simplify

Test[5, 2]