# On multiplying symmetric matrices by diagonal matrices with roots of unity

Given two symmetric non-zero and non-identity matrices $A,B\in\Bbb C^{n\times n}$ of same rank supposing there exists a non-identity diagonal matrix $D\in\Bbb C^{n\times n}$ containing only roots of unity such $$AD=DB$$ does that mean $A,B$ are diagonals and hence equal?

Or atleast would they be similar to block diagonal matrix?

No, it does not imply that $A$ and $B$ are equal. Just take $B=-A$ with suitable $D$.