vectorize element_pass, line_pass and ring_pass to track several particles in a single call;
expose these vectorized methods to python package;
improve line_pass to accept an input argument indices defining which positions along the ring to return the particles positions. Indices may have integers from 0 to len(ring);
when turn_by_turn is true, ring_pass will return the position at the beginning of every pass, including the first one and the position of the particle at the end of the last turn.
python wrappers for tracking functions now accept numpy arrays as input and output and conversion to vectors of positions is done in c++ not in python. The speed gains are considerable when the number of convertions is large:
element_pass
,line_pass
andring_pass
to track several particles in a single call;line_pass
to accept an input argumentindices
defining which positions along the ring to return the particles positions. Indices may have integers from0
tolen(ring)
;turn_by_turn
istrue
,ring_pass
will return the position at the beginning of every pass, including the first one and the position of the particle at the end of the last turn.numpy
arrays as input and output and conversion to vectors of positions is done in c++ not in python. The speed gains are considerable when the number of convertions is large:old: CPU times: user 27.2 s, sys: 119 ms, total: 27.3 s Wall time: 27.2 s
new: CPU times: user 1.88 s, sys: 161 ms, total: 2.04 s Wall time: 2.03 s
------------------------------------------------------------------------
bun.shape == (6, 1000) bpms.shape==(160, ) out, *args = pyaccel.tracking.line_pass(ring, bun, indices=bpms) out.shape == (6, 1000, 160)
old: CPU times: user 2.61 s, sys: 48.8 ms, total: 2.65 s Wall time: 2.59 s
new: CPU times: user 1.72 s, sys: 25 ms, total: 1.74 s Wall time: 1.74 s