I have defined the commutator between two matrices as
comm[A_,B_]:=A.B-B.A
I have defined the nested commutator as
nestcomm[A_,B_,n_]:= ToExpression[
StringRepeat["comm[a,", n] <> "b" <> StringRepeat["]", n]
]
where $n$ indicates how many time the commutator must be nested.
Does exists a more simple way to define an $n$-time nested operation between two elements $A$ and $B$? I tried to use the Nest function but without success.