Indexed text attachment
coherent-specialization-on-graalvm.tex
Source for Coherent Specialization on GraalVM
View paper · Download original file
Lines 463–562 of 803. Source text is displayed literally.
463\centering464\includegraphics[width=\textwidth]{figures/fermion-field.pdf}465\caption{Probability from the compiled two-particle field. (a) The probability466for each occupation of the four sites with interaction $v=1.25$. The digits in467$n_0n_1n_2n_3$ list sites from left to right. (b) The probabilities that both particles468occupy neighboring sites for $v=1.25$ and the $v=0$ control. Both runs begin469with sites 0 and 1 occupied and use the same hopping and onsite energies.}470\label{fig:field-sweep}471\end{figure*}472 473\section{Time-resolved observables and an interaction control}474\label{sec:sweep-dynamics}475 476Both figures sample $t=0,0.04,\ldots,4$. Each sample binds the matrix coefficients for that absolute time and applies the resulting CatPE kernel family to the original state $\psi(0)$. Thus the sampling interval sets the resolution of the plots. The independent reference calculations provide separate checks of the amplitudes. The displayed probabilities are computed from the Graal execution as squared moduli, which retain the population of each configuration while summing to one for normalized inputs under exact evolution.477 478\paragraph{Free packet on the ring.}479Figure~\ref{fig:electron-sweep} tracks $\rho_j(t)=|\psi_j(t)|^2$ on the 12-site ring. The initial packet is centered at site~3 with width $1.3$ sites and carrier mode~2. With the orientation from $j$ to $j+1$, the bond probability current and discrete continuity equation are480\begin{align*}481J_j(t)&=\frac{\operatorname{Im}(\overline{\psi_j(t)}\psi_{j+1}(t))}{ma^2},\\482\frac{d}{dt}\rho_j(t)&=J_{j-1}(t)-J_j(t).483\end{align*}484These follow by differentiating $|\psi_j|^2$ and inserting the centered second-difference Hamiltonian. Summing the differences over the periodic grid cancels the current entering and leaving each bond. The conserved net oriented current $\sum_j J_j$ can also be computed from the Fourier weights since each mode's magnitude remains constant.485 486The strongest density moves from site~3 to site~10 between the first and last samples. Its maximum decreases from about $0.307$ to $0.213$ as the packet spreads. The dimensionless carrier wavenumber $q_0=2\pi(2/12)$ has positive slope in the dispersion relation, $E'(q_0)=\sin(q_0)/(ma^2)$, which gives about $1.77$ sites per unit time. This number describes the carrier's group velocity. Each Fourier mode has its own phase evolution, so the peak location and width reflect the full mode distribution. Site indices are interpreted modulo~12 throughout.487 488\paragraph{Joint occupancies in the field.}489For the four-site chain with two particles, let $\psi_{jk}(t)$ be the occupation-basis amplitude with sites $j<k$ occupied. The joint occupation probability and the marginal at site $j$ are490\begin{align*}491P_{jk}(t)&=|\psi_{jk}(t)|^2=\langle n_jn_k\rangle_t,\\492\langle n_j\rangle_t&=\sum_{k<j}P_{kj}(t)+\sum_{k>j}P_{jk}(t).493\end{align*}494Each configuration contributes to two site marginals, so the joint probabilities sum to one and the marginals sum to two. The associated connected correlation is $P_{jk}-\langle n_j\rangle_t\langle n_k\rangle_t$. Fixed particle number can give a nonzero connected correlation even at $v=0$. Summing $P_{j,j+1}$ gives the probability $A_v(t)$ of an adjacent pair. Equivalently, $A_v(t)=\langle D\rangle_t$ for $D=\sum_{j=0}^{2}n_jn_{j+1}$, a projection in this sector. Figure~\ref{fig:field-sweep} compares this observable at $v=1.25$ and $v=0$, using $g=0.8$, identical onsite potentials, and the same initial mask $3$ with occupied sites $0,1$. Initial energies in the two Hamiltonians differ by $v$ because $D\psi(0)=\psi(0)$. Each run conserves its own energy.495 496Both adjacent-pair curves start at one and initially satisfy $A_v(t)=1-g^2t^2+O(t^4)$, since only the hop from site~1 to site~2 can immediately create a separated pair. The interaction first contributes to the difference at fourth order. Set $\delta=\mu_1-\mu_2$. Expanding the amplitude of the separated configuration $\{0,2\}$ through cubic order gives497\begin{align*}498A_v(t)-A_0(t)499 &=\frac{g^2}{12}\big((\delta+v)^2-\delta^2\big)t^4500 +O(t^6).501\end{align*}502Indeed, the linear amplitude is the shared hop. At quadratic and cubic order the diagonal energies of the incident configurations enter, with gap $\delta+v$, while pure hopping contributions are shared. Other separated configurations are at least two hops away and have interaction-independent quartic probabilities. Reality of the Hamiltonian and the initial state makes each probability even in time. The parameters above give a leading difference of $t^4/60$, consistent with the observed difference of $4.262\times10^{-8}$ at $t=0.04$. At the largest sampled separation, at $t=2.76$, the adjacent-pair probabilities are about $0.847$ with interaction and $0.566$ in the control. At $t=4$ the probabilities are $0.721$ and $0.816$, respectively. The effect measured here is a redistribution among occupation configurations in a closed, coherently evolving finite chain.503 504\subsection{Time sweeps as restrictions of observations}505\label{sec:sweep-semantics}506 507Fix a Hamiltonian $H$, a dynamic state space $D$, and an ordered set of508observation labels $L$ with an orthogonal projector $P_\ell$ for each509$\ell\in L$. A label can denote a site, an unordered occupation pair,510or the subspace spanned by all adjacent pairs. The static context consists511of a time and an observation label. In the notation of512Section~\ref{sec:descent}, take $S=\mathbb R\times L$ and513\[514 F((t,\ell),\psi)=\|P_\ell U_H(t)\psi\|_2^2.515\]516For a finite sample $A\subseteq S$, let $O_A:D\to\mathbb R^A$ collect517the observations indexed by $A$. Time order and the chosen label order518give the display order. Inclusions $A\subseteq B$ in the sampling poset519give coordinate restrictions $\pi_{B,A}:\mathbb R^B\to\mathbb R^A$,520with $\pi_{B,A}O_B=O_A$. The identity follows coordinate by coordinate,521and restrictions compose along every chain of inclusions. The compiler522implements the time restriction by binding the matrix coefficients for523each sampled time. The residual rows still accept the state. A plotted524sweep supplies the same initial state to those rows at each time and525then takes the listed observations. Slicing the plot and evaluating526only the selected coordinates therefore agree when the compiler inputs,527arithmetic order, and observation rule are held fixed. The same528commutation holds for the rounded values produced by this independent529evaluation of each time.530 531Time composition makes a different comparison. The exact propagators532satisfy $U_H(t+s)=U_H(t)U_H(s)$. To compare a sequence of rounded steps533with this law, write $x_0=\psi$, $x_i=K_{\delta_i}(x_{i-1})$ for534executions of compiled kernels and define535$e_i=\|x_i-U_H(\delta_i)x_{i-1}\|_2$. With536$y_i=U_H(\delta_1+\cdots+\delta_i)\psi$,537\begin{align*}538 x_i-y_i&=x_i-U_H(\delta_i)x_{i-1}\\539 &\quad+U_H(\delta_i)(x_{i-1}-y_{i-1}),\\540 \|x_n-y_n\|_2&\leq\sum_{i=1}^n e_i .541\end{align*}542The bound uses the triangle inequality and the exact unitarity of543$U_H(\delta_i)$. Each $e_i$ includes coefficient generation and544arithmetic error at that step's actual input. The discrepancy with545one compiled application at $t=\sum_i\delta_i$ is bounded by adding546$\|K_t(\psi)-U_H(t)\psi\|_2$. For normalized $\psi$ and a state error547at most $\varepsilon$, the change in an exact projector probability548is at most $(2+\varepsilon)\varepsilon$ by Cauchy--Schwarz and549$\|P_\ell\|\leq1$. Computing that probability in binary64 adds its own550rounding error. These bounds explain what the observed composition551defects measure on a tested trajectory. A bound over all inputs would552require uniform control of the local errors.553 554\section{Reproducible checks}555\label{sec:evidence}556 557The artifact was tested on Linux x86-64 using GraalVM Community55824.0.2 and Truffle, GraalJS, and GraalPy 24.2.2. All eight JUnit tests passed559in the traced build. The trace test requested synchronous compilation560only for CatPE kernel roots. The Graal log reported completed tier-2561compilations of all three word kernels and of every output row in both562quantum examples. In the forest run, the trace also recorded a