-
-
Notifications
You must be signed in to change notification settings - Fork 419
Open
Description
This issue does NOT appear with Julia v1.11. First develop the package:
import Pkg; Pkg.develop("SciBmad")
Then, using Julia v1.12, run the following script in both a fresh terminal and in an .ipynb
file (I use Jupyter lab) with a fresh kernel:
using SciBmad
K1 = 0.36;
K2 = 0.1;
qf = Quadrupole(Kn1=DefExpr(() -> +K1), L=0.5);
sf = Sextupole(Kn2=DefExpr(() -> +K2), L=0.2);
d = Drift(L=0.6);
b = SBend(L=6.0, angle=pi/132);
qd = Quadrupole(Kn1=DefExpr(() -> -K1), L=0.5);
sd = Sextupole(Kn2=DefExpr(() -> -K2), L=0.2);
fodo_line = [qf, sf, d, b, d, qd, sd, d, b, d];
fodo = Beamline(fodo_line, species_ref=Species("electron"), E_ref=18e9);
@time t = twiss(fodo); # This function has been precompiled using PrecompileTools.jl
In the .ipynb
, the output is:
1.936909 seconds (4.12 M allocations: 207.496 MiB, 1.92% gc time, 99.41% compilation time: 68% of which was recompilation)
In the terminal, the output is:
0.378638 seconds (455.82 k allocations: 23.735 MiB, 96.82% compilation time: <1% of which was recompilation)
Metadata
Metadata
Assignees
Labels
No labels