Indexed text attachment
coherent-specialization-on-graalvm.tex
Source for Coherent Specialization on GraalVM
View paper · Download original file
Lines 403–502 of 803. Source text is displayed literally.
403\begin{align*}404U(t)&=F^*\operatorname{diag}(e^{-itE_k})F,\\405U(t)_{j\ell}&=\frac1N\sum_{k=0}^{N-1}\omega^{k(j-\ell)}e^{-itE_k}.406\end{align*}407The first identity uses the scalar differential equation in each mode. The second gives a kernel depending only on the displacement $j-\ell$ modulo $N$. The compiler evaluates the $N$ displacement coefficients before binding the static parameters for time $t$.408 409Exactly, $U(0)=I$, $U(t+s)=U(t)U(s)$, and $U(t)^*=U(-t)$. These equalities follow by multiplying diagonal factors. They give a continuous functor $B(\mathbb R,+)\to B\mathrm U(N)$ between one-object topological categories. Passing to their nerves yields coherent composition of the time-indexed algorithms. The distinction between a static time setting and a dynamic state is visible in the family $\mathbb R\times\mathbb C^N\to\mathbb C^N$ with value $(t,\psi)\mapsto U(t)\psi$. It is the state argument that remains after specialization.410 411Writing $U=A+iB$, the real-linear image of $U$ sends $(x,y)$ to $(Ax-By,Bx+Ay)$. This realification preserves composition and sends the complex adjoint to the real transpose. Matrix entries are bound as binary64 static data, with one residual scalar kernel per real or imaginary output coordinate. This factorization separates the Fourier calculation of the operator from repeat invocation on different input states. The source emits a fixed order of floating-point operations. The exact functorial equalities belong to the mathematical operator, and the binary64 kernels approximate them to numerical tolerances on the measured inputs.412 413An independent reference path evolves a state by performing the forward transform, phase rotation in frequency space, and inverse transform directly. For a test with a nonconstant phase and a localized envelope, the generator supplies the normalized state414\[415\psi_j=C\exp\!\left(-\frac{d(j,c)^2}{4\sigma^2}\right)\omega^{p j},416\]417where $d(j,c)=\min(|j-c|,N-|j-c|)$, $c$ is its center, $\sigma>0$ is its width in sites, and $p$ is a carrier mode. The exact evolution preserves $\|\psi\|^2$ and $\langle\psi,H\psi\rangle$ since $U(t)$ is unitary and commutes with $H$. The energy can be checked in position space using the separate formula418\[419\langle\psi,H\psi\rangle=\frac{1}{2ma^2}420 \sum_{j=0}^{N-1}|\psi_{j+1}-\psi_j|^2.421\]422Expanding the squares and using cyclic indexing proves this identity. The direct energy computation and the reference Fourier calculation exercise different numerical routes through the model. Applying the negative-time operator gives a further check of reconstruction. The lattice calculation uses no temporal stepper, so discrepancies in these checks reflect floating-point effects or implementation defects.423 424\section{Interacting fermions on an open chain}425\label{sec:fermion-field}426 427The field compiler starts from a finite lattice Hamiltonian with $L$ spinless sites. The fermionic Fock space is $\bigoplus_{p=0}^L \bigwedge^p\mathbb C^L$. Occupation basis vectors are indexed by bit masks $m$, with the $j$th bit indicating whether site $j$ is occupied. Ordered creation operators fix the sign convention. Let $c_j$ annihilate a fermion at site $j$ and let $c_j^\dagger$ create one there. On a basis vector, an admissible action multiplies by $(-1)^{\sum_{k<j}m_k}$ before changing bit $j$. An inadmissible action yields zero \cite{fermionnotes}.428 429Write $n_j=c_j^\dagger c_j$. With real hopping $g$, interaction $v$, and onsite energies $\mu_j$, the open-chain Hamiltonian is430\begin{align*}431H={}&\sum_{j=0}^{L-1}\mu_j n_j432 + v\sum_{j=0}^{L-2}n_jn_{j+1} \\433 &-g\sum_{j=0}^{L-2}434 (c_{j+1}^\dagger c_j+c_j^\dagger c_{j+1}).435\end{align*}436The density-density term assigns energy to pairs of occupied adjacent sites and is quartic in the field operators. For an allowed hop from $j$ to $k$, the compiler computes the annihilation sign in the original occupation and the creation sign in the intermediate occupation. Both signs matter even though their product is positive for adjacent sites in this ordering. The onsite and interaction terms preserve occupation. Each hop removes one particle and adds one, so $H$ preserves every eigenspace of $\sum_j n_j$. On the $p$-particle sector $\mathcal H_p$, the matrix $H_p$ has dimension $\binom{L}{p}$ and is real symmetric. The inclusion $\iota_p:\mathcal H_p\hookrightarrow\mathcal F$ satisfies $H\iota_p=\iota_p H_p$. Taking powers and summing the exponential series proves437\[438e^{-i\tau H}\iota_p = \iota_p e^{-i\tau H_p}.439\]440The compiler therefore works in the chosen sector without approximating transitions to other particle numbers.441 442In exact arithmetic, $U_p(\tau)=\exp(-i\tau H_p)$ is a unitary evolution, with $U_p(0)=I$ and $U_p(\tau+\sigma)=U_p(\tau)U_p(\sigma)$. This is a functor from the one-object category of the additive time group to the category of finite-dimensional complex Hilbert spaces and linear maps. Realification sends a complex-linear operator to the real-linear operator on its real and imaginary coordinates and preserves composition and adjoints. If $U_p=A+iB$, its action in those coordinates is443\[444 (x,y)\longmapsto (Ax-By, Bx+Ay).445\]446This yields the scalar-output lowering. The interface interleaves real and imaginary coordinates and evaluates one CatPE \texttt{f64} kernel for each output coordinate. The dynamics still act on all amplitudes together through the shared input tuple.447 448The static phase uses Apache Commons Math to diagonalize the real-symmetric $H_p$ \cite{commonsmath}. If $H_p=Q\Lambda Q^\top$ with orthogonal $Q$, then $U_p(\tau)=Q\exp(-i\tau\Lambda)Q^\top$. The compiler binds the resulting binary64 matrix entries as static coefficients. The dynamic phase receives only the input amplitudes. Arithmetic rounding applies to the eigendecomposition, phase evaluation, and generated dot products. Consequently, the numerical implementation checks conservation and agreement within tolerances. The identities for number sectors and composition of the exact operators are mathematical statements about the model.449 450The reproducible fixture uses $L=4$, $p=2$, $g=0.8$, $v=1.25$, and onsite energies $(0.1,-0.2,0.3,-0.1)$. Its six masks, in order, are $(3,5,6,9,10,12)$. The initial vector for mask $3$ places two fermions on the first two sites. An independent check evaluates the degree-$48$ Taylor polynomial in $-i\tau H_p$ by repeated matrix-vector products. For $r=\|\tau H_p\|_\infty\leq4$, its exact remainder is at most $e^{r}r^{49}\|\psi\|_\infty/49!$. Indeed, submultiplicativity bounds the tail by $\|\psi\|_\infty \sum_{k\geq49}r^k/k!$, and $(49+j)!\geq49!j!$. This bounds the reference truncation error separately from floating-point roundoff. The construction targets finite lattices and dense evolution matrices. It enumerates $2^L$ masks and considers $O(Ld)$ hops for $d=\binom{L}{p}$. Dense matrix storage is quadratic in $d$, and spectral construction scales cubically. The sector dimension grows exponentially at fixed filling strictly between zero and one.451 452\begin{figure*}[t]453\centering454\includegraphics[width=\textwidth]{figures/free-electron.pdf}455\caption{Probability from the compiled periodic free-electron evolution. (a) Site456probability $|\psi_j(t)|^2$ at all 101 sampled times. The upper and lower sites457are neighbors on the ring. (b) Three slices show the evolving spatial profile.458The dashed lines in (a) locate the later two slices.}459\label{fig:electron-sweep}460\end{figure*}461 462\begin{figure*}[t]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.