xtrack 0.96.0__tar.gz → 0.96.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. {xtrack-0.96.0/xtrack.egg-info → xtrack-0.96.2}/PKG-INFO +12 -2
  2. xtrack-0.96.2/tests/test_acdipole.py +263 -0
  3. xtrack-0.96.2/tests/test_acdipole_twiss.py +61 -0
  4. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_elements.py +45 -0
  5. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_elements_thick.py +1 -0
  6. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_native_madloader.py +17 -26
  7. xtrack-0.96.2/xtrack/_version.py +1 -0
  8. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/base_element.py +4 -3
  9. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/__init__.py +2 -1
  10. xtrack-0.96.2/xtrack/beam_elements/acdipole.py +222 -0
  11. xtrack-0.96.2/xtrack/beam_elements/elements_src/acdipole.h +61 -0
  12. xtrack-0.96.2/xtrack/beam_elements/elements_src/track_acdipole.h +69 -0
  13. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/line.py +23 -102
  14. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/mad_parser/loader.py +11 -4
  15. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/mad_parser/madx.lark +12 -11
  16. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/mad_parser/parse.py +13 -13
  17. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/prebuilt_kernel_definitions/element_types.py +2 -2
  18. {xtrack-0.96.0 → xtrack-0.96.2/xtrack.egg-info}/PKG-INFO +12 -2
  19. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack.egg-info/SOURCES.txt +5 -0
  20. xtrack-0.96.0/xtrack/_version.py +0 -1
  21. {xtrack-0.96.0 → xtrack-0.96.2}/LICENSE +0 -0
  22. {xtrack-0.96.0 → xtrack-0.96.2}/MANIFEST.in +0 -0
  23. {xtrack-0.96.0 → xtrack-0.96.2}/README.md +0 -0
  24. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/__init__.py +0 -0
  25. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/base_classes.py +0 -0
  26. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/BB6D.py +0 -0
  27. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
  28. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/__init__.py +0 -0
  29. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/beambeam.py +0 -0
  30. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/boost.py +0 -0
  31. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
  32. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
  33. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/qgauss.py +0 -0
  34. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/slicing.py +0 -0
  35. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/be_beamfields/spacecharge.py +0 -0
  36. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/elements.py +0 -0
  37. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/line.py +0 -0
  38. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/mathlibs.py +0 -0
  39. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/particles.py +0 -0
  40. {xtrack-0.96.0 → xtrack-0.96.2}/ducktrack/temp_pyparticles.py +0 -0
  41. {xtrack-0.96.0 → xtrack-0.96.2}/pyproject.toml +0 -0
  42. {xtrack-0.96.0 → xtrack-0.96.2}/setup.cfg +0 -0
  43. {xtrack-0.96.0 → xtrack-0.96.2}/setup.py +0 -0
  44. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_acceleration.py +0 -0
  45. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_amplitude_detuning.py +0 -0
  46. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_aperture_polygon.py +0 -0
  47. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_aperture_table.py +0 -0
  48. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
  49. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_apertures.py +0 -0
  50. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_atomic_add.py +0 -0
  51. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_attr_replicas_and_slices.py +0 -0
  52. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_boris_spatial.py +0 -0
  53. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_bucket_with_ref_energy_change.py +0 -0
  54. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_cavity_absolute_time.py +0 -0
  55. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_chromatic_functions_vs_madx.py +0 -0
  56. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_coasting.py +0 -0
  57. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_collective_tracker.py +0 -0
  58. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_collimation.py +0 -0
  59. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_coupling_edwards_teng.py +0 -0
  60. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_electron_cooler.py +0 -0
  61. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_element_characterization_functions.py +0 -0
  62. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_element_internal_record.py +0 -0
  63. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_elements_classflags.py +0 -0
  64. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_environment.py +0 -0
  65. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_fcc_ee_solenoid_correction.py +0 -0
  66. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
  67. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_footprint.py +0 -0
  68. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_freeze_longitudinal.py +0 -0
  69. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_full_rings.py +0 -0
  70. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_h6_sps_beamline.py +0 -0
  71. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_hvkick.py +0 -0
  72. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_ions.py +0 -0
  73. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_json.py +0 -0
  74. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_legacy_multiline_to_env.py +0 -0
  75. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_lhc_env.py +0 -0
  76. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_lhc_match_phase_15.py +0 -0
  77. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_line.py +0 -0
  78. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_load.py +0 -0
  79. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_load_vars.py +0 -0
  80. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_lumi.py +0 -0
  81. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_mad_writer.py +0 -0
  82. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_madloader.py +0 -0
  83. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_madnginterface.py +0 -0
  84. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_magnet.py +0 -0
  85. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_and_track_from_element.py +0 -0
  86. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_coupling_knob.py +0 -0
  87. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_nested.py +0 -0
  88. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_optics_and_ip_knob.py +0 -0
  89. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +0 -0
  90. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_orbit_bump.py +0 -0
  91. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_match_tune_chroma_cminus.py +0 -0
  92. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_misalign.py +0 -0
  93. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_monitor.py +0 -0
  94. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_multi_bunch_gauss.py +0 -0
  95. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_multiline.py +0 -0
  96. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_multisetter.py +0 -0
  97. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_multispecies.py +0 -0
  98. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_native_madloader_lhc.py +0 -0
  99. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_native_madloader_lhc_thin.py +0 -0
  100. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_native_madloader_ps.py +0 -0
  101. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_native_madloader_sps.py +0 -0
  102. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_native_madloader_ti2.py +0 -0
  103. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_optimize_for_tracking.py +0 -0
  104. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_particles.py +0 -0
  105. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_particles_basics.py +0 -0
  106. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_particles_pdg.py +0 -0
  107. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_pipeline.py +0 -0
  108. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_prebuild_kernels.py +0 -0
  109. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_ps_against_ptc.py +0 -0
  110. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_ps_multiturn_twiss.py +0 -0
  111. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_psb_chicane.py +0 -0
  112. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_pyht_interface.py +0 -0
  113. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_quadrupole_fringe_ptc.py +0 -0
  114. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_quadrupole_wedge.py +0 -0
  115. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_radial_steering.py +0 -0
  116. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_radiation.py +0 -0
  117. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_radiation_equilibrium_emittances.py +0 -0
  118. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_radiation_equilibrium_emittances_thick.py +0 -0
  119. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_radiation_integrals.py +0 -0
  120. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_random_gen.py +0 -0
  121. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_random_gen_exp.py +0 -0
  122. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_random_gen_gauss.py +0 -0
  123. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_random_gen_ruth.py +0 -0
  124. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_rbend_straight_body.py +0 -0
  125. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_rf_track.py +0 -0
  126. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_rotation_signs.py +0 -0
  127. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_second_order_taylor_map.py +0 -0
  128. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_seeds.py +0 -0
  129. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_slice_and_insert_with_replicas.py +0 -0
  130. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_slice_elements.py +0 -0
  131. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_slicing.py +0 -0
  132. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
  133. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_solenoid_bz_map_vs_boris_legacy.py +0 -0
  134. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_spacecharge_in_ring.py +0 -0
  135. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_spin.py +0 -0
  136. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_sps_thick_cpymad_loader.py +0 -0
  137. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_sps_thick_native_loader.py +0 -0
  138. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_survey.py +0 -0
  139. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_tapering.py +0 -0
  140. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_thick_kickers_rf_crab.py +0 -0
  141. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_thick_lhc.py +0 -0
  142. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_tilt_shifts.py +0 -0
  143. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_tracker.py +0 -0
  144. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_trajectory_correcton.py +0 -0
  145. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_twiss.py +0 -0
  146. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_twiss_to_file.py +0 -0
  147. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_twiss_vs_madx_psb.py +0 -0
  148. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_vs_madx.py +0 -0
  149. {xtrack-0.96.0 → xtrack-0.96.2}/tests/test_xmask_orbit_correction.py +0 -0
  150. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/__init__.py +0 -0
  151. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/__init__.py +0 -0
  152. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
  153. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
  154. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
  155. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/lhc_match/__init__.py +0 -0
  156. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
  157. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
  158. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/lhc_match/var_limits.py +0 -0
  159. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/python_lattice_writer/__init__.py +0 -0
  160. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/_temp/python_lattice_writer/lattice_py_generation.py +0 -0
  161. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/aperture_meas.py +0 -0
  162. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures.py +0 -0
  163. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
  164. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
  165. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
  166. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
  167. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
  168. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
  169. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/beam_interaction.py +0 -0
  170. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements.py +0 -0
  171. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/bend.h +0 -0
  172. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/cavity.h +0 -0
  173. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/crab_cavity.h +0 -0
  174. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/default_magnet_config.h +0 -0
  175. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/dipole_fringe.h +0 -0
  176. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
  177. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift.h +0 -0
  178. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_exact.h +0 -0
  179. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_exact_slice.h +0 -0
  180. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
  181. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
  182. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_cavity.h +0 -0
  183. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_crab_cavity.h +0 -0
  184. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_multipole.h +0 -0
  185. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
  186. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
  187. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_rbend.h +0 -0
  188. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
  189. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/drift_slice_uniform_solenoid.h +0 -0
  190. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/electroncooler.h +0 -0
  191. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/elens.h +0 -0
  192. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/exciter.h +0 -0
  193. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
  194. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/legacy_solenoid.h +0 -0
  195. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
  196. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/magnet.h +0 -0
  197. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/magnet_drift.h +0 -0
  198. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/magnet_edge.h +0 -0
  199. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/magnet_kick.h +0 -0
  200. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/marker.h +0 -0
  201. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/misalignment.h +0 -0
  202. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/multipole.h +0 -0
  203. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/multipoleedge.h +0 -0
  204. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
  205. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/octupole.h +0 -0
  206. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
  207. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/rbend.h +0 -0
  208. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
  209. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
  210. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
  211. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
  212. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
  213. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
  214. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/slnd.h +0 -0
  215. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/srotation.h +0 -0
  216. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/temprf.h +0 -0
  217. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
  218. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_cavity.h +0 -0
  219. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_crab_cavity.h +0 -0
  220. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_multipole.h +0 -0
  221. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
  222. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
  223. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_rbend.h +0 -0
  224. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
  225. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thick_slice_uniform_solenoid.h +0 -0
  226. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
  227. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
  228. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
  229. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_cavity.h +0 -0
  230. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_crab_cavity.h +0 -0
  231. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_multipole.h +0 -0
  232. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
  233. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_octupole_entry.h +0 -0
  234. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_octupole_exit.h +0 -0
  235. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
  236. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_entry.h +0 -0
  237. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_exit.h +0 -0
  238. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_rbend.h +0 -0
  239. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_rbend_entry.h +0 -0
  240. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_rbend_exit.h +0 -0
  241. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
  242. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole_entry.h +0 -0
  243. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole_exit.h +0 -0
  244. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_entry.h +0 -0
  245. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_exit.h +0 -0
  246. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
  247. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
  248. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +0 -0
  249. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_drift.h +0 -0
  250. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid.h +0 -0
  251. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid_multipolar_components.h +0 -0
  252. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid_radiation.h +0 -0
  253. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet.h +0 -0
  254. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet.template.h +0 -0
  255. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet_configure.h +0 -0
  256. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet_drift.h +0 -0
  257. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet_edge.h +0 -0
  258. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet_kick.h +0 -0
  259. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_magnet_radiation.h +0 -0
  260. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_misalignments.h +0 -0
  261. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_mult_fringe.h +0 -0
  262. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_rf.h +0 -0
  263. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_rf.template.h +0 -0
  264. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
  265. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_thick_bend.h +0 -0
  266. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_thick_cfd.h +0 -0
  267. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_wedge.h +0 -0
  268. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
  269. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_xyshift.h +0 -0
  270. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
  271. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/variable_solenoid.h +0 -0
  272. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/wedge.h +0 -0
  273. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/wire.h +0 -0
  274. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
  275. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
  276. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
  277. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
  278. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/exciter.py +0 -0
  279. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/rft_element.py +0 -0
  280. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/slice_base.py +0 -0
  281. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/slice_elements_drift.py +0 -0
  282. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/slice_elements_edge.py +0 -0
  283. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/slice_elements_thick.py +0 -0
  284. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/beam_elements/slice_elements_thin.py +0 -0
  285. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/boris.py +0 -0
  286. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/builder.py +0 -0
  287. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/environment.py +0 -0
  288. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/footprint.py +0 -0
  289. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/functions.py +0 -0
  290. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/general.py +0 -0
  291. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/atomicadd.h +0 -0
  292. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/checks.h +0 -0
  293. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/constants.h +0 -0
  294. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/particle_states.h +0 -0
  295. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/synrad_spectrum.h +0 -0
  296. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/track.h +0 -0
  297. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/headers/track_local_particle_with_transformations.h +0 -0
  298. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/internal_record.py +0 -0
  299. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/json.py +0 -0
  300. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/linear_normal_form.py +0 -0
  301. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/load.py +0 -0
  302. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/loss_location_refinement/__init__.py +0 -0
  303. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
  304. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/lumi.py +0 -0
  305. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/mad_loader.py +0 -0
  306. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/mad_parser/__init__.py +0 -0
  307. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/mad_writer.py +0 -0
  308. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/madng_interface.py +0 -0
  309. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/match.py +0 -0
  310. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/__init__.py +0 -0
  311. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/beam_position_monitor.h +0 -0
  312. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/beam_position_monitor.py +0 -0
  313. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/beam_profile_monitor.h +0 -0
  314. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/beam_profile_monitor.py +0 -0
  315. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/beam_size_monitor.h +0 -0
  316. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/beam_size_monitor.py +0 -0
  317. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/last_turns_monitor.h +0 -0
  318. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/last_turns_monitor.py +0 -0
  319. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/particles_monitor.h +0 -0
  320. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/monitors/particles_monitor.py +0 -0
  321. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/multiline.py +0 -0
  322. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/multiline_legacy/__init__.py +0 -0
  323. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/multiline_legacy/multiline_legacy.py +0 -0
  324. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/multiline_legacy/shared_knobs.py +0 -0
  325. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/multisetter/__init__.py +0 -0
  326. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/multisetter/multisetter.py +0 -0
  327. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/__init__.py +0 -0
  328. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/constants.py +0 -0
  329. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/masses.py +0 -0
  330. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/particles.py +0 -0
  331. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/pdg.py +0 -0
  332. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/rng_src/base_rng.h +0 -0
  333. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/particles/rng_src/particles_rng.h +0 -0
  334. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/pipeline/__init__.py +0 -0
  335. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/pipeline/core.py +0 -0
  336. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/pipeline/manager.py +0 -0
  337. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/pipeline/multitracker.py +0 -0
  338. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/prebuilt_kernel_definitions/__init__.py +0 -0
  339. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/prebuilt_kernel_definitions/element_inits.py +0 -0
  340. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/progress_indicator.py +0 -0
  341. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/__init__.py +0 -0
  342. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_generators.py +0 -0
  343. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_src/exponential.h +0 -0
  344. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
  345. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_src/normal.h +0 -0
  346. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_src/rutherford.h +0 -0
  347. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_src/uniform.h +0 -0
  348. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/random/random_src/uniform_accurate.h +0 -0
  349. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/slicing.py +0 -0
  350. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/survey.py +0 -0
  351. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/svgutils/__init__.py +0 -0
  352. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/svgutils/parser.py +0 -0
  353. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/svgutils/path.py +0 -0
  354. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/svgutils/svgutils.py +0 -0
  355. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/synctime.py +0 -0
  356. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/table.py +0 -0
  357. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/tapering.py +0 -0
  358. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/targets.py +0 -0
  359. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/track_flags.py +0 -0
  360. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/tracker.py +0 -0
  361. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/tracker_data.py +0 -0
  362. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/tracker_src/tracker.h +0 -0
  363. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/trajectory_correction.py +0 -0
  364. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/twiss.py +0 -0
  365. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/twissplot.py +0 -0
  366. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack/view.py +0 -0
  367. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack.egg-info/dependency_links.txt +0 -0
  368. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack.egg-info/requires.txt +0 -0
  369. {xtrack-0.96.0 → xtrack-0.96.2}/xtrack.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: xtrack
3
- Version: 0.96.0
3
+ Version: 0.96.2
4
4
  Summary: Tracking library for particle accelerators
5
5
  Home-page: https://xsuite.readthedocs.io/
6
6
  Download-URL: https://pypi.python.org/pypi/xtrack
@@ -30,5 +30,15 @@ Provides-Extra: notebooks
30
30
  Requires-Dist: jupyter; extra == "notebooks"
31
31
  Requires-Dist: ipympl; extra == "notebooks"
32
32
  Requires-Dist: xplt; extra == "notebooks"
33
+ Dynamic: author
34
+ Dynamic: description
35
+ Dynamic: download-url
36
+ Dynamic: home-page
37
+ Dynamic: license
38
+ Dynamic: license-file
39
+ Dynamic: project-url
40
+ Dynamic: provides-extra
41
+ Dynamic: requires-dist
42
+ Dynamic: summary
33
43
 
34
44
  Tracking library for particle accelerators
@@ -0,0 +1,263 @@
1
+ """
2
+ Test suite for ACDipole elements in Xtrack.
3
+
4
+ This module tests the behavior of the ACDipole
5
+ elements, focusing on their kick effects during ramp-up, flattop, and ramp-down phases.
6
+ Tests verify that only the appropriate coordinate (py for vertical, px for horizontal)
7
+ receives the expected kick while others remain zero.
8
+ """
9
+
10
+ from collections import namedtuple
11
+ from typing import Any
12
+
13
+ import pytest
14
+ from xobjects.test_helpers import for_all_test_contexts
15
+
16
+ import xtrack as xt
17
+ import xobjects as xo
18
+
19
+
20
+ # Constants
21
+ KICK_FACTOR = 300e-3 # Conversion factor for kick strength (mrad/V)
22
+ TOLERANCE = 1e-10 # Numerical tolerance for kick comparisons
23
+
24
+ RAMP_LENGTH = 10.0 # Number of turns for ramp up/down phases
25
+ FLATTOP_START = 100 # Turn number when flattop phase begins
26
+
27
+ # Turn numbers defining ramp phases: [start, end_ramp_up, start_ramp_down, end]:
28
+ RAMP_SCHEDULE = [0, RAMP_LENGTH, FLATTOP_START, FLATTOP_START + RAMP_LENGTH]
29
+
30
+ PLANES = ["x", "y"]
31
+
32
+
33
+ def get_acdipole_results(
34
+ test_context: Any,
35
+ turn: int,
36
+ plane: str,
37
+ test_voltage: float = 1.5,
38
+ test_freq: float = 0.25,
39
+ test_lag: float = 0.0,
40
+ ) -> tuple[float, float, float, float]:
41
+ """
42
+ Track particles through an ACDipole and return final coordinates.
43
+
44
+ Args:
45
+ test_context: The computational context for the simulation.
46
+ acdipole_class: The ACDipole class to instantiate (vertical or horizontal).
47
+ turn: The turn number for tracking.
48
+ test_voltage: Voltage setting for the ACDipole.
49
+ test_freq: Frequency setting for the ACDipole.
50
+ test_lag: Phase lag setting for the ACDipole.
51
+
52
+ Returns:
53
+ Tuple of (x, px, y, py) coordinates after tracking.
54
+ """
55
+ particles = xt.Particles(at_turn=turn, _context=test_context) # Must be 0.
56
+
57
+ acdipole = xt.ACDipole(
58
+ volt=test_voltage,
59
+ freq=test_freq,
60
+ lag=test_lag,
61
+ ramp=RAMP_SCHEDULE,
62
+ _context=test_context,
63
+ plane="h",
64
+ )
65
+ # Test the setter
66
+ acdipole.plane = plane
67
+
68
+ acdipole.track(particles)
69
+ return particles.x[0], particles.px[0], particles.y[0], particles.py[0]
70
+
71
+
72
+ def assert_acdipole_kick(
73
+ *,
74
+ test_context: Any,
75
+ test_turn: int,
76
+ test_plane: str,
77
+ test_volt: float,
78
+ test_freq: float,
79
+ test_lag: float,
80
+ expected_kick: float,
81
+ ) -> None:
82
+ """
83
+ Assert that only the specified coordinate receives the expected kick.
84
+
85
+ Tracks particles through the ACDipole and verifies that only the coordinate
86
+ corresponding to kick_attr receives the expected kick, while all other
87
+ coordinates remain zero.
88
+
89
+ Args:
90
+ test_context: The computational context for the simulation.
91
+ acdipole_class: The ACDipole class to test.
92
+ test_turn: Turn number for the test.
93
+ test_volt: Voltage setting.
94
+ test_freq: Frequency setting.
95
+ test_lag: Phase lag setting.
96
+ kick_attr: The coordinate that should receive the kick ("px" or "py").
97
+ expected_kick: The expected kick value for the specified coordinate.
98
+
99
+ Raises:
100
+ AssertionError: If the kick is not applied correctly.
101
+ """
102
+ x, px, y, py = get_acdipole_results(
103
+ test_context, test_turn, test_plane, test_volt, test_freq, test_lag
104
+ )
105
+ vals = {"x": x, "px": px, "y": y, "py": py} # Map coordinate names to values
106
+ for coord in vals:
107
+ if coord == f"p{test_plane}":
108
+ xo.assert_allclose(vals[coord], expected_kick, atol=TOLERANCE, rtol=0)
109
+ else:
110
+ assert vals[coord] == 0.0, (
111
+ f"Turn {test_turn}: Expected {coord}=0, but got {coord}={vals[coord]}"
112
+ )
113
+
114
+
115
+ # =====================
116
+ # Flattop Test Parameters and Helper
117
+ # =====================
118
+ FlattopCase = namedtuple("FlattopCase", ["volt", "turn", "freq", "lag", "desc"])
119
+ FLATTOP_CASES = [
120
+ FlattopCase(2.25, 45, 0.25, 0.0, "flattop, 2.25V, freq=0.25, lag=0.0"),
121
+ FlattopCase(1.5, 46, 1 / 3, -1 / 3, "flattop, 1.5V, freq=0.333..., lag=-0.333..."),
122
+ FlattopCase(1.5, 47, 1 / 3, 1 / 12, "flattop, 1.5V, freq=0.333..., lag=0.0833..."),
123
+ ]
124
+
125
+
126
+ def _calculate_flattop_kick(test_volt: float, test_turn: int) -> float:
127
+ """
128
+ Compute the expected kick during the flattop phase.
129
+
130
+ During flattop (turns 45-47), the kick depends on the turn:
131
+ - Turn 45: Positive kick
132
+ - Turn 46: Zero kick (phase cancellation)
133
+ - Turn 47: Negative kick
134
+
135
+ Args:
136
+ test_volt: The voltage setting.
137
+ test_turn: The turn number.
138
+
139
+ Returns:
140
+ The expected kick value.
141
+
142
+ Raises:
143
+ ValueError: If test_turn is not 45, 46, or 47.
144
+ """
145
+ if test_turn == 45:
146
+ return test_volt * KICK_FACTOR
147
+ if test_turn == 46:
148
+ return 0
149
+ if test_turn == 47:
150
+ return -test_volt * KICK_FACTOR
151
+ raise ValueError(
152
+ f"Unexpected test_turn={test_turn} in flattop tests. Expected 45, 46, or 47."
153
+ )
154
+
155
+
156
+ # =====================
157
+ # Flattop Tests
158
+ # =====================
159
+ @for_all_test_contexts
160
+ @pytest.mark.parametrize("plane", PLANES, ids=lambda o: o.upper())
161
+ @pytest.mark.parametrize("case", FLATTOP_CASES, ids=lambda c: c.desc)
162
+ def test_acdipole_flattop(
163
+ test_context: Any,
164
+ case: FlattopCase,
165
+ plane: str,
166
+ ) -> None:
167
+ """
168
+ Test ACDipole behavior during flattop phase for both orientations.
169
+
170
+ Verifies that the ACDipole applies the correct kick during the flattop
171
+ phase (constant amplitude) for vertical and horizontal orientations.
172
+ The test is parametrized over different voltage, frequency, and lag settings.
173
+ """
174
+ expected_kick = _calculate_flattop_kick(case.volt, case.turn)
175
+ assert_acdipole_kick(
176
+ test_context=test_context,
177
+ test_turn=case.turn,
178
+ test_plane=plane,
179
+ test_volt=case.volt,
180
+ test_freq=case.freq,
181
+ test_lag=case.lag,
182
+ expected_kick=expected_kick,
183
+ )
184
+
185
+
186
+ # =====================
187
+ # Ramp Test Parameters and Helper
188
+ # =====================
189
+ AcdipoleRampCase = namedtuple(
190
+ "AcdipoleRampCase", ["volt", "turn", "freq", "lag", "desc"]
191
+ )
192
+ ACDIPOLE_RAMP_CASES = [
193
+ AcdipoleRampCase(1.5, 5, 0.25, 0.0, "First ramp up, quarter period, no lag"),
194
+ AcdipoleRampCase(
195
+ 1.5, 105, 1.25, 0.0, "Ramp down, after 100 turns, freq > 1, no lag"
196
+ ),
197
+ AcdipoleRampCase(2.25, 6, 1 / 3, -0.25, "Early ramp, third period, negative lag"),
198
+ AcdipoleRampCase(
199
+ 1.5, 107, 1 / 3, 1 / 12, "Late ramp, third period, small positive lag"
200
+ ),
201
+ ]
202
+
203
+
204
+ def _calculate_ramp_kick(test_volt: float, test_turn: int) -> float:
205
+ """
206
+ Compute the expected kick during ramp phases.
207
+
208
+ The ACDipole has three phases based on turn number:
209
+ - Ramp up: turns 0-100, kick increases linearly
210
+ - Flattop: turns 100-110, constant kick (handled separately)
211
+ - Ramp down: turns >100, kick decreases linearly
212
+
213
+ The kick sign alternates based on turn number modulo 5.
214
+
215
+ Args:
216
+ test_volt: The voltage setting.
217
+ test_turn: The turn number.
218
+
219
+ Returns:
220
+ The expected kick value.
221
+ """
222
+ # Alternating sign based on turn number (simulates AC oscillation)
223
+ kick_sign = (-1) ** (test_turn % 5 > 0)
224
+ if test_turn > FLATTOP_START:
225
+ # Ramp down phase: kick decreases from max to zero over RAMP_LENGTH turns
226
+ return (
227
+ kick_sign
228
+ * test_volt
229
+ * KICK_FACTOR
230
+ * (1 - (test_turn - FLATTOP_START) / RAMP_LENGTH)
231
+ )
232
+ # Ramp up phase: kick increases linearly from zero to max over RAMP_LENGTH turns
233
+ return kick_sign * test_volt * KICK_FACTOR * (test_turn / RAMP_LENGTH)
234
+
235
+
236
+ # =====================
237
+ # Ramp Tests
238
+ # =====================
239
+ @for_all_test_contexts
240
+ @pytest.mark.parametrize("plane", PLANES, ids=lambda o: o.upper())
241
+ @pytest.mark.parametrize("case", ACDIPOLE_RAMP_CASES, ids=lambda c: c.desc)
242
+ def test_acdipole_ramp(
243
+ test_context: Any,
244
+ case: AcdipoleRampCase,
245
+ plane: str,
246
+ ) -> None:
247
+ """
248
+ Test ACDipole behavior during ramp phases for both orientations.
249
+
250
+ Verifies that the ACDipole applies linearly increasing/decreasing kicks
251
+ during ramp-up and ramp-down phases, with alternating signs to simulate
252
+ AC field oscillations. Only the appropriate coordinate receives the kick.
253
+ """
254
+ expected_kick = _calculate_ramp_kick(case.volt, case.turn)
255
+ assert_acdipole_kick(
256
+ test_context=test_context,
257
+ test_turn=case.turn,
258
+ test_plane=plane,
259
+ test_volt=case.volt,
260
+ test_freq=case.freq,
261
+ test_lag=case.lag,
262
+ expected_kick=expected_kick,
263
+ )
@@ -0,0 +1,61 @@
1
+ from typing import Any
2
+
3
+ import pytest
4
+ import xobjects as xo
5
+ import xpart as xp
6
+ from xobjects.test_helpers import for_all_test_contexts
7
+
8
+ import xtrack as xt
9
+
10
+
11
+ @for_all_test_contexts
12
+ @pytest.mark.parametrize("qx_shift", [-0.015, 0.035], ids=lambda v: f"qx_shift={v}")
13
+ @pytest.mark.parametrize("qy_shift", [0.015, -0.02], ids=lambda v: f"qy_shift={v}")
14
+ def test_ac_dipole_twiss(test_context: Any, qx_shift: float, qy_shift: float):
15
+ """Test the effect of a thin AC dipole on the tune shift."""
16
+ n = 4 # Number of FODO cells
17
+ fodo = [
18
+ xt.Multipole(length=0.2, knl=[0, +0.2], ksl=[0, 0]),
19
+ xt.Drift(length=1.0),
20
+ xt.Multipole(length=0.2, knl=[0, -0.2], ksl=[0, 0]),
21
+ xt.Drift(length=1.0),
22
+ ]
23
+ line = xt.Line(elements=n * fodo)
24
+ line.particle_ref = xp.Particles(mass0=xp.PROTON_MASS_EV, q0=1, p0c=1e9)
25
+ line.build_tracker(_context=test_context)
26
+ base_tws = line.twiss(method="4d")
27
+ nat_qx, nat_qy = base_tws["qx"], base_tws["qy"]
28
+ e5_pos = line.get_s_position("e5")
29
+ e5_betx = base_tws.rows["e5"]["betx"].item()
30
+ e5_bety = base_tws.rows["e5"]["bety"].item()
31
+
32
+ drv_qx, drv_qy = nat_qx + qx_shift, nat_qy + qy_shift
33
+
34
+ # Define AC dipole elements
35
+ line.env.elements["e5_hacd"] = xt.ACDipole(
36
+ natural_q=nat_qx,
37
+ freq=drv_qx,
38
+ beta_at_acdipole=e5_betx,
39
+ plane="h",
40
+ twiss_mode=True,
41
+ )
42
+ line.env.elements["e5_vacd"] = xt.ACDipole(
43
+ natural_q=nat_qy,
44
+ freq=drv_qy,
45
+ beta_at_acdipole=e5_bety,
46
+ plane="v",
47
+ )
48
+
49
+ line.insert("e5_hacd", at=e5_pos)
50
+ line.insert("e5_vacd", at=e5_pos)
51
+
52
+ # Test the setter of twiss_mode property
53
+ line.env.elements["e5_vacd"].twiss_mode = True
54
+
55
+ line.build_tracker(_context=test_context)
56
+ tws_both = line.twiss(method="4d")
57
+
58
+ xo.assert_allclose(tws_both["qx"], drv_qx, rtol=1e-10, atol=1e-15)
59
+ xo.assert_allclose(tws_both["qy"], drv_qy, rtol=1e-10, atol=1e-15)
60
+
61
+ del line
@@ -1302,3 +1302,48 @@ def test_beam_element_sin_cos_rot_backwards_compatible():
1302
1302
 
1303
1303
  assert rot_s_rad == mb_init.rot_s_rad
1304
1304
  assert rot_s_rad == mb_dict.rot_s_rad
1305
+
1306
+
1307
+ def test_beam_element_shifts_backwards_compatible():
1308
+ legacy_dict = {
1309
+ "__class__": "Sextupole",
1310
+ "_shift_x": 0.00007058877711752774,
1311
+ "radiation_flag": 1,
1312
+ "_sin_rot_s": 0.00004888621240909204,
1313
+ "knl": [
1314
+ 0.0,
1315
+ -0.00014884500249789793,
1316
+ 0.0,
1317
+ 0.0,
1318
+ 0.0,
1319
+ 0.0
1320
+ ],
1321
+ "_cos_rot_s": 0.9999999988050691,
1322
+ "_model": 0,
1323
+ "length": 0.225,
1324
+ "ksl": [
1325
+ 0.0,
1326
+ 0.0000071942270887898105,
1327
+ 0.0,
1328
+ 0.0,
1329
+ 0.0,
1330
+ 0.0
1331
+ ],
1332
+ "_shift_s": 0.00008144130256271475,
1333
+ "_integrator": 2,
1334
+ "_shift_y": 0.000025474011284299616,
1335
+ "num_multipole_kicks": 1,
1336
+ "k2": -9.682796465792052,
1337
+ "delta_taper": 0.0003145021963558703
1338
+ }
1339
+
1340
+ sext = xt.Sextupole.from_dict(legacy_dict)
1341
+
1342
+ computed_rot_s_rad = np.atan2(legacy_dict['_sin_rot_s'], legacy_dict['_cos_rot_s'])
1343
+ xo.assert_allclose(sext.rot_s_rad, computed_rot_s_rad, rtol=1e-14, atol=1e-14)
1344
+
1345
+ assert sext.rot_x_rad == 0
1346
+ assert sext.rot_y_rad == 0
1347
+ assert sext.shift_x == legacy_dict['_shift_x']
1348
+ assert sext.shift_y == legacy_dict['_shift_y']
1349
+ assert sext.shift_s == legacy_dict['_shift_s']
@@ -1830,6 +1830,7 @@ def test_solenoid_against_madx_native(test_context, ks, ksi, length):
1830
1830
  line_thick = env['ss']
1831
1831
 
1832
1832
  line_thick.configure_drift_model('exact') # to be consistent with madx
1833
+ line_thick.build_tracker(_context=test_context)
1833
1834
 
1834
1835
  mad = Madx(stdout=False)
1835
1836
  mad.input(mad_src)
@@ -941,32 +941,18 @@ def test_repeated_element_mad_behaviour():
941
941
  assert env.seq2['ee'] == element
942
942
 
943
943
 
944
- @pytest.mark.parametrize('aper_config', ['attached_to_marker', 'standalone'])
945
- def test_apertures_on_markers(aper_config):
946
- if aper_config == 'attached_to_marker':
947
- sequence = """
948
- ! Attached to a marker
949
- m_circle: marker, apertype="circle", aperture={.2};
950
- m_ellipse: marker, apertype="ellipse", aperture={.2, .1};
951
- m_rectangle: marker, apertype="rectangle", aperture={.07, .05};
952
- m_rectellipse: marker, apertype="rectellipse", aperture={.2, .4, .25, .45};
953
- m_racetrack: marker, apertype="racetrack", aperture={.6,.4,.2,.1};
954
- m_octagon: marker, apertype="octagon", aperture={.4, .5, 0.5, 1.};
955
- m_polygon: marker, apertype="circle", aper_vx={+5.800e-2,+5.800e-2,-8.800e-2}, aper_vy={+3.500e-2,-3.500e-2,+0.000e+0};
956
- """
957
- else:
958
- sequence = """
959
- ! Standalone
960
- m_circle: circle, aperture={.2};
961
- m_ellipse: ellipse, aperture={.2, .1};
962
- m_rectangle: rectangle, aperture={.07, .05};
963
- m_rectellipse: rectellipse, aperture={.2, .4, .25, .45};
964
- m_racetrack: racetrack, aperture={.6,.4,.2,.1};
965
- m_octagon: octagon, aperture={.4, .5, 0.5, 1.};
966
- m_polygon: circle, aper_vx={+5.800e-2,+5.800e-2,-8.800e-2}, aper_vy={+3.500e-2,-3.500e-2,+0.000e+0};
967
- """
968
-
969
- sequence += """
944
+ def test_apertures_on_markers():
945
+
946
+ sequence = """
947
+ ! Attached to a marker
948
+ m_circle: marker, apertype="circle", aperture={.2};
949
+ m_ellipse: marker, apertype="ellipse", aperture={.2, .1};
950
+ m_rectangle: marker, apertype="rectangle", aperture={.07, .05};
951
+ m_rectellipse: marker, apertype="rectellipse", aperture={.2, .4, .25, .45};
952
+ m_racetrack: marker, apertype="racetrack", aperture={.6,.4,.2,.1};
953
+ m_octagon: marker, apertype="octagon", aperture={.4, .5, 0.5, 1.};
954
+ m_polygon: marker, apertype="circle", aper_vx={+5.800e-2,+5.800e-2,-8.800e-2}, aper_vy={+3.500e-2,-3.500e-2,+0.000e+0};
955
+
970
956
  line: sequence, l=1;
971
957
  m_circle, at=0;
972
958
  m_ellipse, at=0.01;
@@ -1060,14 +1046,17 @@ def test_aperture_setting():
1060
1046
  sequence = """
1061
1047
  m_ellipse: marker, apertype="ellipse", aperture={.2, .1};
1062
1048
  m_aper: marker, apertype="rectangle", aperture={.3, .4};
1049
+ m_inferred: marker, aperture=.5; ! no apertype, should infer circle
1063
1050
 
1064
1051
  line: sequence, l=1;
1065
1052
  m_ellipse, at=0;
1066
1053
  m_aper, at=0.1;
1054
+ m_inferred, at=0.2;
1067
1055
  endsequence;
1068
1056
 
1069
1057
  m_ellipse, aperture={.3, .2}; ! no apertype
1070
1058
  m_aper, apertype="ellipse", aperture={.5, .6}; ! change apertype
1059
+ m_inferred, aperture={.8};
1071
1060
  """
1072
1061
 
1073
1062
  env = xt.load(string=sequence, format='madx')
@@ -1079,6 +1068,8 @@ def test_aperture_setting():
1079
1068
  assert line['m_aper_aper'].a == .5
1080
1069
  assert line['m_aper_aper'].b == .6
1081
1070
 
1071
+ assert line['m_inferred_aper'].a == .8
1072
+
1082
1073
 
1083
1074
  def test_import_thick_with_apertures_and_slice():
1084
1075
  sequence = """
@@ -0,0 +1 @@
1
+ __version__ = '0.96.2'
@@ -536,9 +536,10 @@ class BeamElement(xo.HybridClass, metaclass=MetaBeamElement):
536
536
 
537
537
  def xoinitialize(self, **kwargs):
538
538
  rot_s_rad = kwargs.pop('rot_s_rad', None)
539
- shift_x = kwargs.pop('shift_x', None)
540
- shift_y = kwargs.pop('shift_y', None)
541
- shift_s = kwargs.pop('shift_s', None)
539
+ # For the shifts we accept both shift_x and _shift_x for backward compatibility
540
+ shift_x = kwargs.pop('shift_x', kwargs.pop('_shift_x', None))
541
+ shift_y = kwargs.pop('shift_y', kwargs.pop('_shift_y', None))
542
+ shift_s = kwargs.pop('shift_s', kwargs.pop('_shift_s', None))
542
543
  rot_x_rad = kwargs.pop('rot_x_rad', None)
543
544
  rot_y_rad = kwargs.pop('rot_y_rad', None)
544
545
  rot_s_rad_no_frame = kwargs.pop('rot_s_rad_no_frame', None)
@@ -3,6 +3,7 @@
3
3
  # Copyright (c) CERN, 2021. #
4
4
  # ######################################### #
5
5
 
6
+ from .acdipole import ACDipole
6
7
  from .elements import *
7
8
  from .exciter import Exciter
8
9
  from .apertures import *
@@ -29,7 +30,7 @@ from .slice_elements_drift import (DriftSliceOctupole, DriftSliceSextupole,
29
30
  DriftSliceRBend, DriftSlice, DriftSliceCavity,
30
31
  DriftSliceCrabCavity, DriftSliceMultipole,
31
32
  DriftExactSlice)
32
-
33
+
33
34
  from .rft_element import RFT_Element
34
35
  from ..base_element import BeamElement
35
36