xtrack 0.95.0__tar.gz → 0.96.1__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 (372) hide show
  1. {xtrack-0.95.0/xtrack.egg-info → xtrack-0.96.1}/PKG-INFO +1 -1
  2. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_acceleration.py +8 -30
  3. xtrack-0.96.1/tests/test_acdipole.py +263 -0
  4. xtrack-0.96.1/tests/test_acdipole_twiss.py +61 -0
  5. xtrack-0.96.1/tests/test_aperture_polygon.py +121 -0
  6. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_aperture_table.py +7 -8
  7. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_apertures.py +82 -74
  8. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_coupling_edwards_teng.py +28 -21
  9. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_elements.py +45 -0
  10. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_elements_thick.py +571 -18
  11. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_environment.py +258 -216
  12. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_fcc_ee_solenoid_correction.py +7 -12
  13. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +8 -12
  14. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_h6_sps_beamline.py +1 -2
  15. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_hvkick.py +4 -9
  16. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_legacy_multiline_to_env.py +2 -2
  17. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_lhc_env.py +2 -2
  18. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_line.py +2 -2
  19. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_madloader.py +4 -4
  20. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_madnginterface.py +7 -3
  21. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_optics_and_ip_knob.py +17 -17
  22. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +1 -1
  23. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_native_madloader.py +67 -28
  24. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_native_madloader_lhc.py +4 -0
  25. xtrack-0.96.1/tests/test_native_madloader_lhc_thin.py +119 -0
  26. xtrack-0.96.1/tests/test_native_madloader_ps.py +117 -0
  27. xtrack-0.96.1/tests/test_native_madloader_sps.py +119 -0
  28. xtrack-0.96.1/tests/test_native_madloader_ti2.py +112 -0
  29. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_ps_against_ptc.py +12 -11
  30. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_ps_multiturn_twiss.py +6 -14
  31. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_psb_chicane.py +11 -28
  32. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_radiation.py +1 -4
  33. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_radiation_integrals.py +4 -4
  34. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_rbend_straight_body.py +37 -39
  35. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_slicing.py +29 -28
  36. xtrack-0.95.0/tests/test_sps_thick.py → xtrack-0.96.1/tests/test_sps_thick_cpymad_loader.py +4 -1
  37. xtrack-0.96.1/tests/test_sps_thick_native_loader.py +216 -0
  38. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_survey.py +18 -15
  39. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_thick_kickers_rf_crab.py +48 -65
  40. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_thick_lhc.py +1 -1
  41. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_tilt_shifts.py +1 -1
  42. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_tracker.py +8 -25
  43. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_trajectory_correcton.py +12 -12
  44. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_twiss.py +23 -15
  45. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_twiss_to_file.py +2 -2
  46. xtrack-0.96.1/tests/test_twiss_vs_madx_psb.py +133 -0
  47. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_vs_madx.py +3 -0
  48. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/lhc_match/lhc_match.py +4 -4
  49. xtrack-0.96.1/xtrack/_version.py +1 -0
  50. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/base_element.py +5 -10
  51. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/__init__.py +2 -1
  52. xtrack-0.96.1/xtrack/beam_elements/acdipole.py +222 -0
  53. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures.py +11 -8
  54. xtrack-0.96.1/xtrack/beam_elements/elements_src/acdipole.h +61 -0
  55. xtrack-0.96.1/xtrack/beam_elements/elements_src/track_acdipole.h +69 -0
  56. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/builder.py +2 -4
  57. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/environment.py +50 -6
  58. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/line.py +40 -107
  59. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/load.py +11 -5
  60. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/loss_location_refinement/loss_location_refinement.py +32 -3
  61. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/mad_parser/loader.py +42 -8
  62. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/mad_parser/madx.lark +12 -11
  63. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/mad_parser/parse.py +13 -13
  64. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/mad_writer.py +25 -7
  65. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/match.py +1 -1
  66. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/prebuilt_kernel_definitions/element_types.py +2 -2
  67. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/slicing.py +28 -20
  68. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/tapering.py +2 -1
  69. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/twiss.py +5 -8
  70. {xtrack-0.95.0 → xtrack-0.96.1/xtrack.egg-info}/PKG-INFO +1 -1
  71. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack.egg-info/SOURCES.txt +12 -3
  72. xtrack-0.95.0/tests/test_rbend_rbarc.py +0 -71
  73. xtrack-0.95.0/tests/test_twiss_vs_madx_psb.py +0 -47
  74. xtrack-0.95.0/xtrack/_version.py +0 -1
  75. xtrack-0.95.0/xtrack/beam_elements/elements_src/_generate_slice_elements_c_code.py +0 -310
  76. {xtrack-0.95.0 → xtrack-0.96.1}/LICENSE +0 -0
  77. {xtrack-0.95.0 → xtrack-0.96.1}/MANIFEST.in +0 -0
  78. {xtrack-0.95.0 → xtrack-0.96.1}/README.md +0 -0
  79. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/__init__.py +0 -0
  80. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/base_classes.py +0 -0
  81. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/BB6D.py +0 -0
  82. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
  83. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/__init__.py +0 -0
  84. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/beambeam.py +0 -0
  85. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/boost.py +0 -0
  86. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
  87. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
  88. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/qgauss.py +0 -0
  89. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/slicing.py +0 -0
  90. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/be_beamfields/spacecharge.py +0 -0
  91. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/elements.py +0 -0
  92. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/line.py +0 -0
  93. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/mathlibs.py +0 -0
  94. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/particles.py +0 -0
  95. {xtrack-0.95.0 → xtrack-0.96.1}/ducktrack/temp_pyparticles.py +0 -0
  96. {xtrack-0.95.0 → xtrack-0.96.1}/pyproject.toml +0 -0
  97. {xtrack-0.95.0 → xtrack-0.96.1}/setup.cfg +0 -0
  98. {xtrack-0.95.0 → xtrack-0.96.1}/setup.py +0 -0
  99. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_amplitude_detuning.py +0 -0
  100. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
  101. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_atomic_add.py +0 -0
  102. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_attr_replicas_and_slices.py +0 -0
  103. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_boris_spatial.py +0 -0
  104. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_bucket_with_ref_energy_change.py +0 -0
  105. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_cavity_absolute_time.py +0 -0
  106. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_chromatic_functions_vs_madx.py +0 -0
  107. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_coasting.py +0 -0
  108. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_collective_tracker.py +0 -0
  109. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_collimation.py +0 -0
  110. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_electron_cooler.py +0 -0
  111. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_element_characterization_functions.py +0 -0
  112. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_element_internal_record.py +0 -0
  113. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_elements_classflags.py +0 -0
  114. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_footprint.py +0 -0
  115. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_freeze_longitudinal.py +0 -0
  116. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_full_rings.py +0 -0
  117. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_ions.py +0 -0
  118. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_json.py +0 -0
  119. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_lhc_match_phase_15.py +0 -0
  120. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_load.py +0 -0
  121. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_load_vars.py +0 -0
  122. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_lumi.py +0 -0
  123. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_mad_writer.py +0 -0
  124. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_magnet.py +0 -0
  125. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_and_track_from_element.py +0 -0
  126. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_coupling_knob.py +0 -0
  127. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_nested.py +0 -0
  128. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_orbit_bump.py +0 -0
  129. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_match_tune_chroma_cminus.py +0 -0
  130. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_misalign.py +0 -0
  131. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_monitor.py +0 -0
  132. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_multi_bunch_gauss.py +0 -0
  133. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_multiline.py +0 -0
  134. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_multisetter.py +0 -0
  135. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_multispecies.py +0 -0
  136. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_optimize_for_tracking.py +0 -0
  137. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_particles.py +0 -0
  138. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_particles_basics.py +0 -0
  139. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_particles_pdg.py +0 -0
  140. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_pipeline.py +0 -0
  141. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_prebuild_kernels.py +0 -0
  142. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_pyht_interface.py +0 -0
  143. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_quadrupole_fringe_ptc.py +0 -0
  144. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_quadrupole_wedge.py +0 -0
  145. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_radial_steering.py +0 -0
  146. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_radiation_equilibrium_emittances.py +0 -0
  147. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_radiation_equilibrium_emittances_thick.py +0 -0
  148. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_random_gen.py +0 -0
  149. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_random_gen_exp.py +0 -0
  150. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_random_gen_gauss.py +0 -0
  151. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_random_gen_ruth.py +0 -0
  152. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_rf_track.py +0 -0
  153. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_rotation_signs.py +0 -0
  154. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_second_order_taylor_map.py +0 -0
  155. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_seeds.py +0 -0
  156. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_slice_and_insert_with_replicas.py +0 -0
  157. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_slice_elements.py +0 -0
  158. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
  159. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_solenoid_bz_map_vs_boris_legacy.py +0 -0
  160. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_spacecharge_in_ring.py +0 -0
  161. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_spin.py +0 -0
  162. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_tapering.py +0 -0
  163. {xtrack-0.95.0 → xtrack-0.96.1}/tests/test_xmask_orbit_correction.py +0 -0
  164. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/__init__.py +0 -0
  165. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/__init__.py +0 -0
  166. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
  167. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
  168. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
  169. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/lhc_match/__init__.py +0 -0
  170. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
  171. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/lhc_match/var_limits.py +0 -0
  172. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/python_lattice_writer/__init__.py +0 -0
  173. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/_temp/python_lattice_writer/lattice_py_generation.py +0 -0
  174. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/aperture_meas.py +0 -0
  175. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
  176. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
  177. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
  178. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
  179. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
  180. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
  181. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/beam_interaction.py +0 -0
  182. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements.py +0 -0
  183. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/bend.h +0 -0
  184. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/cavity.h +0 -0
  185. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/crab_cavity.h +0 -0
  186. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/default_magnet_config.h +0 -0
  187. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/dipole_fringe.h +0 -0
  188. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
  189. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift.h +0 -0
  190. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_exact.h +0 -0
  191. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_exact_slice.h +0 -0
  192. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
  193. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
  194. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_cavity.h +0 -0
  195. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_crab_cavity.h +0 -0
  196. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_multipole.h +0 -0
  197. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
  198. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
  199. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_rbend.h +0 -0
  200. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
  201. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/drift_slice_uniform_solenoid.h +0 -0
  202. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/electroncooler.h +0 -0
  203. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/elens.h +0 -0
  204. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/exciter.h +0 -0
  205. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
  206. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/legacy_solenoid.h +0 -0
  207. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
  208. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/magnet.h +0 -0
  209. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/magnet_drift.h +0 -0
  210. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/magnet_edge.h +0 -0
  211. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/magnet_kick.h +0 -0
  212. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/marker.h +0 -0
  213. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/misalignment.h +0 -0
  214. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/multipole.h +0 -0
  215. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/multipoleedge.h +0 -0
  216. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
  217. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/octupole.h +0 -0
  218. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
  219. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/rbend.h +0 -0
  220. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
  221. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
  222. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
  223. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
  224. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
  225. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
  226. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/slnd.h +0 -0
  227. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/srotation.h +0 -0
  228. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/temprf.h +0 -0
  229. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
  230. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_cavity.h +0 -0
  231. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_crab_cavity.h +0 -0
  232. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_multipole.h +0 -0
  233. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
  234. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
  235. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_rbend.h +0 -0
  236. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
  237. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thick_slice_uniform_solenoid.h +0 -0
  238. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
  239. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
  240. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
  241. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_cavity.h +0 -0
  242. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_crab_cavity.h +0 -0
  243. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_multipole.h +0 -0
  244. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
  245. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_octupole_entry.h +0 -0
  246. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_octupole_exit.h +0 -0
  247. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
  248. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_entry.h +0 -0
  249. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_exit.h +0 -0
  250. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_rbend.h +0 -0
  251. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_rbend_entry.h +0 -0
  252. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_rbend_exit.h +0 -0
  253. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
  254. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_sextupole_entry.h +0 -0
  255. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_sextupole_exit.h +0 -0
  256. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_entry.h +0 -0
  257. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_exit.h +0 -0
  258. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
  259. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
  260. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +0 -0
  261. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_drift.h +0 -0
  262. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_legacy_solenoid.h +0 -0
  263. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_legacy_solenoid_multipolar_components.h +0 -0
  264. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_legacy_solenoid_radiation.h +0 -0
  265. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet.h +0 -0
  266. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet.template.h +0 -0
  267. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet_configure.h +0 -0
  268. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet_drift.h +0 -0
  269. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet_edge.h +0 -0
  270. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet_kick.h +0 -0
  271. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_magnet_radiation.h +0 -0
  272. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_misalignments.h +0 -0
  273. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_mult_fringe.h +0 -0
  274. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_rf.h +0 -0
  275. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_rf.template.h +0 -0
  276. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
  277. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_thick_bend.h +0 -0
  278. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_thick_cfd.h +0 -0
  279. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_wedge.h +0 -0
  280. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
  281. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_xyshift.h +0 -0
  282. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
  283. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/variable_solenoid.h +0 -0
  284. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/wedge.h +0 -0
  285. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/wire.h +0 -0
  286. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
  287. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
  288. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
  289. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
  290. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/exciter.py +0 -0
  291. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/rft_element.py +0 -0
  292. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/slice_base.py +0 -0
  293. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/slice_elements_drift.py +0 -0
  294. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/slice_elements_edge.py +0 -0
  295. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/slice_elements_thick.py +0 -0
  296. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/beam_elements/slice_elements_thin.py +0 -0
  297. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/boris.py +0 -0
  298. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/footprint.py +0 -0
  299. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/functions.py +0 -0
  300. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/general.py +0 -0
  301. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/atomicadd.h +0 -0
  302. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/checks.h +0 -0
  303. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/constants.h +0 -0
  304. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/particle_states.h +0 -0
  305. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/synrad_spectrum.h +0 -0
  306. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/track.h +0 -0
  307. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/headers/track_local_particle_with_transformations.h +0 -0
  308. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/internal_record.py +0 -0
  309. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/json.py +0 -0
  310. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/linear_normal_form.py +0 -0
  311. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/loss_location_refinement/__init__.py +0 -0
  312. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/lumi.py +0 -0
  313. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/mad_loader.py +0 -0
  314. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/mad_parser/__init__.py +0 -0
  315. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/madng_interface.py +0 -0
  316. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/__init__.py +0 -0
  317. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/beam_position_monitor.h +0 -0
  318. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/beam_position_monitor.py +0 -0
  319. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/beam_profile_monitor.h +0 -0
  320. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/beam_profile_monitor.py +0 -0
  321. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/beam_size_monitor.h +0 -0
  322. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/beam_size_monitor.py +0 -0
  323. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/last_turns_monitor.h +0 -0
  324. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/last_turns_monitor.py +0 -0
  325. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/particles_monitor.h +0 -0
  326. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/monitors/particles_monitor.py +0 -0
  327. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/multiline.py +0 -0
  328. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/multiline_legacy/__init__.py +0 -0
  329. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/multiline_legacy/multiline_legacy.py +0 -0
  330. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/multiline_legacy/shared_knobs.py +0 -0
  331. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/multisetter/__init__.py +0 -0
  332. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/multisetter/multisetter.py +0 -0
  333. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/__init__.py +0 -0
  334. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/constants.py +0 -0
  335. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/masses.py +0 -0
  336. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/particles.py +0 -0
  337. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/pdg.py +0 -0
  338. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/rng_src/base_rng.h +0 -0
  339. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/particles/rng_src/particles_rng.h +0 -0
  340. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/pipeline/__init__.py +0 -0
  341. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/pipeline/core.py +0 -0
  342. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/pipeline/manager.py +0 -0
  343. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/pipeline/multitracker.py +0 -0
  344. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/prebuilt_kernel_definitions/__init__.py +0 -0
  345. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/prebuilt_kernel_definitions/element_inits.py +0 -0
  346. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/progress_indicator.py +0 -0
  347. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/__init__.py +0 -0
  348. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_generators.py +0 -0
  349. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_src/exponential.h +0 -0
  350. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
  351. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_src/normal.h +0 -0
  352. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_src/rutherford.h +0 -0
  353. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_src/uniform.h +0 -0
  354. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/random/random_src/uniform_accurate.h +0 -0
  355. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/survey.py +0 -0
  356. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/svgutils/__init__.py +0 -0
  357. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/svgutils/parser.py +0 -0
  358. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/svgutils/path.py +0 -0
  359. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/svgutils/svgutils.py +0 -0
  360. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/synctime.py +0 -0
  361. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/table.py +0 -0
  362. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/targets.py +0 -0
  363. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/track_flags.py +0 -0
  364. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/tracker.py +0 -0
  365. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/tracker_data.py +0 -0
  366. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/tracker_src/tracker.h +0 -0
  367. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/trajectory_correction.py +0 -0
  368. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/twissplot.py +0 -0
  369. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack/view.py +0 -0
  370. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack.egg-info/dependency_links.txt +0 -0
  371. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack.egg-info/requires.txt +0 -0
  372. {xtrack-0.95.0 → xtrack-0.96.1}/xtrack.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xtrack
3
- Version: 0.95.0
3
+ Version: 0.96.1
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
@@ -8,7 +8,6 @@ import pathlib
8
8
 
9
9
  import numpy as np
10
10
  import pandas as pd
11
- from cpymad.madx import Madx
12
11
  from scipy.constants import c as clight
13
12
 
14
13
  import xobjects as xo
@@ -64,20 +63,10 @@ def test_energy_program(test_context):
64
63
  # Shift the time scale for testing purposes
65
64
  t_s = t_s
66
65
 
67
- # Load mad model and apply element shifts
68
- mad = Madx(stdout=False)
69
- mad.call(str(test_data_folder / 'psb_chicane/psb.seq'))
70
- mad.call(str(test_data_folder / 'psb_chicane/psb_fb_lhc.str'))
71
- mad.input('''
72
- beam, particle=PROTON, pc=0.5708301551893517;
73
- use, sequence=psb1;
74
- twiss;
75
- ''')
76
-
77
- line = xt.Line.from_madx_sequence(mad.sequence.psb1, allow_thick=True,
78
- deferred_expressions=True)
79
- line.particle_ref = xt.Particles(mass0=xt.PROTON_MASS_EV,
80
- gamma0=mad.sequence.psb1.beam.gamma)
66
+ env = xt.load([test_data_folder / 'psb_chicane/psb.seq',
67
+ test_data_folder / 'psb_chicane/psb_fb_lhc.str'])
68
+ env.psb1.set_particle_ref('proton', p0c=0.5708301551893517e9)
69
+ line = env.psb1
81
70
 
82
71
  line.build_tracker(_context=test_context)
83
72
 
@@ -176,21 +165,10 @@ def test_energy_program(test_context):
176
165
  @for_all_test_contexts(excluding=('ContextPyopencl',))
177
166
  def test_acceleration_transverse_shrink(test_context):
178
167
 
179
- mad = Madx(stdout=False)
180
-
181
- # Load mad model and apply element shifts
182
- mad.input(f'''
183
- call, file = '{str(test_data_folder)}/psb_chicane/psb.seq';
184
- call, file = '{str(test_data_folder)}/psb_chicane/psb_fb_lhc.str';
185
- beam;
186
- use, sequence=psb1;
187
- ''')
188
-
189
- line = xt.Line.from_madx_sequence(mad.sequence.psb1,
190
- deferred_expressions=True)
191
- e_kin_start_eV = 160e6
192
- line.particle_ref = xt.Particles(mass0=xt.PROTON_MASS_EV, q0=1.,
193
- energy0=xt.PROTON_MASS_EV + e_kin_start_eV)
168
+ env = xt.load([test_data_folder / 'psb_chicane/psb.seq',
169
+ test_data_folder / 'psb_chicane/psb_fb_lhc.str'])
170
+ env.psb1.set_particle_ref('proton', p0c=0.5708301551893517e9)
171
+ line = env.psb1
194
172
 
195
173
  # Slice to gain some tracking speed
196
174
  line.slice_thick_elements(
@@ -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
@@ -0,0 +1,121 @@
1
+ import numpy as np
2
+
3
+ import xobjects as xo
4
+ import xtrack as xt
5
+
6
+ def _polygon_signed_area(x, y):
7
+ x_close = np.concatenate([x, x[:1]])
8
+ y_close = np.concatenate([y, y[:1]])
9
+ return 0.5 * np.sum(x_close[:-1] * y_close[1:] - x_close[1:] * y_close[:-1])
10
+
11
+
12
+ def _polygon_centroid(x, y):
13
+ x_close = np.concatenate([x, x[:1]])
14
+ y_close = np.concatenate([y, y[:1]])
15
+ cross = x_close[:-1] * y_close[1:] - x_close[1:] * y_close[:-1]
16
+ area = np.sum(cross) / 2.0
17
+ cx = np.sum((x_close[:-1] + x_close[1:]) * cross) / (6.0 * area)
18
+ cy = np.sum((y_close[:-1] + y_close[1:]) * cross) / (6.0 * area)
19
+ return np.array([cx, cy])
20
+
21
+
22
+ def test_limitpolygon_area_signed():
23
+ x_ccw = np.array([-2.0, 2.0, 2.0, -2.0]) * 1e-2
24
+ y_ccw = np.array([-1.0, -1.0, 1.5, 1.5]) * 1e-2
25
+
26
+ aper_ccw = xt.LimitPolygon(
27
+ x_vertices=x_ccw,
28
+ y_vertices=y_ccw,
29
+ )
30
+
31
+ aper_cw = xt.LimitPolygon(
32
+ x_vertices=x_ccw[::-1],
33
+ y_vertices=y_ccw[::-1],
34
+ )
35
+
36
+ signed_expected = _polygon_signed_area(x_ccw, y_ccw)
37
+ assert signed_expected > 0
38
+
39
+ xo.assert_allclose(aper_ccw.area, abs(signed_expected), atol=0, rtol=0)
40
+ xo.assert_allclose(
41
+ aper_ccw.get_area(signed=True), signed_expected, atol=0, rtol=0
42
+ )
43
+ xo.assert_allclose(aper_cw.area, abs(signed_expected), atol=0, rtol=0)
44
+ xo.assert_allclose(
45
+ aper_cw.get_area(signed=True), -signed_expected, atol=0, rtol=0
46
+ )
47
+
48
+
49
+ def test_limitpolygon_normals_point_inward():
50
+ x_vertices = np.array([-1.0, 2.0, 2.5, 0.0]) * 1e-2
51
+ y_vertices = np.array([-1.0, -1.0, 1.5, 2.0]) * 1e-2
52
+
53
+ aper = xt.LimitPolygon(
54
+ x_vertices=x_vertices,
55
+ y_vertices=y_vertices,
56
+ )
57
+
58
+ ctx = aper._buffer.context
59
+ Nx = ctx.nparray_from_context_array(aper.x_normal)
60
+ Ny = ctx.nparray_from_context_array(aper.y_normal)
61
+
62
+ xo.assert_allclose(np.sqrt(Nx**2 + Ny**2), 1.0, rtol=0, atol=1e-14)
63
+
64
+ xv = ctx.nparray_from_context_array(aper.x_vertices)
65
+ yv = ctx.nparray_from_context_array(aper.y_vertices)
66
+ centroid = _polygon_centroid(xv, yv)
67
+ xv_close = np.concatenate([xv, xv[:1]])
68
+ yv_close = np.concatenate([yv, yv[:1]])
69
+
70
+ for ii in range(len(xv)):
71
+ midpoint = np.array([
72
+ 0.5 * (xv_close[ii] + xv_close[ii + 1]),
73
+ 0.5 * (yv_close[ii] + yv_close[ii + 1]),
74
+ ])
75
+ vec_to_center = centroid - midpoint
76
+ normal = np.array([Nx[ii], Ny[ii]])
77
+ assert np.dot(normal, vec_to_center) > 0
78
+
79
+
80
+ def test_limitpolygon_impact_point_and_normal():
81
+ x_vertices = np.array([-1.0, 1.0, 1.0, -1.0]) * 1e-2
82
+ y_vertices = np.array([-1.0, -1.0, 1.0, 1.0]) * 1e-2
83
+
84
+ aper = xt.LimitPolygon(
85
+ x_vertices=x_vertices,
86
+ y_vertices=y_vertices,
87
+ )
88
+
89
+ ctx = aper._buffer.context
90
+ to_ctx = ctx.nparray_to_context_array
91
+ from_ctx = ctx.nparray_from_context_array
92
+
93
+ x_in = to_ctx(np.array([0.0, 0.0]))
94
+ y_in = to_ctx(np.array([0.0, 0.0]))
95
+ z_in = to_ctx(np.array([0.0, 0.0]))
96
+ x_out = to_ctx(np.array([2.0e-2, 0.0]))
97
+ y_out = to_ctx(np.array([0.0, -2.0e-2]))
98
+ z_out = to_ctx(np.array([0.0, 0.0]))
99
+
100
+ x_int, y_int, z_int, Nx, Ny, i_found = aper.impact_point_and_normal(
101
+ x_in=x_in,
102
+ y_in=y_in,
103
+ z_in=z_in,
104
+ x_out=x_out,
105
+ y_out=y_out,
106
+ z_out=z_out,
107
+ )
108
+
109
+ x_int = from_ctx(x_int)
110
+ y_int = from_ctx(y_int)
111
+ z_int = from_ctx(z_int)
112
+ Nx = from_ctx(Nx)
113
+ Ny = from_ctx(Ny)
114
+ i_found = from_ctx(i_found)
115
+
116
+ xo.assert_allclose(x_int, np.array([1.0e-2, 0.0]), atol=1e-15, rtol=0)
117
+ xo.assert_allclose(y_int, np.array([0.0, -1.0e-2]), atol=1e-15, rtol=0)
118
+ xo.assert_allclose(z_int, np.array([0., 0]), atol=1e-15, rtol=0)
119
+ xo.assert_allclose(Nx, np.array([-1.0, 0.0]), atol=1e-14, rtol=0)
120
+ xo.assert_allclose(Ny, np.array([0.0, 1.0]), atol=1e-14, rtol=0)
121
+ assert np.all(i_found >= 0)
@@ -14,9 +14,8 @@ def test_aperture_table():
14
14
  'vtaf.51632.b_aper', 'vbrta.51633.a_aper', 'vbrta.51633.b_aper',
15
15
  'bgiha.51634.a_aper', 'bgiva.51674.a_aper']
16
16
 
17
- env = xt.load(test_data_folder /
18
- 'sps_with_apertures/EYETS 2024-2025.seq')
19
- env.vars.load(str(test_data_folder / 'sps_with_apertures/lhc_q20.str'))
17
+ env = xt.load([test_data_folder / 'sps_with_apertures/EYETS 2024-2025.seq',
18
+ test_data_folder / 'sps_with_apertures/lhc_q20.str'])
20
19
  line = env.sps
21
20
  line.particle_ref = xt.Particles(mass0=xt.PROTON_MASS_EV, q0=1, p0c=26e9)
22
21
 
@@ -62,9 +61,9 @@ def test_aperture_table():
62
61
  aper_check = aper.rows['veba.20250.a_aper' : 'vebb.20270.b_aper']
63
62
 
64
63
  assert np.all(aper_check.name == np.array(
65
- ['veba.20250.a_aper', 'drift_333..2', 'mba.20250', 'drift_334..0',
66
- 'veba.20250.b_aper', 'drift_334..1', 'vebb.20270.a_aper',
67
- 'drift_334..2', 'mbb.20270', 'drift_335..0', 'vebb.20270.b_aper']))
64
+ ['veba.20250.a_aper', '||drift_979', 'mba.20250', '||drift_991',
65
+ 'veba.20250.b_aper', '||drift_671', 'vebb.20270.a_aper',
66
+ '||drift_992', 'mbb.20270', '||drift_993', 'vebb.20270.b_aper']))
68
67
  xo.assert_allclose(aper_check.s, np.array([
69
68
  1225.8247 , 1225.8247 , 1226.0176907, 1232.2777093,
70
69
  1232.4827 , 1232.4827 , 1232.4847 , 1232.4847 ,
@@ -133,8 +132,8 @@ def test_aperture_table_aper_at_same_s():
133
132
 
134
133
  import numpy as np
135
134
  import xobjects as xo
136
- assert np.all(tt.name == ['drift_1', 'lrect', 'lellipse', 'drift_2', 'm', 'lellipse',
137
- '_end_point'])
135
+ assert np.all(tt.name == ['||drift_1', 'lrect', 'lellipse', '||drift_2', 'm', 'lellipse',
136
+ '_end_point'])
138
137
  xo.assert_allclose(tt.s, np.array([0., 3., 3., 3., 5., 5., 5.]), rtol=0, atol=1e-6)
139
138
  xo.assert_allclose(tt.x_aper_low, np.array([-0.0505, -0.0505, -0.0205, -0.0205, -0.0205,
140
139
  -0.0205, -0.0205]), rtol=0, atol=1e-6)