xtrack 0.93.0__tar.gz → 0.93.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 (352) hide show
  1. {xtrack-0.93.0/xtrack.egg-info → xtrack-0.93.2}/PKG-INFO +1 -1
  2. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_boris_spatial.py +47 -2
  3. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_madnginterface.py +139 -1
  4. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_survey.py +105 -0
  5. xtrack-0.93.2/xtrack/_version.py +1 -0
  6. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/boris.py +35 -23
  7. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/mad_parser/loader.py +11 -0
  8. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/mad_writer.py +201 -223
  9. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/madng_interface.py +207 -62
  10. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/match.py +29 -10
  11. {xtrack-0.93.0 → xtrack-0.93.2/xtrack.egg-info}/PKG-INFO +1 -1
  12. xtrack-0.93.0/xtrack/_version.py +0 -1
  13. {xtrack-0.93.0 → xtrack-0.93.2}/LICENSE +0 -0
  14. {xtrack-0.93.0 → xtrack-0.93.2}/MANIFEST.in +0 -0
  15. {xtrack-0.93.0 → xtrack-0.93.2}/README.md +0 -0
  16. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/__init__.py +0 -0
  17. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/base_classes.py +0 -0
  18. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/BB6D.py +0 -0
  19. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
  20. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/__init__.py +0 -0
  21. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/beambeam.py +0 -0
  22. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/boost.py +0 -0
  23. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
  24. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
  25. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/qgauss.py +0 -0
  26. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/slicing.py +0 -0
  27. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/be_beamfields/spacecharge.py +0 -0
  28. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/elements.py +0 -0
  29. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/line.py +0 -0
  30. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/mathlibs.py +0 -0
  31. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/particles.py +0 -0
  32. {xtrack-0.93.0 → xtrack-0.93.2}/ducktrack/temp_pyparticles.py +0 -0
  33. {xtrack-0.93.0 → xtrack-0.93.2}/pyproject.toml +0 -0
  34. {xtrack-0.93.0 → xtrack-0.93.2}/setup.cfg +0 -0
  35. {xtrack-0.93.0 → xtrack-0.93.2}/setup.py +0 -0
  36. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_acceleration.py +0 -0
  37. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_amplitude_detuning.py +0 -0
  38. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_aperture_table.py +0 -0
  39. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
  40. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_apertures.py +0 -0
  41. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_attr_replicas_and_slices.py +0 -0
  42. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_bucket_with_ref_energy_change.py +0 -0
  43. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_cavity_absolute_time.py +0 -0
  44. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_chromatic_functions_vs_madx.py +0 -0
  45. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_coasting.py +0 -0
  46. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_collective_tracker.py +0 -0
  47. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_collimation.py +0 -0
  48. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_coupling_edwards_teng.py +0 -0
  49. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_electron_cooler.py +0 -0
  50. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_element_characterization_functions.py +0 -0
  51. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_element_internal_record.py +0 -0
  52. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_elements.py +0 -0
  53. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_elements_classflags.py +0 -0
  54. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_elements_thick.py +0 -0
  55. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_environment.py +0 -0
  56. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_fcc_ee_solenoid_correction.py +0 -0
  57. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
  58. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_footprint.py +0 -0
  59. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_freeze_longitudinal.py +0 -0
  60. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_full_rings.py +0 -0
  61. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_h6_sps_beamline.py +0 -0
  62. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_hvkick.py +0 -0
  63. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_ions.py +0 -0
  64. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_json.py +0 -0
  65. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_legacy_multiline_to_env.py +0 -0
  66. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_lhc_env.py +0 -0
  67. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_lhc_match_phase_15.py +0 -0
  68. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_line.py +0 -0
  69. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_load.py +0 -0
  70. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_load_vars.py +0 -0
  71. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_lumi.py +0 -0
  72. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_mad_writer.py +0 -0
  73. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_madloader.py +0 -0
  74. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_magnet.py +0 -0
  75. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_and_track_from_element.py +0 -0
  76. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_coupling_knob.py +0 -0
  77. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_nested.py +0 -0
  78. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_optics_and_ip_knob.py +0 -0
  79. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +0 -0
  80. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_orbit_bump.py +0 -0
  81. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_match_tune_chroma_cminus.py +0 -0
  82. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_misalign.py +0 -0
  83. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_monitor.py +0 -0
  84. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_multi_bunch_gauss.py +0 -0
  85. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_multiline.py +0 -0
  86. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_multisetter.py +0 -0
  87. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_multispecies.py +0 -0
  88. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_native_madloader.py +0 -0
  89. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_optimize_for_tracking.py +0 -0
  90. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_particles.py +0 -0
  91. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_particles_basics.py +0 -0
  92. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_particles_pdg.py +0 -0
  93. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_pipeline.py +0 -0
  94. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_prebuild_kernels.py +0 -0
  95. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_ps_against_ptc.py +0 -0
  96. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_ps_multiturn_twiss.py +0 -0
  97. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_psb_chicane.py +0 -0
  98. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_pyht_interface.py +0 -0
  99. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_quadrupole_fringe_ptc.py +0 -0
  100. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_quadrupole_wedge.py +0 -0
  101. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_radial_steering.py +0 -0
  102. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_radiation.py +0 -0
  103. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_radiation_equilibrium_emittances.py +0 -0
  104. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_radiation_equilibrium_emittances_thick.py +0 -0
  105. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_radiation_integrals.py +0 -0
  106. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_random_gen.py +0 -0
  107. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_random_gen_exp.py +0 -0
  108. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_random_gen_gauss.py +0 -0
  109. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_random_gen_ruth.py +0 -0
  110. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_rbend_rbarc.py +0 -0
  111. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_rbend_straight_body.py +0 -0
  112. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_rf_track.py +0 -0
  113. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_rotation_signs.py +0 -0
  114. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_second_order_taylor_map.py +0 -0
  115. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_seeds.py +0 -0
  116. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_slice_and_insert_with_replicas.py +0 -0
  117. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_slice_elements.py +0 -0
  118. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_slicing.py +0 -0
  119. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
  120. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_solenoid_bz_map_vs_boris_legacy.py +0 -0
  121. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_spacecharge_in_ring.py +0 -0
  122. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_spin.py +0 -0
  123. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_sps_thick.py +0 -0
  124. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_tapering.py +0 -0
  125. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_thick_kickers_rf_crab.py +0 -0
  126. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_thick_lhc.py +0 -0
  127. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_tilt_shifts.py +0 -0
  128. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_tracker.py +0 -0
  129. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_trajectory_correcton.py +0 -0
  130. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_twiss.py +0 -0
  131. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_twiss_to_file.py +0 -0
  132. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_twiss_vs_madx_psb.py +0 -0
  133. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_vs_madx.py +0 -0
  134. {xtrack-0.93.0 → xtrack-0.93.2}/tests/test_xmask_orbit_correction.py +0 -0
  135. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/__init__.py +0 -0
  136. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/__init__.py +0 -0
  137. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
  138. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
  139. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
  140. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/lhc_match/__init__.py +0 -0
  141. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
  142. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
  143. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/_temp/lhc_match/var_limits.py +0 -0
  144. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/aperture_meas.py +0 -0
  145. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/base_element.py +0 -0
  146. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/__init__.py +0 -0
  147. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures.py +0 -0
  148. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
  149. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
  150. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
  151. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
  152. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
  153. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
  154. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/beam_interaction.py +0 -0
  155. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements.py +0 -0
  156. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/bend.h +0 -0
  157. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/cavity.h +0 -0
  158. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/crab_cavity.h +0 -0
  159. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/default_magnet_config.h +0 -0
  160. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/dipole_fringe.h +0 -0
  161. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
  162. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift.h +0 -0
  163. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_exact.h +0 -0
  164. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_exact_slice.h +0 -0
  165. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
  166. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
  167. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_cavity.h +0 -0
  168. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_crab_cavity.h +0 -0
  169. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_multipole.h +0 -0
  170. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
  171. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
  172. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_rbend.h +0 -0
  173. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
  174. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/drift_slice_uniform_solenoid.h +0 -0
  175. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/electroncooler.h +0 -0
  176. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/elens.h +0 -0
  177. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/exciter.h +0 -0
  178. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
  179. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/legacy_solenoid.h +0 -0
  180. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
  181. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/magnet.h +0 -0
  182. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/magnet_drift.h +0 -0
  183. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/magnet_edge.h +0 -0
  184. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/magnet_kick.h +0 -0
  185. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/marker.h +0 -0
  186. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/misalignment.h +0 -0
  187. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/multipole.h +0 -0
  188. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/multipoleedge.h +0 -0
  189. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
  190. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/octupole.h +0 -0
  191. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
  192. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/rbend.h +0 -0
  193. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
  194. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
  195. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
  196. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
  197. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
  198. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
  199. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/slnd.h +0 -0
  200. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/srotation.h +0 -0
  201. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/temprf.h +0 -0
  202. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
  203. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_cavity.h +0 -0
  204. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_crab_cavity.h +0 -0
  205. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_multipole.h +0 -0
  206. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
  207. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
  208. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_rbend.h +0 -0
  209. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
  210. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thick_slice_uniform_solenoid.h +0 -0
  211. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
  212. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
  213. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
  214. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_cavity.h +0 -0
  215. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_crab_cavity.h +0 -0
  216. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_multipole.h +0 -0
  217. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
  218. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_octupole_entry.h +0 -0
  219. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_octupole_exit.h +0 -0
  220. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
  221. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_entry.h +0 -0
  222. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_exit.h +0 -0
  223. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_rbend.h +0 -0
  224. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_rbend_entry.h +0 -0
  225. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_rbend_exit.h +0 -0
  226. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
  227. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole_entry.h +0 -0
  228. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole_exit.h +0 -0
  229. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_entry.h +0 -0
  230. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_exit.h +0 -0
  231. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
  232. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
  233. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +0 -0
  234. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_drift.h +0 -0
  235. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid.h +0 -0
  236. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid_multipolar_components.h +0 -0
  237. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid_radiation.h +0 -0
  238. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet.h +0 -0
  239. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet.template.h +0 -0
  240. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet_configure.h +0 -0
  241. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet_drift.h +0 -0
  242. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet_edge.h +0 -0
  243. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet_kick.h +0 -0
  244. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_magnet_radiation.h +0 -0
  245. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_misalignments.h +0 -0
  246. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_mult_fringe.h +0 -0
  247. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_rf.h +0 -0
  248. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_rf.template.h +0 -0
  249. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
  250. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_thick_bend.h +0 -0
  251. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_thick_cfd.h +0 -0
  252. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_wedge.h +0 -0
  253. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
  254. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_xyshift.h +0 -0
  255. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
  256. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/variable_solenoid.h +0 -0
  257. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/wedge.h +0 -0
  258. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/wire.h +0 -0
  259. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
  260. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
  261. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
  262. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
  263. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/exciter.py +0 -0
  264. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/rft_element.py +0 -0
  265. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/slice_base.py +0 -0
  266. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/slice_elements_drift.py +0 -0
  267. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/slice_elements_edge.py +0 -0
  268. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/slice_elements_thick.py +0 -0
  269. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/beam_elements/slice_elements_thin.py +0 -0
  270. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/environment.py +0 -0
  271. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/footprint.py +0 -0
  272. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/functions.py +0 -0
  273. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/general.py +0 -0
  274. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/headers/atomicadd.h +0 -0
  275. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/headers/checks.h +0 -0
  276. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/headers/constants.h +0 -0
  277. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/headers/particle_states.h +0 -0
  278. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/headers/synrad_spectrum.h +0 -0
  279. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/headers/track.h +0 -0
  280. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/internal_record.py +0 -0
  281. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/json.py +0 -0
  282. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/line.py +0 -0
  283. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/linear_normal_form.py +0 -0
  284. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/load.py +0 -0
  285. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/loss_location_refinement/__init__.py +0 -0
  286. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
  287. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/lumi.py +0 -0
  288. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/mad_loader.py +0 -0
  289. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/mad_parser/__init__.py +0 -0
  290. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/mad_parser/madx.lark +0 -0
  291. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/mad_parser/parse.py +0 -0
  292. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/__init__.py +0 -0
  293. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/beam_position_monitor.h +0 -0
  294. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/beam_position_monitor.py +0 -0
  295. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/beam_profile_monitor.h +0 -0
  296. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/beam_profile_monitor.py +0 -0
  297. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/beam_size_monitor.h +0 -0
  298. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/beam_size_monitor.py +0 -0
  299. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/last_turns_monitor.h +0 -0
  300. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/last_turns_monitor.py +0 -0
  301. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/particles_monitor.h +0 -0
  302. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/monitors/particles_monitor.py +0 -0
  303. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/multiline.py +0 -0
  304. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/multiline_legacy/__init__.py +0 -0
  305. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/multiline_legacy/multiline_legacy.py +0 -0
  306. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/multiline_legacy/shared_knobs.py +0 -0
  307. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/multisetter/__init__.py +0 -0
  308. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/multisetter/multisetter.py +0 -0
  309. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/__init__.py +0 -0
  310. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/constants.py +0 -0
  311. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/masses.py +0 -0
  312. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/particles.py +0 -0
  313. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/pdg.py +0 -0
  314. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/rng_src/base_rng.h +0 -0
  315. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/particles/rng_src/particles_rng.h +0 -0
  316. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/pipeline/__init__.py +0 -0
  317. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/pipeline/core.py +0 -0
  318. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/pipeline/manager.py +0 -0
  319. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/pipeline/multitracker.py +0 -0
  320. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/prebuilt_kernel_definitions/__init__.py +0 -0
  321. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/prebuilt_kernel_definitions/element_inits.py +0 -0
  322. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/prebuilt_kernel_definitions/element_types.py +0 -0
  323. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/progress_indicator.py +0 -0
  324. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/__init__.py +0 -0
  325. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_generators.py +0 -0
  326. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_src/exponential.h +0 -0
  327. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
  328. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_src/normal.h +0 -0
  329. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_src/rutherford.h +0 -0
  330. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_src/uniform.h +0 -0
  331. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/random/random_src/uniform_accurate.h +0 -0
  332. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/slicing.py +0 -0
  333. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/survey.py +0 -0
  334. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/svgutils/__init__.py +0 -0
  335. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/svgutils/parser.py +0 -0
  336. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/svgutils/path.py +0 -0
  337. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/svgutils/svgutils.py +0 -0
  338. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/synctime.py +0 -0
  339. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/table.py +0 -0
  340. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/tapering.py +0 -0
  341. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/targets.py +0 -0
  342. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/track_flags.py +0 -0
  343. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/tracker.py +0 -0
  344. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/tracker_data.py +0 -0
  345. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/tracker_src/tracker.h +0 -0
  346. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/trajectory_correction.py +0 -0
  347. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/twiss.py +0 -0
  348. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack/twissplot.py +0 -0
  349. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack.egg-info/SOURCES.txt +0 -0
  350. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack.egg-info/dependency_links.txt +0 -0
  351. {xtrack-0.93.0 → xtrack-0.93.2}/xtrack.egg-info/requires.txt +0 -0
  352. {xtrack-0.93.0 → xtrack-0.93.2}/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.93.0
3
+ Version: 0.93.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
@@ -7,7 +7,7 @@ import xtrack as xt
7
7
  from xtrack._temp.boris_and_solenoid_map.solenoid_field import SolenoidField
8
8
 
9
9
 
10
- def test_boris_spatial():
10
+ def test_boris_spatial_solenoid_map():
11
11
  delta=np.array([0, 4])
12
12
  p0 = xt.Particles(mass0=xt.ELECTRON_MASS_EV, q0=1,
13
13
  energy0=45.6e9/1000,
@@ -114,4 +114,49 @@ def test_boris_spatial():
114
114
  xo.assert_allclose(ax_ref[i_part, :], mon.ax[i_part, :],
115
115
  rtol=0, atol=np.max(np.abs(ax_ref)*3e-2))
116
116
  xo.assert_allclose(ay_ref[i_part, :], mon.ay[i_part, :],
117
- rtol=0, atol=np.max(np.abs(ay_ref)*3e-2))
117
+ rtol=0, atol=np.max(np.abs(ay_ref)*3e-2))
118
+
119
+ def test_boris_spatial_drift():
120
+ def zero_field(x, y, z):
121
+ return (0*x, 0*y, 0*z)
122
+
123
+ integrator = xt.BorisSpatialIntegrator(fieldmap_callable=zero_field,
124
+ s_start=10,
125
+ s_end=20,
126
+ n_steps=15000)
127
+
128
+ drift = xt.Drift(length=10, model='exact')
129
+
130
+ p0 = xt.Particles('proton',
131
+ x=[1e-2, -1e-2], px=[15e-3, 0], delta=[0, 2], p0c=1e9, zeta=1)
132
+
133
+ p_integ = p0.copy()
134
+ integrator.track(p_integ)
135
+
136
+ p_drift = p0.copy()
137
+ drift.track(p_drift)
138
+
139
+ xo.assert_allclose(p_integ.x, p_drift.x, rtol=0, atol=1e-10)
140
+ xo.assert_allclose(p_integ.px, p_drift.px, rtol=0, atol=1e-10)
141
+ xo.assert_allclose(p_integ.y, p_drift.y, rtol=0, atol=1e-10)
142
+ xo.assert_allclose(p_integ.py, p_drift.py, rtol=0, atol=1e-10)
143
+ xo.assert_allclose(p_integ.s, p_drift.s, rtol=0, atol=1e-10)
144
+ xo.assert_allclose(p_integ.delta, p_drift.delta, rtol=0, atol=1e-10)
145
+ xo.assert_allclose(p_integ.zeta, p_drift.zeta, rtol=0, atol=1e-10)
146
+
147
+ # Check behavior with lost particles
148
+ p0 = xt.Particles('proton',
149
+ x=[1e-2, -1e-2], px=[15e-3, 0], delta=[0, 2], p0c=1e9, zeta=1,
150
+ state=[1, -1])
151
+
152
+ p_integ = p0.copy()
153
+ integrator.track(p_integ)
154
+ p_drift = p0.copy()
155
+ drift.track(p_drift)
156
+
157
+ xo.assert_allclose(p_integ.x, p_drift.x, rtol=0, atol=1e-10)
158
+ xo.assert_allclose(p_integ.px, p_drift.px, rtol=0, atol=1e-10)
159
+ xo.assert_allclose(p_integ.y, p_drift.y, rtol=0, atol=1e-10)
160
+ xo.assert_allclose(p_integ.py, p_drift.py, rtol=0, atol=1e-10)
161
+ xo.assert_allclose(p_integ.s, p_drift.s, rtol=0, atol=1e-10)
162
+ xo.assert_allclose(p_integ.delta, p_drift.delta, rtol=0, atol=1e-10)
@@ -163,4 +163,142 @@ def test_madng_conversion_drift_slice():
163
163
  tw_ng = line.madng_twiss(normal_form=False)
164
164
 
165
165
  xo.assert_allclose(tw_ng.beta11_ng, tw.betx, rtol=1e-8)
166
- xo.assert_allclose(tw_ng.beta22_ng, tw.bety, rtol=1e-8)
166
+ xo.assert_allclose(tw_ng.beta22_ng, tw.bety, rtol=1e-8)
167
+
168
+ def test_madng_interface_with_slicing():
169
+ line = xt.load(test_data_folder /
170
+ 'hllhc15_thick/lhc_thick_with_knobs.json')
171
+
172
+ # Cut line at every 1 up to s = 1000
173
+ line.cut_at_s(np.arange(1000))
174
+
175
+ tw_xs = line.twiss4d()
176
+ tw = line.madng_twiss()
177
+
178
+ assert len(tw) == len(tw_xs)
179
+
180
+ xo.assert_allclose(tw.x, 0, atol=1e-10, rtol=0)
181
+ xo.assert_allclose(tw.y, 0, atol=1e-10, rtol=0)
182
+ xo.assert_allclose(tw.betx2, 0, atol=1e-10, rtol=0)
183
+ xo.assert_allclose(tw.bety1, 0, atol=1e-10, rtol=0)
184
+ xo.assert_allclose(tw.x, tw.x_ng, atol=1e-8, rtol=0)
185
+ xo.assert_allclose(tw.y, tw.y_ng, atol=1e-10, rtol=0)
186
+ xo.assert_allclose(tw.betx2, tw.beta12_ng, atol=1e-10, rtol=0)
187
+ xo.assert_allclose(tw.bety1, tw.beta21_ng, atol=1e-19, rtol=0)
188
+ xo.assert_allclose(tw.wx_chrom, tw.wx_ng, atol=5e-3*tw.wx_chrom.max(), rtol=0)
189
+ xo.assert_allclose(tw.wy_chrom, tw.wy_ng, atol=5e-3*tw.wy_chrom.max(), rtol=0)
190
+ xo.assert_allclose(tw.ax_chrom, tw.ax_ng, atol=5e-3*tw.wx_chrom.max(), rtol=0)
191
+ xo.assert_allclose(tw.ay_chrom, tw.ay_ng, atol=5e-3*tw.wy_chrom.max(), rtol=0)
192
+ xo.assert_allclose(tw.bx_chrom, tw.bx_ng, atol=5e-3*tw.wx_chrom.max(), rtol=0)
193
+ xo.assert_allclose(tw.by_chrom, tw.by_ng, atol=5e-3*tw.wy_chrom.max(), rtol=0)
194
+
195
+ def test_madng_twiss_with_initial_conditions():
196
+ line = xt.load(test_data_folder /
197
+ 'hllhc15_thick/lhc_thick_with_knobs.json')
198
+ #pytest.set_trace()
199
+ tw_xs = line.twiss(betx=120, bety=150)
200
+ tw = line.madng_twiss(beta11=120, beta22=150)
201
+
202
+ assert len(tw) == len(tw_xs)
203
+ assert len(tw.betx) == len(tw.beta11_ng)
204
+
205
+ xo.assert_allclose(tw.betx, tw.beta11_ng, rtol=1e-7, atol=1e-6)
206
+ xo.assert_allclose(tw.bety, tw.beta22_ng, rtol=1e-7, atol=1e-6)
207
+ xo.assert_allclose(tw.alfx, tw.alfa11_ng, rtol=1e-7, atol=1e-6)
208
+ xo.assert_allclose(tw.alfy, tw.alfa22_ng, rtol=1e-7, atol=1e-6)
209
+ xo.assert_allclose(tw.dx, tw.dx_ng, rtol=1e-8, atol=1e-6)
210
+ xo.assert_allclose(tw.dy, tw.dy_ng, rtol=1e-8, atol=1e-6)
211
+ xo.assert_allclose(tw.dpx, tw.dpx_ng, rtol=1e-8, atol=1e-6)
212
+ xo.assert_allclose(tw.dpy, tw.dpy_ng, rtol=1e-8, atol=1e-6)
213
+ xo.assert_allclose(tw.x, tw.x_ng, rtol=1e-8, atol=1e-6)
214
+ xo.assert_allclose(tw.y, tw.y_ng, rtol=1e-8, atol=1e-6)
215
+
216
+ tw2_xs = line.twiss(start='s.ds.l8.b1', end='ip1', betx=100, bety=34)
217
+ tw2_xsng = line.madng_twiss(start='s.ds.l8.b1', end='ip1', beta11=100, beta22=34, xsuite_tw=False)
218
+
219
+ assert len(tw2_xs.betx) == len(tw2_xsng.beta11_ng)
220
+ xo.assert_allclose(tw2_xs.betx, tw2_xsng.beta11_ng, rtol=1e-8, atol=1e-6)
221
+ xo.assert_allclose(tw2_xs.bety, tw2_xsng.beta22_ng, rtol=1e-8, atol=1e-6)
222
+ xo.assert_allclose(tw2_xs.alfx, tw2_xsng.alfa11_ng, rtol=1e-8, atol=1e-6)
223
+ xo.assert_allclose(tw2_xs.alfy, tw2_xsng.alfa22_ng, rtol=1e-8, atol=1e-6)
224
+ xo.assert_allclose(tw2_xs.dx, tw2_xsng.dx_ng, rtol=1e-8, atol=1e-6)
225
+ xo.assert_allclose(tw2_xs.dy, tw2_xsng.dy_ng, rtol=1e-8, atol=1e-6)
226
+ xo.assert_allclose(tw2_xs.dpx, tw2_xsng.dpx_ng, rtol=1e-8, atol=1e-6)
227
+ xo.assert_allclose(tw2_xs.dpy, tw2_xsng.dpy_ng, rtol=1e-8, atol=1e-6)
228
+ xo.assert_allclose(tw2_xs.x, tw2_xsng.x_ng, rtol=1e-8, atol=1e-8)
229
+ xo.assert_allclose(tw2_xs.y, tw2_xsng.y_ng, rtol=1e-8, atol=1e-8)
230
+
231
+ tw3_xs = line.twiss(start='ip8', end='ip2', betx=1.5, bety=1.5)
232
+ tw3_xsng = line.madng_twiss(start='ip8', end='ip2', beta11=1.5, beta22=1.5, xsuite_tw=True)
233
+
234
+ assert len(tw3_xs.betx) == len(tw3_xsng.beta11_ng)
235
+ xo.assert_allclose(tw3_xs.betx, tw3_xsng.beta11_ng, rtol=1e-8, atol=1e-6)
236
+ xo.assert_allclose(tw3_xs.bety, tw3_xsng.beta22_ng, rtol=1e-8, atol=1e-6)
237
+ xo.assert_allclose(tw3_xs.alfx, tw3_xsng.alfa11_ng, rtol=1e-8, atol=1e-6)
238
+ xo.assert_allclose(tw3_xs.alfy, tw3_xsng.alfa22_ng, rtol=1e-8, atol=1e-6)
239
+ xo.assert_allclose(tw3_xs.dx, tw3_xsng.dx_ng, rtol=1e-8, atol=1e-6)
240
+ xo.assert_allclose(tw3_xs.dy, tw3_xsng.dy_ng, rtol=1e-8, atol=1e-6)
241
+ xo.assert_allclose(tw3_xs.dpx, tw3_xsng.dpx_ng, rtol=1e-8, atol=1e-6)
242
+ xo.assert_allclose(tw3_xs.dpy, tw3_xsng.dpy_ng, rtol=1e-8, atol=1e-6)
243
+ xo.assert_allclose(tw3_xs.x, tw3_xsng.x_ng, rtol=1e-8, atol=1e-8)
244
+ xo.assert_allclose(tw3_xs.y, tw3_xsng.y_ng, rtol=1e-8, atol=1e-8)
245
+
246
+ xo.assert_allclose(tw3_xsng.betx, tw3_xsng.beta11_ng, rtol=1e-8, atol=1e-6)
247
+ xo.assert_allclose(tw3_xsng.bety, tw3_xsng.beta22_ng, rtol=1e-8, atol=1e-6)
248
+ xo.assert_allclose(tw3_xsng.alfx, tw3_xsng.alfa11_ng, rtol=1e-8, atol=1e-6)
249
+ xo.assert_allclose(tw3_xsng.alfy, tw3_xsng.alfa22_ng, rtol=1e-8, atol=1e-6)
250
+
251
+ def test_madng_slices():
252
+ line = xt.load(test_data_folder /
253
+ 'hllhc15_thick/lhc_thick_with_knobs.json')
254
+ tw = line.twiss4d()
255
+
256
+ twng = line.madng_twiss()
257
+
258
+ line.cut_at_s(np.linspace(0, line.get_length(), 5000))
259
+ tw_sliced = line.twiss4d()
260
+ twng_sliced = line.madng_twiss()
261
+ tt_sliced = line.get_table()
262
+
263
+ assert np.all(np.array(sorted(list(set(tt_sliced.element_type)))) ==
264
+ ['',
265
+ 'Cavity',
266
+ 'Drift',
267
+ 'DriftSlice',
268
+ 'Marker',
269
+ 'Multipole',
270
+ 'Octupole',
271
+ 'Quadrupole',
272
+ 'RBend',
273
+ 'Sextupole',
274
+ 'ThickSliceBend',
275
+ 'ThickSliceCavity',
276
+ 'ThickSliceMultipole',
277
+ 'ThickSliceOctupole',
278
+ 'ThickSliceQuadrupole',
279
+ 'ThickSliceRBend',
280
+ 'ThickSliceSextupole',
281
+ 'ThickSliceUniformSolenoid',
282
+ 'ThinSliceBendEntry',
283
+ 'ThinSliceBendExit',
284
+ 'ThinSliceOctupoleEntry',
285
+ 'ThinSliceOctupoleExit',
286
+ 'ThinSliceQuadrupoleEntry',
287
+ 'ThinSliceQuadrupoleExit',
288
+ 'ThinSliceRBendEntry',
289
+ 'ThinSliceRBendExit',
290
+ 'ThinSliceSextupoleEntry',
291
+ 'ThinSliceSextupoleExit',
292
+ 'ThinSliceUniformSolenoidEntry',
293
+ 'ThinSliceUniformSolenoidExit',
294
+ 'UniformSolenoid'])
295
+
296
+ twng_ip = twng.rows['ip.*']
297
+ twng_ip_sliced = twng_sliced.rows['ip.*']
298
+ xo.assert_allclose(twng_ip.s, twng_ip_sliced.s, rtol=1e-8)
299
+ xo.assert_allclose(twng_ip.beta11_ng, twng_ip_sliced.beta11_ng, rtol=1e-3)
300
+ xo.assert_allclose(twng_ip.beta22_ng, twng_ip_sliced.beta22_ng, rtol=1e-3)
301
+ xo.assert_allclose(twng_ip.wx_ng, twng_ip_sliced.wx_ng, rtol=1e-3)
302
+ xo.assert_allclose(twng_ip.wy_ng, twng_ip_sliced.wy_ng, rtol=1e-3)
303
+ xo.assert_allclose(twng_ip.dx_ng, twng_ip_sliced.dx_ng, atol=1e-6)
304
+ xo.assert_allclose(twng_ip.dy_ng, twng_ip_sliced.dy_ng, atol=1e-6)
@@ -492,5 +492,110 @@ def test_survey_against_madx():
492
492
 
493
493
  xo.assert_allclose(sv.s[1:], sv_mad.s, atol=1e-14, rtol=0)
494
494
 
495
+ xo.assert_allclose(p[:, 0], 1e-3, atol=1e-14)
496
+ xo.assert_allclose(p[:, 1], 2e-3, atol=1e-14)
497
+
498
+ def test_survey_transforms_native_loader():
499
+
500
+ from cpymad.madx import Madx
501
+
502
+ seq_src = ("""
503
+
504
+ on_srot = 1;
505
+ pi = 3.14159265358979323846;
506
+
507
+ tr1: translation, dx=1e-2, dy=2e-2;
508
+
509
+ rs2: srotation, angle=-1.04*on_srot;
510
+
511
+ r3: yrotation, angle=-0.1;
512
+ r4: yrotation, angle=0.1;
513
+
514
+ rx1 : xrotation, angle=0.1;
515
+ rx2 : xrotation, angle=-0.1;
516
+
517
+ bh1 : sbend, angle=0.1, k0=1e-22, l=0.1;
518
+ bh2 : sbend, angle=-0.1, k0=1e-22, l=0.1;
519
+
520
+ bv1: sbend, tilt=pi/2, angle=0.2, k0=1e-22, l=0.1;
521
+ bv2: sbend, tilt=pi/2, angle=-0.2, k0=1e-22, l=0.1;
522
+
523
+ ss: sequence,l=20;
524
+ tr1, at=5;
525
+ rs2, at=5.5;
526
+ rx1, at=6;
527
+ rx2, at=7;
528
+ r3, at=8;
529
+ r4, at=9;
530
+ bh1, at=10;
531
+ bh2, at=11;
532
+ bv1, at=12;
533
+ bv2, at=14;
534
+ end: marker, at=16;
535
+ endsequence;
536
+ """)
537
+
538
+ mad = Madx()
539
+ mad.input(seq_src)
540
+
541
+ mad.input("""
542
+ beam;
543
+ use,sequence=ss;
544
+ twiss,betx=1,bety=1,x=1e-3,y=2e-3;
545
+ survey;
546
+
547
+ ptc_create_universe;
548
+ ptc_create_layout, model=1, method=6, exact=True, NST=100;
549
+ ptc_align;
550
+ ptc_twiss, icase=56, betx=1., bety=1., betz=1,x=1e-3, y=2e-3;
551
+
552
+ """)
553
+
554
+ line = xt.load(string=seq_src, format='madx').ss
555
+ line.particle_ref = xt.Particles(p0c=1E9)
556
+
557
+ line['bh1'].k0_from_h = False
558
+ line['bh2'].k0_from_h = False
559
+ line['bh1'].k0 = 0
560
+ line['bh2'].k0 = 0
561
+
562
+ sv_mad = xt.Table(mad.table.survey)
563
+ tw_ptc = xt.Table(mad.table.ptc_twiss)
564
+
565
+ line.build_tracker()
566
+
567
+ line.tracker.track_flags.XS_FLAG_IGNORE_GLOBAL_APERTURE = True
568
+ line.configure_drift_model(model='exact')
569
+
570
+ sv = line.survey()
571
+ tw = line.twiss(betx=1, bety=1, x=1e-3, y=2e-3)
572
+
573
+ p = tw.x[:, None] * sv.ex + tw.y[:, None] * sv.ey + sv.p0
574
+ X = p[:, 0]
575
+ Y = p[:, 1]
576
+ Z = p[:, 2]
577
+
578
+ assert (tw.name == np.array(
579
+ ['drift_1', 'tr1', 'drift_2', 'rs2', 'drift_3', 'rx1', 'drift_4',
580
+ 'rx2', 'drift_5', 'r3', 'drift_6', 'r4', 'drift_7', 'bh1',
581
+ 'drift_8', 'bh2', 'drift_9', 'bv1', 'drift_10', 'bv2', 'drift_11',
582
+ 'end', 'drift_12', '_end_point'], dtype=object)).all()
583
+
584
+ assert (tw_ptc.name == np.array(['ss$start:1', 'drift_0:0', 'tr1:1', 'drift_1:0', 'rs2:1',
585
+ 'drift_2:0', 'rx1:1', 'drift_3:0', 'rx2:1', 'drift_4:0', 'r3:1',
586
+ 'drift_5:0', 'r4:1', 'drift_6:0', 'bh1:1', 'drift_7:0', 'bh2:1',
587
+ 'drift_8:0', 'bv1:1', 'drift_9:0', 'bv2:1', 'drift_10:0', 'end:1',
588
+ 'drift_11:0', 'ss$end:1'], dtype=object)).all()
589
+
590
+ # MAD gives results at the end of the element
591
+ xo.assert_allclose(tw.x[1:], tw_ptc.x[1:-1], atol=1e-14, rtol=0)
592
+ xo.assert_allclose(tw.y[1:], tw_ptc.y[1:-1], atol=1e-14, rtol=0)
593
+
594
+ xo.assert_allclose(sv.X[1:], sv_mad.x[1:-1], atol=1e-14, rtol=0)
595
+ xo.assert_allclose(sv.Y[1:], sv_mad.y[1:-1], atol=1e-14, rtol=0)
596
+ xo.assert_allclose(sv.Z[1:], sv_mad.z[1:-1], atol=1e-14, rtol=0)
597
+
598
+ xo.assert_allclose(sv.s[1:], sv_mad.s[1:-1], atol=1e-14, rtol=0)
599
+
495
600
  xo.assert_allclose(p[:, 0], 1e-3, atol=1e-14)
496
601
  xo.assert_allclose(p[:, 1], 2e-3, atol=1e-14)
@@ -0,0 +1 @@
1
+ __version__ = '0.93.2'
@@ -18,27 +18,34 @@ class BorisSpatialIntegrator:
18
18
 
19
19
  def track(self, p):
20
20
 
21
+ mask_alive = p.state > 0
22
+
21
23
  x_log = []
22
24
  y_log = []
23
25
  z_log = []
24
- s_in = p.s.copy()
25
- p.s=self.s_start
26
+ s_in = p.s[mask_alive].copy()
27
+ p.s[mask_alive] = self.s_start
26
28
 
27
29
  for ii in range(self.n_steps):
28
30
 
29
31
  if self.verbose:
30
32
  print(f's_in = {s_in[0]:.3f} s_in_map = {p.s[0]:.3f}', end='\r', flush=True)
31
33
 
32
- q0 = p.q0
33
- x = p.x.copy()
34
- y = p.y.copy()
35
- z = p.s.copy()
36
- px = p.px.copy()
37
- py = p.py.copy()
38
- delta = p.delta.copy()
39
- p0c = p.p0c
40
-
41
- charge0_coulomb = q0 * qe
34
+ x = p.x[mask_alive].copy()
35
+ y = p.y[mask_alive].copy()
36
+ z = p.s[mask_alive].copy()
37
+ px = p.px[mask_alive].copy()
38
+ py = p.py[mask_alive].copy()
39
+ delta = p.delta[mask_alive].copy()
40
+ energy = p.energy[mask_alive].copy()
41
+ p0c = p.p0c[mask_alive].copy()
42
+ beta0 = p.beta0[mask_alive].copy()
43
+ charge = p.charge[mask_alive].copy()
44
+ mass = p.mass[mask_alive].copy()
45
+
46
+ charge_coulomb = charge * qe
47
+ mass_kg = mass * qe / clight**2
48
+ gamma = energy / mass
42
49
 
43
50
  P0 = p0c * qe / clight # in kg m/s
44
51
  P = P0 * (1 + delta)
@@ -51,19 +58,20 @@ class BorisSpatialIntegrator:
51
58
  w[:, 1] = Py
52
59
  w[:, 2] = P
53
60
 
54
- x_new, y_new, z_new, w_new = step_spatial_boris_B(x, y, z, w,
55
- charge0_coulomb, self.ds,
56
- field_fn=self.fieldmap_callable)
57
- p.x = x_new.copy()
58
- p.y = y_new.copy()
59
- p.s = z_new.copy()
60
- p.px = w_new[:, 0] / P0
61
- p.py = w_new[:, 1] / P0
61
+ x_new, y_new, z_new, w_new, dt = step_spatial_boris_B(x, y, z, w,
62
+ charge_coulomb, self.ds,
63
+ field_fn=self.fieldmap_callable, m_kg=mass_kg, gamma=gamma)
64
+ p.x[mask_alive] = x_new
65
+ p.y[mask_alive] = y_new
66
+ p.s[mask_alive] = z_new
67
+ p.px[mask_alive] = w_new[:, 0] / P0
68
+ p.py[mask_alive] = w_new[:, 1] / P0
69
+ p.zeta[mask_alive] += (self.ds - dt * clight * beta0)
62
70
 
63
71
  x_log.append(p.x.copy())
64
72
  y_log.append(p.y.copy())
65
73
  z_log.append(p.s.copy())
66
- p.s = s_in + self.length
74
+ p.s[mask_alive] = s_in + self.length
67
75
  self.x_log = np.array(x_log)
68
76
  self.y_log = np.array(y_log)
69
77
  self.z_log = np.array(z_log)
@@ -72,7 +80,7 @@ class BorisSpatialIntegrator:
72
80
  import numpy as np
73
81
  c = 299_792_458.0 # m/s
74
82
 
75
- def step_spatial_boris_B(x, y, z, w, q, dz, field_fn):
83
+ def step_spatial_boris_B(x, y, z, w, q, dz, field_fn, m_kg, gamma):
76
84
  """
77
85
  Spatial Boris step for magnetic fields only (E = 0),
78
86
  using constant total momentum magnitude P = w[:,2].
@@ -99,6 +107,8 @@ def step_spatial_boris_B(x, y, z, w, q, dz, field_fn):
99
107
  Updated momentum state (px, py, P).
100
108
  """
101
109
 
110
+ dt = 0.
111
+
102
112
  # --- Unpack and ensure arrays
103
113
  x = np.asarray(x)
104
114
  y = np.asarray(y)
@@ -113,6 +123,7 @@ def step_spatial_boris_B(x, y, z, w, q, dz, field_fn):
113
123
  xh = x + (px / pz) * (dz * 0.5)
114
124
  yh = y + (py / pz) * (dz * 0.5)
115
125
  zh = z + dz * 0.5
126
+ dt += (dz * 0.5) / pz * gamma * m_kg # s
116
127
 
117
128
  # --- Evaluate magnetic field at mid-step
118
129
  Bx, By, Bz = field_fn(xh, yh, zh)
@@ -154,8 +165,9 @@ def step_spatial_boris_B(x, y, z, w, q, dz, field_fn):
154
165
  x1 = xh + (px1 / pz1) * (dz * 0.5)
155
166
  y1 = yh + (py1 / pz1) * (dz * 0.5)
156
167
  z1 = z + dz
168
+ dt += (dz * 0.5) / pz1 * gamma * m_kg # s
157
169
 
158
170
  # --- Pack updated (px, py, P)
159
171
  w1 = np.stack([px1, py1, P], axis=1)
160
172
 
161
- return x1, y1, z1, w1
173
+ return x1, y1, z1, w1, dt
@@ -137,6 +137,10 @@ class MadxLoader:
137
137
  self._new_builtin("multipole", "Multipole", knl=6 * [0])
138
138
  self._new_builtin("solenoid", "UniformSolenoid")
139
139
  self._new_builtin("crabcavity", "CrabCavity")
140
+ self._new_builtin("xrotation", "XRotation")
141
+ self._new_builtin("yrotation", "YRotation")
142
+ self._new_builtin("srotation", "SRotation")
143
+ self._new_builtin("translation", "XYShift")
140
144
 
141
145
  for mad_apertype in _APERTURE_TYPES:
142
146
  self._new_builtin(mad_apertype, 'Marker')
@@ -466,6 +470,13 @@ class MadxLoader:
466
470
  elif parent_name == 'marker':
467
471
  params.pop('isthick', None)
468
472
  params.pop('length', None)
473
+ elif parent_name in {'srotation', 'xrotation', 'yrotation'}:
474
+ if (angle := params.pop('angle', None)):
475
+ params['angle'] = (angle * 180) / np.pi
476
+ elif parent_name == 'translation':
477
+ if (ds := params.pop('ds', None)):
478
+ raise NotImplementedError('`ds` parameter not supported yet for '
479
+ '`translation` elements.')
469
480
 
470
481
  if 'edge_entry_fint' in params and 'edge_exit_fint' not in params:
471
482
  params['edge_exit_fint'] = params['edge_entry_fint']