Adapting the code to another model¶
The method applies to any causal two-time equations of the form shown on the home page: a local term \(-\mu(t)A(t,t')\), memory integrals with kernels that depend on \(C\) and \(R\), and possibly a forcing term. The released program, however, has the equations of the mixed spherical \(p\)-spin model built in; there is no interface for supplying other kernels. Changing the model means editing the source files listed below. The grid generation, the interpolation, the quadrature, the search routines, the sparsification and the time integration contain nothing specific to the model and need no changes.
Where the model enters¶
- The covariance function \(f\) and its first three derivatives:
flambda,Dflambda,DDflambda,DDDflambdainsrc/math/math_ops.cpp, and their GPU counterparts insrc/math/math_ops.cu. The model parameters \(p\), \(s\), \(\lambda\) are copied to GPU constant memory bycopyParametersToDevice. - The memory kernels \(D=f'(C)\) (
SigmaK) and \(K=f''(C)\,R\) (SigmaR), and their derivatives with respect to \(C\) and \(R\) (SigmaK10,SigmaK01,SigmaR10,SigmaR01), insrc/math/math_sigma.cppandsrc/math/math_sigma.cu. The GPU file contains a second, inlined copy of the kernels ineval_sigmaK_sigmaR_fused. - The equations of motion: which memory integrals enter the right-hand sides for \(C\) and \(R\), the local terms, the noise term \(2T\,R\) and the forcing by the initial condition, in
QKstep,QRstep(CPU) andQKRstepGPU(GPU) insrc/EOMs/time_steps.{cpp,cu}. The same files compute \(\mu(t)\) (rstep) and its time derivative (drstep,drstep2), i.e. the spherical constraint. - The energy, \(E(t)=-\int f'(C)R-\beta_0 f(C(t,0))\), which is evaluated for the output in
src/EOMs/time_steps.{cpp,cu}and again in several places insrc/io/. - The stability estimate \(\varrho=4\sqrt{f''(1)}\) in
src/core/initialization.cpp, which limits the step size (see Time integration).
The equations along the rays require the derivatives with respect to both time arguments (see Equations). For a new model these must be worked out first.
Checking a modified model¶
- Compare the CPU and the GPU backend with each other on a short run; they should agree to within the tolerance.
- If the model has an exactly solvable limit, compare with it, as the regression test
tests/run_regression.pydoes for the pure \(p=2\) model. - Check that \(C(t,t)=1\) and \(R(t,t^-)=1\) remain satisfied, and that the results converge when \(L\) is increased and
-eis decreased.