Let $X\_0$ be a trace-one positive definite matrix, i.e. $X\_0>0$, $\mathrm{tr}(X\_0)=1$. Let $A>0$ and consider the following iteration
$$
X\_{k+1} = X\_k^{1/2}AX\_k^{1/2},\quad k\geq 0,\quad (\star)
$$
where $X\_k^{1/2}$ denotes the (principal) square root of $X\_k$.


**My question:** Is it true that the above iteration is trace-preserving starting *from all* $X\_0$'s as above, i.e. $\mathrm{tr}(X\_{k+1})=\mathrm{tr}(X\_{k})=1$ for all $k\geq 0$, (if and) only if $A=I$?


**N.B.** After a discussion with Nawaf Bou-Rabee, I decided to restore the original formulation of my question and accept his answer. However, I opened a [new OP](https://mathoverflow.net/questions/249780/trace-of-a-nonlinear-matrix-equation-contd) where you can find the edited version, which is still open.



Trace of a nonlinear matrix equation
1. If $A=I$, then it follows from the iteration rule that $\mathrm{tr}(X\_{k})=1$ for all natural number $k \ge 0$.
2. If $\mathrm{tr}(X\_{1})=\mathrm{tr}(X\_{0})$, then the given iteration rule implies that: $$
\mathrm{tr}((A - I) X) = 0 \quad \forall X : X > 0 ~\&~ \mathrm{tr}(X) = 1 \;. \tag{$\star$}
$$ If $X$ was allowed to be an arbitrary matrix, it would immediately follow that $A=I$. Still, as we will see, there is enough slack in the constraints on $X$ to still obtain $A=I$. To see this, let $\{ e\_i \}$ be the standard basis on $\mathbb{R}^n$ and for any $i \in \{1, \cdots, n \}$ define 
$$
X\_{ii} = (1-\epsilon (n-1)) e\_i e\_i^T + \sum\_{j \ne i} \epsilon e\_j e\_j^T
$$ where $\epsilon>0$ is a small parameter. Note that the sum of the eigenvalues of the matrix $X\_{ii}$ is one, and if $\epsilon$ is sufficiently small, then $X\_{ii}>0$. More importantly, letting $X=X\_{ii}$ in ($\star$) gives
$$
\mathrm{tr}((A - I) X\_{ii}) = (1-\epsilon (n-1) ) (A\_{ii}-1) + \epsilon \sum\_{j \ne i} (A\_{jj}-1) =0
$$ which implies that: 
$$
A\_{ii} = 1 - \frac{\epsilon}{1-\epsilon (n-1)} \sum\_{j \ne i} (A\_{jj}-1)
$$ Since $\epsilon$ can be made arbitrarily small, it follows that the diagonal entries of $A$ are all equal to one. 
One can similarly treat the off-diagonal terms by, e.g., defining
\begin{align\*}
X\_{ij} &= \frac{1}{2} (1-\epsilon (n-1) ) \left( e\_i e\_j^T + e\_j e\_i^T \right) \\
&+ (1-\epsilon (n-1) ) e\_i e\_i^T + (1-\epsilon (n-1) ) e\_j e\_j^T 
+ \sum\_{k \ne \{i,j\}} \epsilon e\_k e\_k^T
\end{align\*} which has unit trace and is a symmetric strictly diagonally dominant matrix, and hence, positive definite. Then setting $X=X\_{ij}$ in ($\star$) isolates the $A\_{ij}$ term for $i \ne j$.


