Generalized Characteristic Polynomial with Unimodular Roots Let us define a diagonal matrix $\mathbf{D}(z) = diag(z^{m_1}, \dots, z^{m_N})$ with $z\in\mathbb{C}$ and positive integers $m_1, \dots, m_N$. 
The generalized characteristic polynomial of a matrix $\mathbf{A}$ is then:
$$ p(z) = det(\mathbf{D}(z) - \mathbf{A})$$

For which $\mathbf{A}$ are all roots of $p$ unimodular for all $m_1, \dots, m_N \geq 1$?

Known sufficient condition: $\mathbf{A}$ unitary.
But it is also known that unitarity is not necessary.
Also, is there a name for the generalized characteristic polynomial (in literature as it seems that this term is not used for $p(z)$) ?
Examples:


*

*$p(z)$ with $\mathbf{A}= [3,2;-4,3]$ and $m_1 = 3, m_2 = 1$ has non-unimodular roots.

*$p(z)$ with $\mathbf{A}= [-0.5,1;0.75,0.5]$, which is non-unitary, has for all $m_1$ and  $m_2$ unimodular roots.

 A: Note that $p(z)$ is invariant under the conjugation by diagonal matrices (the proof is the same as for the usual characteristic polynomial). Thus if a matrix $A$ has the requisite property, the same property holds for all its diagonal conjugates. In particular, assuming that all unitary matrices yield  $p(z)$ with "unimodular" (i.e. absolute value 1) roots, the same would hold for their diagonal conjugates, which are diagonalizable  matrices with "unimodular" eigenvalues, but not necessarily unitary. This explains the second example (where the eigenvalues are $\pm 1$ and the matrix is diagonally conjugate to an orthogonal reflection). 
A: This is a partial answer but too long for a comment.
Let us first prove the property stated i.e. 
$$
\mathbf{A} \mbox{ unitary }\Longrightarrow \mbox{ all roots of }p(z) \mbox{ are of modulus } 1
$$
Firsly $|p(0)|=|det(-\mathbf{A})|=1$, 
so $p$ has not zero as a root.
Second, if $z\not=0$, one can write
$$ 
det(\mathbf{D}(z)-\mathbf{A})
=det(\mathbf{D}(z))det(I-\mathbf{D}(z)^{-1}\mathbf{A})
$$
so $p(z)=0$ is equivalent to $1\in sp(\mathbf{D}(z)^{-1}\mathbf{A})$ and to the existence of $\mathbf{v}\not=0$ such that
$$
\mathbf{D}(z)^{-1}\mathbf{A}\mathbf{v}=\mathbf{v}
$$
for such $\mathbf{v}$ one has 
$
\mathbf{A}\mathbf{v}=\mathbf{D}(z)\mathbf{v}
$
and, writing $z=\rho e^{it}$ one gets 
$
\mathbf{A}\mathbf{v}=\mathbf{D}(\rho)\mathbf{D}(e^{it})\mathbf{v}\ .
$
Now, $\mathbf{D}(e^{it})$ being unitary, one gets finally 
$$
||\mathbf{v}||_2=||\mathbf{D}(e^{-it})\mathbf{A}\mathbf{v}||_2=||\mathbf{D}(\rho)\mathbf{v}||_2\qquad \mbox{(*).}
$$
As it is easy to check that for all $\mathbf{v}$ and $\rho>0$,
$$
||\mathbf{D}(\rho)\mathbf{v}||_2\geq \rho ||\mathbf{v}||_2 \mbox{ if } \rho>1\ ;\ ||\mathbf{D}(\rho)\mathbf{v}||_2\leq \rho ||\mathbf{v}||_2  \mbox{ if } \rho<1\ ,
$$
the result follows from (*).
For $\alpha=(m_1,\cdots ,m_N)\in (\mathbb{N}_{\geq 1})^N$, let 
$$
\mathbf{D}(\alpha,z)=diag(z^{m_1}, \dots, z^{m_N})
$$ 
for $z$ fixed, one has 
$$
\mathbf{D}(\alpha,z)\mathbf{D}(\beta,z)=\mathbf{D}(\alpha+\beta,z)
$$ 
these matrices form a semigroup. 
For $\alpha$ fixed
$$
\mathbf{D}(\alpha,z_1)\mathbf{D}(\alpha,z_2)=\mathbf{D}(\alpha,z_1z_2)
$$ 
for $z\not=0$ these matrices form a group. The set of all these matrices is normalised by the monomial matrices, i.e. the semi-direct product of the (Weyl) group of permutation matrices and of diagonal matrices as, if $W=W(\sigma)$ is a permutation matrix and if $D$ is a diagonal (regular) matrix, one has
$$
WD\mathbf{D}(\alpha,z)D^{-1}W^{-1}=\mathbf{D}(\alpha_\sigma,z)
$$
As was remarked by Victor, matrices such as unitary (see above) and upper (or lower) triangular with unitary diagonal possess the property. 
Their conjugates through the monomial group possess also the property.
How to test (algorithmically) that a matrix is conjugated of a unitary  matrix through the monomial group ?

Firstly, as was remarked as the permutation matrices and as the diagonal ones with unitary spectrum are unitary, to be such is equivalent of being conjugated of a unitary  matrix through the diagonal group of matrices with strictly positive eigenvalues i.e. for a matrix $B$ test whether it exists a unitary matrix and $R=diag(r_1,\cdots ,r_N)$ such that 
  $$
B=R^{-1}AR
$$ 
  (one can even restrict to the special group of them, but we will not use this)
(analysis) suppose it were the case, then $B^*R^2B=R^2$ 
(synthesis) 
  
  
*
  
* find all the diagonal matrices $D$ which fulfil $B^*DB=D$ (it is a linear system with $N$ variables, i.e. diagonal eigenvectors for the eigenvalue $1$ of the linear transformation $D\rightarrow B^*DB$).
  
* among them select, if possible, a $D$ with strictly positive spectrum and set $R=\sqrt{D}$ then $A=R^{-1}AR$ is unitary. 
  
  
  Remark It can happen that the transformation $D\rightarrow B^*DB$ admit diagonal eigenvectors for the eigenvalue $1$ none of which is strictly positive. As the procedure provides a necessary and sufficient condition, the corresponding matrix is not diagonally conjugate to a unitary matrix. 
(Counter)-example Set 
  $$
B=
\begin{pmatrix}
\sqrt{2} & 1\cr
1 & \sqrt{2}
\end{pmatrix}
$$
  then, solving 
  $$
B^*\begin{pmatrix}
x & 0\cr
0 & y
\end{pmatrix}
B
=
\begin{pmatrix}
x & 0\cr
0 & y
\end{pmatrix}
$$
  yields $x=-y$ so there are eigenvectors as 
  $$
\begin{pmatrix}
1 & 0\cr
0 & -1
\end{pmatrix}
$$
  but none of them is strictly positive. 

A: Also this is not an answer, but maybe a different path to tackle the problem.
The polynomial $p(z)=det(\mathbf{D}(z)−\mathbf{A})$ can be given explicitly as
$$ p(z) = \sum_{k = 0}^{M} z^k \sum_{I \in I_k} (-1)^{M-k} \det(\mathbf{A}_{I}) $$
where $M = \sum_{k=0}^{N} m_k$ and $I_k = \{ I \subset \left\{ 1, \dots, N \} \middle| \sum_{i \in I} m_i = k \right\}$ is the set of index sets which sum up to $k$, $A_I$ is the sub-matrix of $A$ with the columns and rows with index $I$ deleted.
Theorem by Cohn, A. (1922). "Über die Anzahl der Wurzeln einer algebraischen Gleichung in einem Kreise.":
A polynomial p(z) has all its zeros on the unit circle if and only if it is self-inversive and its derivative p′(z) has all its zeros in the closed unit disk $|z| < 1.$
A polynomial $p(z)$ of degree $d$ is self-inversive if $p(z) = \epsilon z^d p(1/z)$ with $|\epsilon| = 1$.
As the original question requires it to be true for all $m_1, \dots, m_N$, there are also $m_1, \dots, m_N$ such that $ |I_k| \leq 1 $, consequently because of the necessary self-inversion:
$$ \det(\mathbf{A}_{I}) = \epsilon \det(\mathbf{A}_{\overline{I}}) \quad \textrm{for all } I \subset \{ 1, \dots, N  \}$$
where $ \overline{I} $ is the complement of $I$.
I don't know whether the condition on the derivation helps, but I believe that it might be possible to use the self-inversion to exclude some matrices in the original question.
