\section{The problem}\label{sec:model} All logarithms are natural. A classical memory has $D$ states and a quantum memory is a register of dimension $D$. We use $\diamond\in\{\mathrm{cl},\mathrm q\}$ to select the memory type and write \begin{equation}\label{eq:linear-memory-size} r_D=\begin{cases}D&\diamond=\mathrm{cl},\\D^2&\diamond=\mathrm q. \end{cases} \end{equation} These are the dimensions of the real linear spaces containing a probability row or a Hermitian matrix. Normalization leaves $D-1$ or $D^2-1$ free coordinates, but linear forecast matrices can have rank $D$ or $D^2$. We use $r_D$ for that rank bound. \subsection{The source} A hidden Markov source has $n$ hidden states and a finite alphabet $\mathcal A$. It is specified by $n\times n$ matrices $T_a=T^a$, one for each symbol, whose entries are positive and whose sum is row-stochastic. The entry $T_a(i,j)$ is the probability of emitting $a$ and moving from hidden state $i$ to $j$. The matrices are known to the device. Their sum has a unique stationary row $\pi$, and we use the stationary source: if $Z_t$ is the hidden state after the symbol $X_t$, then $Z_t\sim\pi$ and \[ \Pr(X_{t+1}=a,Z_{t+1}=j\mid X_{\le t},Z_{\le t})=T_a(Z_t,j). \] For an observed past $H$, let $p_H$ be the conditional distribution of the current hidden state, written as a row. We call it the \emph{posterior}. For any row $p$ of hidden-state probabilities, write $P_p$ for the law of the future when the hidden state starts with distribution $p$. Then \begin{equation}\label{eq:affine-simplex} P_p=\sum_{i=1}^np_iP_{e_i},\qquad \mathcal F_a(p)=\frac{pT_a}{pT_a\mathbf1}, \end{equation} where $e_i$ is the $i$th point mass and $\mathcal F_a$ is the update of the posterior when $a$ is observed. For a word $w=a_1\cdots a_k$ put $T_w=T_{a_1}\cdots T_{a_k}$ and $\mathcal F_w(p)=pT_w/(pT_w\mathbf1)$. Then \begin{equation}\label{eq:source-word-conditioning} \Pr(X_{t+1:t+|w|}=w\mid X_{\le t})=p_{X_{\le t}}T_w\mathbf1, \qquad p_{Hw}=\mathcal F_w(p_H). \end{equation} These identities hold first for finite histories; martingale convergence gives them for the full past. If $\varpi=\min_{a,i}(T_a\mathbf1)_i$, every conditional word probability is at least $\varpi^{|w|}>0$. The conditional law of the future given the past $H$ is $P_{p_H}$. It depends on $H$ only through the posterior, but the posterior usually takes infinitely many values. \subsection{The device and its error} The device reads the symbols of the source one at a time. When it reads $a$, a classical device replaces its current state $s$ by a random state drawn from row $s$ of a fixed stochastic matrix $K_a$. A quantum device applies a fixed trace-preserving completely positive (CPTP) map $\Phi_a$ to its density matrix on $\mathbb C^D$. The symbol comes from the source; it is not obtained by measuring the memory. A quantum update must be a valid channel on every input. At a chosen time, the \emph{cut}, reading stops and the device must produce the future itself. It may first apply one fixed channel to its memory. It then emits symbols through nonnegative matrices, one for each symbol, whose sum is stochastic, or through completely positive maps whose sum is trace preserving. Reading and generating use the same memory, and everything the device keeps from one step to the next counts in $D$. Let $Q_H$ be the law of the generated future given the observed past $H$, after averaging over the device's own randomness. The error is \begin{equation}\label{eq:risk} \mathcal R=\E_H\KL(P_{p_H}\Vert Q_H),\qquad \KL(P\Vert Q)=\sup_{k\ge1}\KL(P_{1:k}\Vert Q_{1:k}), \end{equation} where $P_{1:k}$ is the law of the first $k$ symbols and $\KL(P_{1:k}\Vert Q_{1:k})=\sum_wP(w)\log(P(w)/Q(w))$. This is the divergence between the laws of the entire future; it is not divided by the length of the future. We call $\mathcal R$ the \emph{risk}. The averaging matters. By convexity, if $S$ is the memory state, \[ \E_H\KL\bigl(P_{p_H}\Vert\E[Q_S\mid H]\bigr) \le\E_{H,S}\KL(P_{p_H}\Vert Q_S). \] The right-hand side scores each memory state separately and can need much more memory. We use the left-hand side: the device is judged by the distribution of what it generates after each past. \paragraph{Admitted devices.} The device is stationary and causal. For a classical device this means a jointly stationary law of $(X_t,S_t)_{t\in\mathbb Z}$ with the source as its first marginal, such that \begin{align} \Pr(S_t=s'\mid X_{\le t},S_{t}\mid X_{\le t}.\label{eq:nonanticipating} \end{align} The second condition says that the memory carries no information about future symbols beyond what the observed past carries. No other condition is imposed in the lower bounds. For a quantum device, let $\mathcal H=\mathcal A^{\mathbb Z_{\le0}}$ be the space of observed pasts. One measurable function $\rho$ on $\mathcal H$ assigns a density matrix to each past, the register at time $t$ is in the state $\rho(X_{\le t})$, and $\rho(Ha)=\Phi_a(\rho(H))$ for almost every $H$ and every symbol $a$. The generated law is linear in this density matrix, as the classical generated law is linear in the conditional distribution $\xi_H$ of the memory state. The device may use fresh independent randomness and temporary workspace at each step. Anything it retains, such as a record of earlier outcomes, a random seed or a system entangled with the register, is part of the memory and counts in $D$. In particular a random choice between different update rules is not free: the device would have to remember which rule it chose. The fixed description of the update rules is not counted. The maps may have arbitrary real coefficients; we do not study finite precision or total hardware cost. For a source $S$, let $\Gc_D(S)$ and $\Gq_D(S)$ be the infima of the risk over classical and quantum devices of size $D$, and write $G_D^\diamond(S)$ for either. Let $\Mc(\varepsilon;S)$ and $\Mq(\varepsilon;S)$ be the least sizes of devices with risk at most $\varepsilon$. \begin{lemma}\label{lem:causal-update} The conditional distribution of the classical memory state, $\xi_H=\Pr(S_t\in\cdot\mid X_{\le t}=H)$, satisfies $\xi_{Ha}=\xi_HK_a$. For a word $w=a_1\cdots a_k$ write $K_w=K_{a_1}\cdots K_{a_k}$ and $\Phi_w=\Phi_{a_k}\circ\cdots\circ\Phi_{a_1}$. Then $\xi_{Hw}=\xi_HK_w$ and $\rho(Hw)=\Phi_w(\rho(H))$ for every word, on one set of pasts of full measure. \end{lemma} \begin{proof} Condition~\eqref{eq:nonanticipating} at time $t-1$ gives $\Pr(S_{t-1}=s\mid X_{\le t})=\Pr(S_{t-1}=s\mid X_{\le t-1})$. Conditioning \eqref{eq:causal-kernel} on $X_{\le t}$ therefore gives $\xi_{Ha}(s')=\sum_s\xi_H(s)K_a(s,s')$ on $\{X_t=a\}$. The quantum identity is part of the model. Iteration gives the word identities. There are countably many words and each has positive conditional probability, so one set of full measure serves all of them. \end{proof} \subsection{From hidden-state error to entire-future error} A device that starts the exact source from a slightly wrong hidden-state distribution makes a small error on the entire future. \begin{lemma}\label{lem:hidden-kl} For any $n$-state source and probability rows $p,q$ with $q_i>0$, \begin{equation}\label{eq:hidden-kl-simplex} \KL(P_p\Vert P_q)\le\KL(p\Vert q) \le\sum_i\frac{(p_i-q_i)^2}{q_i}. \end{equation} \end{lemma} \begin{proof} At every finite horizon the future is obtained from the initial hidden state by a fixed random map. Such a map cannot increase the divergence, and the divergence is at most the chi-square distance; taking the supremum over horizons proves \eqref{eq:hidden-kl-simplex}. \end{proof}