If the cohomology of two objects in the derived category are equal, are the objects isomorphic? Let $\mathcal{A}$ be an abelian category. Given objects $A^\bullet,B^\bullet$ in the derived category $D(\mathcal{A})$. Assume that $H^n(A^\bullet)=H^n(B^\bullet)$ for all $n\in\mathbb{Z}$. Can we deduce that $A^\bullet$ is isomorphic to $B^\bullet$ in $D(\mathcal{A})$? 
 A: Restricting to the bounded derived category, this is equivalent to asking the following

Question: Given $X\in\textbf{D}^b({\mathscr A})$, is $X\cong\bigoplus_n \Sigma^{-n}\text{H}^n(X)$ in $\textbf{D}^b({\mathscr A})$?

Answer: This is true for all $X$ precisely if ${\mathscr A}$ is hereditary, i.e. $\text{Ext}_{\mathscr A}^2(-,-)\equiv 0$.

Before coming to the proof, here's a very short observation hinting at why hereditarity is relevant here:
If $X$ is a complex over ${\mathscr A}$ and $n\in{\mathbb Z}$, there is a $2$-term exact sequence
$$0\to\text{H}^n (X)\to X^n / \text{im}(\delta_X^{n-1})\to \text{ker}(\delta_X^{n+1})\to \text{H}^{n+1} (X)\to 0,$$
and intuitively it seems plausible that the splitting property of $X$ as a sum of its cohomologies has something to do with the vanishing of this extension as a class in $\text{Ext}_{\mathscr A}^2(\text{H}^{n+1}(X),\text{H}^n(X))$. 

Proof that ${\mathscr A}$ hereditary implies the splitting property for all $X$:
The proof goes by induction on the width $w(X) := \max\{k\in{\mathbb Z}\ |\ X^k\neq 0\}-\min\{k\in{\mathbb Z}\ |\ X^k\neq 0\}$. If $w(X)=1$, the statement is clear, so let $w(x)\geq 2$ and suppoe wlog that $X^0\neq 0$ while $X^k=0$ for all $k>0$. Denoting $$\tau_{\leq -1} X\ \ :=\ \  \ldots\to X^{-2}\to X^{-1}\to \underline{\text{image}(\delta_X^{-1})}\to 0$$ the soft truncation of $X$ below $0$, there is a distinguished triangle in $\textbf{D}^b({\mathscr A})$: $$(\ddagger)\qquad\tau_{\leq -1} X\to X\to \text{H}^0(X)\to\Sigma\tau_{\leq -1} X$$ Now, $$\widetilde{\tau}_{\leq -1}X:=\ldots\to X^{-2}\to\text{ker}(\delta^{-1}_X)\to\underline{0}\to 0\to \ldots\quad\stackrel{\text{qis}}{\longrightarrow}\quad \tau_{\leq -1} X$$ is a quasi-isomorphism, and $w(\widetilde{\tau}_{\leq -1} X)=w(X)-1$, so by induction we have $\widetilde{\tau}_{\leq -1}X\cong\bigoplus_{n<0}\Sigma^{-n}\text{H}^n(X)$. But then the connecting homomorphism in $(\ddagger)$ is a sum of morphisms of the form $X\to\Sigma^k Y$ for $k\geq 2$, which vanish by our assumption that ${\mathscr A}$ is hereditary. Hence $(\ddagger)$ splits, and the claim follows.

Proof that the splitting property for all $X$ implies that ${\mathscr A}$ is hereditary:
Let $\alpha\in\text{Ext}_{\mathscr A}^2(X,Y)$. Then, view it as a morphism $X\to\Sigma^2 Y$ in $\textbf{D}^b({\mathscr A})$ and consider its cone $Z$, fitting into a distinguished triangle $$(\ddagger)\qquad X\stackrel{\alpha}{\to} \Sigma^2Y\to Z\to \Sigma X.$$ The long exact cohomology sequence shows that $\text{H}^{-1}(Z)\cong X$ and $\text{H}^{-2}(Z)\cong Y$, while all other cohomology groups vanish, so we deduce $Z\cong \Sigma X\oplus \Sigma^2 Y$. There is no non-zero morphism $\Sigma^2Y\to \Sigma X$ in $\textbf{D}^b({\mathscr A})$, so the triangle $(\ddagger)$ looks like
$$X\stackrel{\alpha}{\to} \Sigma^2Y\stackrel{\scriptsize\begin{pmatrix} 0 \\ \psi\end{pmatrix}}{\longrightarrow} \Sigma X\oplus\Sigma^2 Y\stackrel{\scriptsize\begin{pmatrix} \varphi & 0 \end{pmatrix}}{\longrightarrow} \Sigma X.$$ Since distinguished triangles are $\text{Hom}$-exact, we see that the inclusion $\Sigma^2 Y\hookrightarrow \Sigma X\oplus\Sigma^2Y$ factors through $\Sigma^2 Y\stackrel{\scriptsize\begin{pmatrix} 0 & \psi\end{pmatrix}^t}{\longrightarrow} \Sigma X\oplus \Sigma^2 Y$ by means of a morphism $\tau: \Sigma^2Y\to\Sigma^2Y$, i.e. $\psi\tau=\text{id}_{\Sigma^2Y}$. But then $\text{id}-\tau\psi$ factors through $X\to\Sigma^2Y$, forcing it to be $0$ since also $\textbf{D}^b({\mathscr A})(\Sigma^2Y,X)=0$. Hence $\scriptsize\begin{pmatrix} 0 & \psi\end{pmatrix}$ is a split monomorphism, forcing $\alpha$ to vanish.
