Mixed States, Gibbs States, and Temperature I am trying to help myself clarify some concepts. The purpose of this post is twofold: 1) to get some comments/feedback, and 2) to help me organize my thoughts. I have been approaching these concepts from a more mathematical point of view, but quickly realize that this seems to be not enough.
Assumption: I am considering a closed system.
Here are the definitions that I am using:
Mixed states by definition are operators of the form
\begin{align}
\rho = \sum_{n} p_n|\psi_n\rangle\langle\psi_n|
\end{align}
where $p_n\ge 0$ and $\sum_n p_n = 1$. For convenience, I assume the sequence $\{\psi_n\}$ is an orthonormal family of vectors in some Hilbert space $\mathcal{H}$ (infinite dimensional, say $\mathcal{H}= L^2(\mathbb{R}^n)$). Note that this definition also contains pure states.
A Gibbs State by definition is a mixed state of the form
\begin{align}
\rho_G = \frac{e^{-\beta H}}{Z}= Z^{-1}\sum_n e^{-\beta E_n}|E_n\rangle\langle E_n|
\end{align}
where $H=\sum_n E_n |E_n\rangle\langle E_n|$ and $\{|E_n\rangle\}$ (clearly an abuse of notation) is the family of eigenfunctions of $H$. Let us assume $\beta\ge 0$ and $Z:=\operatorname{Tr}(e^{-\beta H})<\infty$.
Lastly, we define the temperature of $\rho_G$ by $T:= 1/(k\beta)$ where $k$ is some constant (for simplicity, let us take $k=1$). Note that this means that temperature is dependent on the Hamiltonian.
Observations:
It is clear to me that the set of mixed states is clearly larger than the set of Gibbs states. The claim comes from the observation that $\rho = \frac{1}{2}\left(|\psi_1\rangle\langle \psi_1|+|\psi_2\rangle\langle \psi_2|\right)$ cannot be written as a Gibbs state since the spectrum of
\begin{align}
 H= -\Delta+V \ \ \ (1)
\end{align}
is usually countably infinite at the very least (am I wrong?) This means that infinitely many $p_n$ are zero so that $e^{-\beta E_n} = 0$ implies $E_n=0$ or $T = \infty$. However, no one is demanding me to assume $H=-\Delta+V$. In fact, in theory, we could consider $H= E_1|\psi_1\rangle\langle\psi_1|+ E_2|\psi_2\rangle\langle\psi_2|$ (a 2-level system). Then, we have the Gibbs states
\begin{align}
\rho_G(\beta) = Z^{-1}(e^{-\beta E_1}|\psi_1\rangle\langle\psi_1|+e^{-\beta E_2}|\psi_2\rangle\langle\psi_2|).
\end{align}
Questions:

*

*Given a mixed state, can we view it as a Gibbs state of some Hamiltonian? (From a physics perspective, this question doesn't make too much sense.)

*Given a mixed state, can we associate a temperature to it intrinsically? (From my first question, it is clear that you can't since, there, the temperature depends on the Hamiltonian.)

In these questions, I have completely ignored the physics and just view the objects mathematically (computationally).
 A: Gibbs states are defined by the KMS condition not by the alegbraic expression. In a Hilbert space $ \mathcal{H}_d$ of dimension $d < \infty$, any state $\rho$ with rank $k\leq d$ can be interpreted as a Gibbs state with an arbitrary temperature $\beta$ and Hamiltonian $H$ like, $$ \rho  = \frac{e^{-\beta H}}{ Z_\beta^H}$$
For states with less than full rank, one must define the Hamiltonian $H$ (and the corresponding dynamical flow) appropriately on a subspace. So, the set of all mixed states is identical to the set of Gibbs states.
The answer to your second question (2.) is a bit more delicate, the state $\rho$ does not describe the system but a only a preparation procedure of the thermal ensemble. Therefore, one cannot define a temperature of the system by specifying just a density matrix $\rho$.
Also, please note that the $\beta$ occuring in the expression is the temperature of the canonical bath and is not a feature of the system.
However, given a Hamiltonian of the system, one may infer the temperature by performing projective measurements in the energy eigenbasis. Alternatively, one may also perform tomography on a dynamical sequence of states to infer the temperature using the microcanonical expression, $$ \frac{\partial S}{\partial E} = \beta,$$
where $S$ is the von Neumann entropy and $E$ is the internal energy of the ensemble defined by $$E = \mbox{Tr}[\rho H]$$
