xtrack 0.65.4__tar.gz → 0.66.0__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.
- {xtrack-0.65.4/xtrack.egg-info → xtrack-0.66.0}/PKG-INFO +1 -1
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_optics_and_ip_knob.py +1 -1
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +1 -1
- xtrack-0.66.0/tests/test_periodic_symmetric_twiss_and_match.py +154 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_random_gen.py +6 -4
- xtrack-0.66.0/tests/test_seeds.py +51 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_twiss.py +26 -1
- xtrack-0.66.0/xtrack/_version.py +1 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements.py +6 -6
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/dipole_fringe.h +6 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +6 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_mult_fringe.h +6 -2
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_thick_bend.h +3 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_thick_cfd.h +3 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_wedge.h +2 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/slice_elements.py +5 -5
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/slice_elements_thick.py +4 -4
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/headers/synrad_spectrum.h +1 -1
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/line.py +15 -2
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/match.py +7 -3
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/particles/particles.py +4 -4
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/particles/rng_src/base_rng.h +13 -5
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/pipeline/core.py +2 -2
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/pipeline/manager.py +22 -22
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/pipeline/multitracker.py +5 -1
- xtrack-0.66.0/xtrack/random/__init__.py +5 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/random/random_generators.py +26 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/random/random_src/uniform.h +22 -0
- xtrack-0.66.0/xtrack/random/random_src/uniform_accurate.h +48 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/twiss.py +82 -35
- {xtrack-0.65.4 → xtrack-0.66.0/xtrack.egg-info}/PKG-INFO +1 -1
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack.egg-info/SOURCES.txt +3 -0
- xtrack-0.65.4/xtrack/_version.py +0 -1
- xtrack-0.65.4/xtrack/random/__init__.py +0 -3
- {xtrack-0.65.4 → xtrack-0.66.0}/LICENSE +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/MANIFEST.in +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/README.md +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/base_classes.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/BB6D.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/beambeam.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/boost.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/qgauss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/slicing.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/be_beamfields/spacecharge.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/elements.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/line.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/mathlibs.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/particles.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/ducktrack/temp_pyparticles.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/pyproject.toml +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/setup.cfg +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/setup.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_acceleration.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_amplitude_detuning.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_apertures.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_attr_replicas_and_slices.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_cavity_absolute_time.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_chromatic_functions_vs_madx.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_coasting.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_collective_tracker.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_collimation.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_element_characterization_functions.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_element_internal_record.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_elements.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_elements_classflags.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_elements_thick.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_fcc_ee_solenoid_correction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_footprint.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_freeze_longitudinal.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_full_rings.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_hvkick.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_ions.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_lhc_match_phase_15.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_line.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_lumi.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_mad_writer.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_madloader.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_and_track_from_element.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_coupling_knob.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_nested.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_orbit_bump.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_match_tune_chroma_cminus.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_multiline.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_multisetter.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_multispecies.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_particles_api.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_pipeline.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_prebuild_kernels.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_ps_against_ptc.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_ps_multiturn_twiss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_psb_chicane.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_pyht_interface.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_radial_steering.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_radiation.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_radiation_equilibrium_emittances.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_random_gen_exp.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_random_gen_gauss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_random_gen_ruth.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_rf_track.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_rotation_signs.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_second_order_taylor_map.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_slice_and_insert_with_replicas.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_slice_elements.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_slicing.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_spacecharge_in_ring.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_sps_thick.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_survey.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_tapering.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_thick_lhc.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_tilt_shifts.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_tracker.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_trajectory_correcton.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_twiss_vs_madx_psb.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_var_cache.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_vs_madx.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/tests/test_xmask_orbit_correction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/lhc_match/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/_temp/lhc_match/var_limits.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/base_element.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/beam_interaction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/cavity.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift_elem.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/elens.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/exciter.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/multipole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/solenoid.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/srotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thick_slice_drift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thick_slice_solenoid.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_multipolar_components.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_multipole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_solenoid.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/wedge.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/wire.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/exciter.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/beam_elements/rft_element.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/footprint.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/general.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/headers/atomicadd.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/headers/checks.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/headers/constants.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/headers/particle_states.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/internal_record.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/linear_normal_form.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/loss_location_refinement/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/lumi.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/mad_loader.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/mad_writer.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/beam_position_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/beam_position_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/beam_profile_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/beam_profile_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/beam_size_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/beam_size_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/last_turns_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/last_turns_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/particles_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/monitors/particles_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/multiline/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/multiline/multiline.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/multiline/shared_knobs.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/multisetter/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/multisetter/multisetter.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/particles/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/particles/constants.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/particles/rng_src/particles_rng.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/pipeline/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/progress_indicator.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/random/random_src/exponential.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/random/random_src/normal.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/random/random_src/rutherford.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/slicing.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/survey.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/synctime.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/tapering.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/targets.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/tracker.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/tracker_data.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/tracker_src/tracker.h +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/trajectory_correction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack/twissplot.py +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack.egg-info/dependency_links.txt +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack.egg-info/requires.txt +0 -0
- {xtrack-0.65.4 → xtrack-0.66.0}/xtrack.egg-info/top_level.txt +0 -0
@@ -499,7 +499,7 @@ def test_match_ir8_optics(test_context):
|
|
499
499
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
500
500
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
501
501
|
|
502
|
-
opt.step(
|
502
|
+
opt.step(12)
|
503
503
|
assert opt.log()['penalty', -1] < 0.1
|
504
504
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
505
505
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
@@ -499,7 +499,7 @@ def test_match_ir8_optics_new_optimize_api(test_context):
|
|
499
499
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
500
500
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
501
501
|
|
502
|
-
opt.step(
|
502
|
+
opt.step(12)
|
503
503
|
assert opt.log()['penalty', -1] < 0.1
|
504
504
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
505
505
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
@@ -0,0 +1,154 @@
|
|
1
|
+
|
2
|
+
import xtrack as xt
|
3
|
+
import xobjects as xo
|
4
|
+
import numpy as np
|
5
|
+
|
6
|
+
def test_periodic_symmetric_twiss_and_match():
|
7
|
+
|
8
|
+
# Build line with half a cell
|
9
|
+
half_cell = xt.Line(
|
10
|
+
elements={
|
11
|
+
'start_cell': xt.Marker(),
|
12
|
+
'drift0': xt.Drift(length=1.),
|
13
|
+
'qf1': xt.Quadrupole(k1=0.027/2, length=1.),
|
14
|
+
'drift1_1': xt.Drift(length=1),
|
15
|
+
'bend1': xt.Bend(k0=3e-4, h=3e-4, length=45.),
|
16
|
+
'drift1_2': xt.Drift(length=1.),
|
17
|
+
'qd1': xt.Quadrupole(k1=-0.0271/2, length=1.),
|
18
|
+
'drift2': xt.Drift(length=1),
|
19
|
+
'mid_cell': xt.Marker(),
|
20
|
+
}
|
21
|
+
)
|
22
|
+
half_cell.particle_ref = xt.Particles(p0c=2e9)
|
23
|
+
|
24
|
+
tw_half_cell = half_cell.twiss4d(init='periodic_symmetric', # <--- periodic-symmetric boundary
|
25
|
+
strengths=True # to get the strengths in table
|
26
|
+
)
|
27
|
+
|
28
|
+
cell = xt.Line(
|
29
|
+
elements={
|
30
|
+
'start_cell': xt.Marker(),
|
31
|
+
'drift0': xt.Drift(length=1.),
|
32
|
+
'qf1': xt.Quadrupole(k1=0.027/2, length=1.),
|
33
|
+
'drift1': xt.Drift(length=1),
|
34
|
+
'bend1': xt.Bend(k0=3e-4, h=3e-4, length=45.),
|
35
|
+
'drift2': xt.Drift(length=1.),
|
36
|
+
'qd1': xt.Quadrupole(k1=-0.0271/2, length=1.),
|
37
|
+
'drift3': xt.Drift(length=1),
|
38
|
+
'mid_cell': xt.Marker(),
|
39
|
+
'drift4': xt.Replica('drift3'),
|
40
|
+
'qd2': xt.Replica('qd1'),
|
41
|
+
'drift5': xt.Replica('drift2'),
|
42
|
+
'bend2': xt.Replica('bend1'),
|
43
|
+
'drift6': xt.Replica('drift1'),
|
44
|
+
'qf2': xt.Replica('qf1'),
|
45
|
+
'drift7': xt.Replica('drift0'),
|
46
|
+
'end_cell': xt.Marker(),
|
47
|
+
}
|
48
|
+
)
|
49
|
+
cell.particle_ref = xt.Particles(p0c=2e9)
|
50
|
+
tw_cell = cell.twiss4d(strengths=True)
|
51
|
+
|
52
|
+
xo.assert_allclose(tw_half_cell.betx[:-1], # remove '_end_point'
|
53
|
+
tw_cell.rows[:'mid_cell'].betx, atol=0, rtol=1e-8)
|
54
|
+
xo.assert_allclose(tw_half_cell.bety[:-1], # remove '_end_point'
|
55
|
+
tw_cell.rows[:'mid_cell'].bety, atol=0, rtol=1e-8)
|
56
|
+
xo.assert_allclose(tw_half_cell.alfx[:-1], # remove '_end_point'
|
57
|
+
tw_cell.rows[:'mid_cell'].alfx, atol=1e-8, rtol=0)
|
58
|
+
xo.assert_allclose(tw_half_cell.alfy[:-1], # remove '_end_point'
|
59
|
+
tw_cell.rows[:'mid_cell'].alfy, atol=1e-8, rtol=0)
|
60
|
+
xo.assert_allclose(tw_half_cell.dx[:-1], # remove '_end_point'
|
61
|
+
tw_cell.rows[:'mid_cell'].dx, atol=1e-8, rtol=0)
|
62
|
+
xo.assert_allclose(tw_half_cell.dpx[:-1], # remove '_end_point'
|
63
|
+
tw_cell.rows[:'mid_cell'].dpx, atol=1e-8, rtol=0)
|
64
|
+
|
65
|
+
xo.assert_allclose(tw_half_cell.ax_chrom[:-1], # remove '_end_point'
|
66
|
+
tw_cell.rows[:'mid_cell'].ax_chrom, atol=1e-5, rtol=0)
|
67
|
+
xo.assert_allclose(tw_half_cell.ay_chrom[:-1], # remove '_end_point'
|
68
|
+
tw_cell.rows[:'mid_cell'].ay_chrom, atol=1e-5, rtol=0)
|
69
|
+
xo.assert_allclose(tw_half_cell.bx_chrom[:-1], # remove '_end_point'
|
70
|
+
tw_cell.rows[:'mid_cell'].bx_chrom, atol=1e-5, rtol=0)
|
71
|
+
xo.assert_allclose(tw_half_cell.by_chrom[:-1], # remove '_end_point'
|
72
|
+
tw_cell.rows[:'mid_cell'].by_chrom, atol=1e-5, rtol=0)
|
73
|
+
|
74
|
+
xo.assert_allclose(tw_half_cell.qx, tw_cell.qx / 2, atol=1e-9, rtol=0)
|
75
|
+
xo.assert_allclose(tw_half_cell.qy, tw_cell.qy / 2, atol=1e-9, rtol=0)
|
76
|
+
xo.assert_allclose(tw_half_cell.dqx, tw_cell.dqx / 2, atol=1e-6, rtol=0)
|
77
|
+
xo.assert_allclose(tw_half_cell.dqy, tw_cell.dqy / 2, atol=1e-6, rtol=0)
|
78
|
+
|
79
|
+
for ll in [cell, half_cell]:
|
80
|
+
ll.vars['kqf'] = 0.027/2
|
81
|
+
ll.vars['kqd'] = -0.0271/2
|
82
|
+
ll.element_refs['qf1'].k1 = ll.vars['kqf']
|
83
|
+
ll.element_refs['qd1'].k1 = ll.vars['kqd']
|
84
|
+
|
85
|
+
tw_cell = cell.twiss4d(strengths=True)
|
86
|
+
tw_half_cell = half_cell.twiss4d(init='periodic_symmetric', strengths=True)
|
87
|
+
|
88
|
+
xo.assert_allclose(tw_cell.mux[-1], 0.231, atol=1e-3, rtol=0)
|
89
|
+
xo.assert_allclose(tw_cell.muy[-1], 0.233, atol=1e-3, rtol=0)
|
90
|
+
xo.assert_allclose(tw_half_cell.mux[-1], 0.231 / 2, atol=1e-3, rtol=0)
|
91
|
+
xo.assert_allclose(tw_half_cell.muy[-1], 0.233 / 2, atol=1e-3, rtol=0)
|
92
|
+
|
93
|
+
opt_halfcell = half_cell.match(
|
94
|
+
method='4d',
|
95
|
+
start='start_cell', end='mid_cell',
|
96
|
+
init='periodic_symmetric',
|
97
|
+
targets=xt.TargetSet(mux=0.2501/2, muy=0.2502/2, at='mid_cell'),
|
98
|
+
vary=xt.VaryList(['kqf', 'kqd'], step=1e-5),
|
99
|
+
)
|
100
|
+
|
101
|
+
tw_cell = cell.twiss4d(strengths=True)
|
102
|
+
tw_half_cell = half_cell.twiss4d(init='periodic_symmetric', strengths=True)
|
103
|
+
|
104
|
+
xo.assert_allclose(tw_half_cell.mux[-1], 0.2501 / 2, atol=1e-3, rtol=0)
|
105
|
+
xo.assert_allclose(tw_half_cell.muy[-1], 0.2502 / 2, atol=1e-3, rtol=0)
|
106
|
+
xo.assert_allclose(tw_cell.mux[-1], 0.231, atol=1e-3, rtol=0) # unaffected
|
107
|
+
xo.assert_allclose(tw_cell.muy[-1], 0.233, atol=1e-3, rtol=0) # unaffected
|
108
|
+
|
109
|
+
opt_cell = cell.match(
|
110
|
+
method='4d',
|
111
|
+
start='start_cell', end='end_cell',
|
112
|
+
init='periodic',
|
113
|
+
targets=xt.TargetSet(mux=0.2501, muy=0.2502, at='end_cell'),
|
114
|
+
vary=xt.VaryList(['kqf', 'kqd'], step=1e-5),
|
115
|
+
)
|
116
|
+
|
117
|
+
xo.assert_allclose(half_cell.vv['kqf'], cell.vv['kqf'], rtol=1e-9, atol=0)
|
118
|
+
xo.assert_allclose(half_cell.vv['kqd'], cell.vv['kqd'], rtol=1e-9, atol=0)
|
119
|
+
|
120
|
+
tw_cell = cell.twiss4d(strengths=True)
|
121
|
+
tw_half_cell = half_cell.twiss4d(init='periodic_symmetric', strengths=True)
|
122
|
+
|
123
|
+
xo.assert_allclose(tw_half_cell.mux[-1], 0.2501 / 2, atol=1e-3, rtol=0)
|
124
|
+
xo.assert_allclose(tw_half_cell.muy[-1], 0.2502 / 2, atol=1e-3, rtol=0)
|
125
|
+
xo.assert_allclose(tw_cell.mux[-1], 0.2501, atol=1e-3, rtol=0)
|
126
|
+
xo.assert_allclose(tw_cell.muy[-1], 0.2502, atol=1e-3, rtol=0)
|
127
|
+
|
128
|
+
xo.assert_allclose(tw_half_cell.betx[:-1], # remove '_end_point'
|
129
|
+
tw_cell.rows[:'mid_cell'].betx, atol=0, rtol=1e-8)
|
130
|
+
xo.assert_allclose(tw_half_cell.bety[:-1], # remove '_end_point'
|
131
|
+
tw_cell.rows[:'mid_cell'].bety, atol=0, rtol=1e-8)
|
132
|
+
xo.assert_allclose(tw_half_cell.alfx[:-1], # remove '_end_point'
|
133
|
+
tw_cell.rows[:'mid_cell'].alfx, atol=1e-8, rtol=0)
|
134
|
+
xo.assert_allclose(tw_half_cell.alfy[:-1], # remove '_end_point'
|
135
|
+
tw_cell.rows[:'mid_cell'].alfy, atol=1e-8, rtol=0)
|
136
|
+
xo.assert_allclose(tw_half_cell.dx[:-1], # remove '_end_point'
|
137
|
+
tw_cell.rows[:'mid_cell'].dx, atol=1e-8, rtol=0)
|
138
|
+
xo.assert_allclose(tw_half_cell.dpx[:-1], # remove '_end_point'
|
139
|
+
tw_cell.rows[:'mid_cell'].dpx, atol=1e-8, rtol=0)
|
140
|
+
|
141
|
+
xo.assert_allclose(tw_half_cell.ax_chrom[:-1], # remove '_end_point'
|
142
|
+
tw_cell.rows[:'mid_cell'].ax_chrom, atol=1e-5, rtol=0)
|
143
|
+
xo.assert_allclose(tw_half_cell.ay_chrom[:-1], # remove '_end_point'
|
144
|
+
tw_cell.rows[:'mid_cell'].ay_chrom, atol=1e-5, rtol=0)
|
145
|
+
xo.assert_allclose(tw_half_cell.bx_chrom[:-1], # remove '_end_point'
|
146
|
+
tw_cell.rows[:'mid_cell'].bx_chrom, atol=1e-5, rtol=0)
|
147
|
+
xo.assert_allclose(tw_half_cell.by_chrom[:-1], # remove '_end_point'
|
148
|
+
tw_cell.rows[:'mid_cell'].by_chrom, atol=1e-5, rtol=0)
|
149
|
+
|
150
|
+
xo.assert_allclose(tw_half_cell.qx, tw_cell.qx / 2, atol=1e-9, rtol=0)
|
151
|
+
xo.assert_allclose(tw_half_cell.qy, tw_cell.qy / 2, atol=1e-9, rtol=0)
|
152
|
+
xo.assert_allclose(tw_half_cell.dqx, tw_cell.dqx / 2, atol=1e-6, rtol=0)
|
153
|
+
xo.assert_allclose(tw_half_cell.dqy, tw_cell.dqy / 2, atol=1e-6, rtol=0)
|
154
|
+
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# ######################################### #
|
5
5
|
|
6
6
|
import copy
|
7
|
+
import pytest
|
7
8
|
|
8
9
|
import numpy as np
|
9
10
|
|
@@ -14,7 +15,8 @@ from xobjects.test_helpers import for_all_test_contexts
|
|
14
15
|
|
15
16
|
|
16
17
|
@for_all_test_contexts
|
17
|
-
|
18
|
+
@pytest.mark.parametrize('generator', ['RandomUniform', 'RandomUniformAccurate'])
|
19
|
+
def test_random_generation(test_context, generator):
|
18
20
|
|
19
21
|
part = xp.Particles(_context=test_context, p0c=6.5e12, x=[1,2,3])
|
20
22
|
part._init_random_number_generator()
|
@@ -24,7 +26,7 @@ def test_random_generation(test_context):
|
|
24
26
|
'dummy': xo.Float64,
|
25
27
|
}
|
26
28
|
|
27
|
-
_depends_on = [xt
|
29
|
+
_depends_on = [getattr(xt, generator)]
|
28
30
|
|
29
31
|
_extra_c_sources = [
|
30
32
|
'''
|
@@ -32,11 +34,11 @@ def test_random_generation(test_context):
|
|
32
34
|
void TestElement_track_local_particle(
|
33
35
|
TestElementData el, LocalParticle* part0){
|
34
36
|
//start_per_particle_block (part0->part)
|
35
|
-
double rr =
|
37
|
+
double rr = !!GENERATOR!!_generate(part);
|
36
38
|
LocalParticle_set_x(part, rr);
|
37
39
|
//end_per_particle_block
|
38
40
|
}
|
39
|
-
'''
|
41
|
+
'''.replace('!!GENERATOR!!', generator)
|
40
42
|
]
|
41
43
|
|
42
44
|
telem = TestElement(_context=test_context)
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import numpy as np
|
2
|
+
import pytest
|
3
|
+
|
4
|
+
import xtrack as xt
|
5
|
+
import xpart as xp
|
6
|
+
|
7
|
+
|
8
|
+
def test_seeds():
|
9
|
+
# Define a reference particle
|
10
|
+
particle_ref = xt.Particles(mass0=xt.ELECTRON_MASS_EV, q0=1, p0c=4e9)
|
11
|
+
|
12
|
+
# Create a particle object containing some particles with capacity twice the number of particles
|
13
|
+
n_part = 10
|
14
|
+
particles = xp.build_particles(particle_ref=particle_ref, num_particles=n_part, _capacity=2*n_part)
|
15
|
+
|
16
|
+
# Explicitly initialize the random number generator for the particle object
|
17
|
+
seeds = np.random.randint(0, np.iinfo(np.uint32).max, particles._capacity)
|
18
|
+
particles._init_random_number_generator(seeds=seeds)
|
19
|
+
|
20
|
+
# Save the seeds for the random number generator
|
21
|
+
rng_s1_before = particles._rng_s1.copy()
|
22
|
+
rng_s2_before = particles._rng_s2.copy()
|
23
|
+
rng_s3_before = particles._rng_s3.copy()
|
24
|
+
rng_s4_before = particles._rng_s4.copy()
|
25
|
+
|
26
|
+
# Manually kill some particles
|
27
|
+
n_part_to_kill = np.random.randint(1, n_part+1)
|
28
|
+
idx_part_to_kill = np.random.choice(n_part, n_part_to_kill, replace=False)
|
29
|
+
|
30
|
+
particles.state[idx_part_to_kill] = -1
|
31
|
+
particles._num_active_particles = sum(particles.state == 1)
|
32
|
+
particles._num_lost_particles = n_part - particles._num_lost_particles
|
33
|
+
|
34
|
+
# Create some new particles
|
35
|
+
n_part_new = np.random.randint(1, particles._capacity - n_part)
|
36
|
+
new_particles = xp.build_particles(particle_ref=particle_ref, num_particles=n_part_new)
|
37
|
+
|
38
|
+
# Add the new particles to the main particle object
|
39
|
+
particles.add_particles(new_particles)
|
40
|
+
|
41
|
+
# Save the seeds for the random number generator after the new particles addition
|
42
|
+
rng_s1_after = particles._rng_s1
|
43
|
+
rng_s2_after = particles._rng_s2
|
44
|
+
rng_s3_after = particles._rng_s3
|
45
|
+
rng_s4_after = particles._rng_s4
|
46
|
+
|
47
|
+
# Verify that the seeds for the random number generator stay the same
|
48
|
+
assert np.array_equal(rng_s1_after, rng_s1_before)
|
49
|
+
assert np.array_equal(rng_s2_after, rng_s2_before)
|
50
|
+
assert np.array_equal(rng_s3_after, rng_s3_before)
|
51
|
+
assert np.array_equal(rng_s4_after, rng_s4_before)
|
@@ -51,7 +51,6 @@ def test_twiss_4d_fodo_vs_beta_rel(test_context):
|
|
51
51
|
xo.assert_allclose(tw.dqx, tw_4d_list[0].dqx, atol=1e-4, rtol=0)
|
52
52
|
xo.assert_allclose(tw.dqy, tw_4d_list[0].dqy, atol=1e-4, rtol=0)
|
53
53
|
|
54
|
-
|
55
54
|
@for_all_test_contexts
|
56
55
|
def test_coupled_beta(test_context):
|
57
56
|
mad = Madx(stdout=False)
|
@@ -1905,3 +1904,29 @@ def test_part_from_full_periodic(test_context, collider_for_test_twiss_range):
|
|
1905
1904
|
tw_part2[kk, 'ip2'],
|
1906
1905
|
tw[kk, 'ip2'] - tw[kk, 0] +(tw[kk, '_end_point'] - tw[kk, 'ip8']),
|
1907
1906
|
rtol=1e-12, atol=5e-7)
|
1907
|
+
|
1908
|
+
|
1909
|
+
|
1910
|
+
|
1911
|
+
@for_all_test_contexts
|
1912
|
+
def test_twiss_add_strengths(test_context):
|
1913
|
+
## Generate a simple line
|
1914
|
+
n = 6
|
1915
|
+
fodo = [
|
1916
|
+
xt.Multipole(length=0.2, knl=[0, +0.2], ksl=[0, 0]),
|
1917
|
+
xt.Drift(length=1.0),
|
1918
|
+
xt.Multipole(length=0.2, knl=[0, -0.2], ksl=[0, 0]),
|
1919
|
+
xt.Drift(length=1.0),
|
1920
|
+
xt.Multipole(length=1.0, knl=[2 * np.pi / n], hxl=[2 * np.pi / n]),
|
1921
|
+
xt.Drift(length=1.0),
|
1922
|
+
]
|
1923
|
+
line = xt.Line(elements=n * fodo + [xt.Cavity(frequency=1e9, voltage=0, lag=180)])
|
1924
|
+
line.build_tracker(_context=test_context)
|
1925
|
+
|
1926
|
+
## Twiss
|
1927
|
+
line.particle_ref = xp.Particles(mass0=xp.PROTON_MASS_EV, q0=1, p0c=1e8)
|
1928
|
+
tw = line.twiss(method="4d")
|
1929
|
+
|
1930
|
+
assert "length" not in tw.keys()
|
1931
|
+
tw.add_strengths()
|
1932
|
+
assert "length" in tw.keys()
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.66.0'
|
@@ -12,7 +12,7 @@ import xobjects as xo
|
|
12
12
|
import xtrack as xt
|
13
13
|
|
14
14
|
from ..base_element import BeamElement
|
15
|
-
from ..random import
|
15
|
+
from ..random import RandomUniformAccurate, RandomExponential, RandomNormal
|
16
16
|
from ..general import _pkg_root, _print
|
17
17
|
from ..internal_record import RecordIndex, RecordIdentifier
|
18
18
|
|
@@ -588,7 +588,7 @@ class Multipole(BeamElement):
|
|
588
588
|
|
589
589
|
_skip_in_to_dict = ['_order', 'inv_factorial_order'] # defined by knl, etc.
|
590
590
|
|
591
|
-
_depends_on = [
|
591
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
592
592
|
|
593
593
|
_extra_c_sources = [
|
594
594
|
_pkg_root.joinpath('headers/constants.h'),
|
@@ -1000,7 +1000,7 @@ class Sextupole(BeamElement):
|
|
1000
1000
|
'order': '_order',
|
1001
1001
|
}
|
1002
1002
|
|
1003
|
-
_depends_on = [
|
1003
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
1004
1004
|
_internal_record_class = SynchrotronRadiationRecord
|
1005
1005
|
|
1006
1006
|
_extra_c_sources = [
|
@@ -1101,7 +1101,7 @@ class Octupole(BeamElement):
|
|
1101
1101
|
'order': '_order',
|
1102
1102
|
}
|
1103
1103
|
|
1104
|
-
_depends_on = [
|
1104
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
1105
1105
|
_internal_record_class = SynchrotronRadiationRecord
|
1106
1106
|
|
1107
1107
|
_extra_c_sources = [
|
@@ -1312,7 +1312,7 @@ class Solenoid(BeamElement):
|
|
1312
1312
|
_pkg_root.joinpath('beam_elements/elements_src/solenoid.h'),
|
1313
1313
|
]
|
1314
1314
|
|
1315
|
-
_depends_on = [
|
1315
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
1316
1316
|
|
1317
1317
|
_internal_record_class = SynchrotronRadiationRecord
|
1318
1318
|
|
@@ -2289,7 +2289,7 @@ class FirstOrderTaylorMap(BeamElement):
|
|
2289
2289
|
'm1': xo.Field(xo.Float64[6, 6], default=np.eye(6, dtype=np.float64)),
|
2290
2290
|
}
|
2291
2291
|
|
2292
|
-
_depends_on = [
|
2292
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
2293
2293
|
|
2294
2294
|
_extra_c_sources = [
|
2295
2295
|
_pkg_root.joinpath('headers/constants.h'),
|
@@ -6,9 +6,15 @@
|
|
6
6
|
#ifndef XTRACK_FRINGE_H
|
7
7
|
#define XTRACK_FRINGE_H
|
8
8
|
|
9
|
+
#ifndef POW2
|
9
10
|
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
#ifndef POW3
|
10
13
|
#define POW3(X) ((X)*(X)*(X))
|
14
|
+
#endif
|
15
|
+
#ifndef POW4
|
11
16
|
#define POW4(X) ((X)*(X)*(X)*(X))
|
17
|
+
#endif
|
12
18
|
|
13
19
|
/*gpufun*/
|
14
20
|
void Fringe_track_local_particle(
|
@@ -6,9 +6,15 @@
|
|
6
6
|
#ifndef XTRACK_TRACK_DIPOLE_FRINGE_H
|
7
7
|
#define XTRACK_TRACK_DIPOLE_FRINGE_H
|
8
8
|
|
9
|
+
#ifndef POW2
|
9
10
|
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
#ifndef POW3
|
10
13
|
#define POW3(X) ((X)*(X)*(X))
|
14
|
+
#endif
|
15
|
+
#ifndef POW4
|
11
16
|
#define POW4(X) ((X)*(X)*(X)*(X))
|
17
|
+
#endif
|
12
18
|
|
13
19
|
|
14
20
|
#ifndef XTRACK_FRINGE_FROM_PTC
|
@@ -6,8 +6,12 @@
|
|
6
6
|
#ifndef XTRACK_TRACK_MULT_FRINGE_H
|
7
7
|
#define XTRACK_TRACK_MULT_FRINGE_H
|
8
8
|
|
9
|
-
#
|
10
|
-
#define
|
9
|
+
#ifndef POW2
|
10
|
+
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
#ifndef POW3
|
13
|
+
#define POW3(X) ((X)*(X)*(X))
|
14
|
+
#endif
|
11
15
|
|
12
16
|
/*gpufun*/
|
13
17
|
void MultFringe_track_single_particle(
|
@@ -6,7 +6,10 @@
|
|
6
6
|
#ifndef XTRACK_TRACK_THICK_CFD_H
|
7
7
|
#define XTRACK_TRACK_THICK_CFD_H
|
8
8
|
|
9
|
+
#ifndef POW2
|
9
10
|
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
|
10
13
|
#define NONZERO(X) ((X) != 0.0)
|
11
14
|
|
12
15
|
// From madx: https://github.com/MethodicalAcceleratorDesign/MAD-X/blob/8695bd422dc403a01aa185e9fea16603bbd5b3e1/src/trrun.f90#L4320
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import xobjects as xo
|
2
2
|
|
3
3
|
from ..general import _pkg_root
|
4
|
-
from ..random import
|
4
|
+
from ..random import RandomUniformAccurate, RandomExponential
|
5
5
|
from .elements import (SynchrotronRadiationRecord, Quadrupole, Sextupole,
|
6
6
|
Octupole, Bend, Multipole, DipoleEdge)
|
7
7
|
from ..base_element import BeamElement
|
@@ -30,7 +30,7 @@ class ThinSliceQuadrupole(BeamElement):
|
|
30
30
|
allow_rot_and_shift = False
|
31
31
|
rot_and_shift_from_parent = True
|
32
32
|
_skip_in_to_dict = ['_parent']
|
33
|
-
_depends_on = [
|
33
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
34
34
|
_internal_record_class = SynchrotronRadiationRecord
|
35
35
|
has_backtrack = True
|
36
36
|
_force_moveable = True
|
@@ -78,7 +78,7 @@ class ThinSliceSextupole(BeamElement):
|
|
78
78
|
allow_rot_and_shift = False
|
79
79
|
rot_and_shift_from_parent = True
|
80
80
|
_skip_in_to_dict = ['_parent']
|
81
|
-
_depends_on = [
|
81
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
82
82
|
_internal_record_class = SynchrotronRadiationRecord
|
83
83
|
has_backtrack = True
|
84
84
|
_force_moveable = True
|
@@ -126,7 +126,7 @@ class ThinSliceOctupole(BeamElement):
|
|
126
126
|
allow_rot_and_shift = False
|
127
127
|
rot_and_shift_from_parent = True
|
128
128
|
_skip_in_to_dict = ['_parent']
|
129
|
-
_depends_on = [
|
129
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
130
130
|
_internal_record_class = SynchrotronRadiationRecord
|
131
131
|
has_backtrack = True
|
132
132
|
_force_moveable = True
|
@@ -174,7 +174,7 @@ class ThinSliceBend(BeamElement):
|
|
174
174
|
allow_rot_and_shift = False
|
175
175
|
rot_and_shift_from_parent = True
|
176
176
|
_skip_in_to_dict = ['_parent']
|
177
|
-
_depends_on = [
|
177
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
178
178
|
_internal_record_class = SynchrotronRadiationRecord
|
179
179
|
has_backtrack = True
|
180
180
|
_force_moveable = True
|
@@ -4,7 +4,7 @@ from ..general import _pkg_root
|
|
4
4
|
from ..base_element import BeamElement
|
5
5
|
from .elements import (SynchrotronRadiationRecord, Bend, Quadrupole, Sextupole,
|
6
6
|
Octupole, Solenoid, Drift)
|
7
|
-
from ..random import
|
7
|
+
from ..random import RandomUniformAccurate, RandomExponential
|
8
8
|
|
9
9
|
from .slice_elements import _slice_copy
|
10
10
|
|
@@ -89,7 +89,7 @@ class ThickSliceSextupole(BeamElement):
|
|
89
89
|
|
90
90
|
_xofields = {'_parent': xo.Ref(Sextupole), **_common_xofields}
|
91
91
|
|
92
|
-
_depends_on = [
|
92
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
93
93
|
_internal_record_class = SynchrotronRadiationRecord
|
94
94
|
|
95
95
|
_extra_c_sources = [
|
@@ -124,7 +124,7 @@ class ThickSliceOctupole(BeamElement):
|
|
124
124
|
|
125
125
|
_xofields = {'_parent': xo.Ref(Octupole), **_common_xofields}
|
126
126
|
|
127
|
-
_depends_on = [
|
127
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
128
128
|
_internal_record_class = SynchrotronRadiationRecord
|
129
129
|
|
130
130
|
_extra_c_sources = [
|
@@ -159,7 +159,7 @@ class ThickSliceSolenoid(BeamElement):
|
|
159
159
|
|
160
160
|
_xofields = {'_parent': xo.Ref(Solenoid), **_common_xofields}
|
161
161
|
|
162
|
-
_depends_on = [
|
162
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
163
163
|
_internal_record_class = SynchrotronRadiationRecord
|
164
164
|
|
165
165
|
_extra_c_sources = [
|
@@ -189,7 +189,7 @@ double synrad_gen_photon_energy_normalized(LocalParticle *part)
|
|
189
189
|
exact=SynRad(result);
|
190
190
|
appr=a1/tmp;
|
191
191
|
} else { // use high energy approximation
|
192
|
-
double const u =
|
192
|
+
double const u = RandomUniformAccurate_generate(part);
|
193
193
|
if (u < 1.e-50) continue; // avoid log(0), retrigger generation
|
194
194
|
result=xlow-log(u);
|
195
195
|
exact=SynRad(result);
|
@@ -115,8 +115,7 @@ class Line:
|
|
115
115
|
if isinstance(elements, dict):
|
116
116
|
element_dict = elements
|
117
117
|
if element_names is None:
|
118
|
-
|
119
|
-
' if `elements` is a dictionary.')
|
118
|
+
element_names = list(element_dict.keys())
|
120
119
|
else:
|
121
120
|
if element_names is None:
|
122
121
|
element_names = [f"e{ii}" for ii in range(len(elements))]
|
@@ -934,6 +933,20 @@ class Line:
|
|
934
933
|
equals to False and no progress bar is displayed.
|
935
934
|
"""
|
936
935
|
|
936
|
+
if hasattr(particles, '_needs_pipeline') and particles._needs_pipeline:
|
937
|
+
if '_called_by_pipeline' not in kwargs or not kwargs['_called_by_pipeline']:
|
938
|
+
all_kwargs = locals()
|
939
|
+
multitracker = xt.PipelineMultiTracker(
|
940
|
+
branches=[xt.PipelineBranch(line=self, particles=particles)])
|
941
|
+
all_kwargs.pop('self')
|
942
|
+
all_kwargs.pop('particles')
|
943
|
+
all_kwargs.pop('kwargs')
|
944
|
+
all_kwargs.pop('_called_by_pipeline', None)
|
945
|
+
return multitracker.track(**all_kwargs, **kwargs)
|
946
|
+
|
947
|
+
if '_called_by_pipeline' in kwargs: # Used only above
|
948
|
+
kwargs.pop('_called_by_pipeline')
|
949
|
+
|
937
950
|
self._check_valid_tracker()
|
938
951
|
return self.tracker._track(
|
939
952
|
particles,
|
@@ -28,6 +28,10 @@ XTRACK_DEFAULT_WEIGHTS = {
|
|
28
28
|
'muy': 10.,
|
29
29
|
'qx': 10.,
|
30
30
|
'qy': 10.,
|
31
|
+
'dx' : 10.,
|
32
|
+
'dpx': 100.,
|
33
|
+
'dy' : 10.,
|
34
|
+
'dpy': 100.,
|
31
35
|
}
|
32
36
|
|
33
37
|
ALLOWED_TARGET_KWARGS= ['x', 'px', 'y', 'py', 'zeta', 'delta', 'pzata', 'ptau',
|
@@ -100,7 +104,7 @@ class ActionTwiss(xd.Action):
|
|
100
104
|
if isinstance(twinit, xt.TwissInit):
|
101
105
|
twinit_list[ii] = twinit.copy()
|
102
106
|
elif isinstance(twinit, str):
|
103
|
-
assert twinit == 'periodic'
|
107
|
+
assert twinit == 'periodic' or twinit == 'periodic_symmetric'
|
104
108
|
|
105
109
|
# Handle init_at as xt.START or xt.END
|
106
110
|
for ii, init_at in enumerate(ele_init_list):
|
@@ -122,7 +126,7 @@ class ActionTwiss(xd.Action):
|
|
122
126
|
twinit_list[ii] = twinit.get_twiss_init(at_element=init_at)
|
123
127
|
ele_init_list[ii] = None
|
124
128
|
else:
|
125
|
-
assert twinit is None or twinit
|
129
|
+
assert twinit is None or twinit in ['periodic', 'periodic_symmetric']
|
126
130
|
|
127
131
|
if not ismultiline:
|
128
132
|
# Handle case in which twiss init is defined through kwargs
|
@@ -1069,4 +1073,4 @@ class ActionCall(Action):
|
|
1069
1073
|
for ii in range(len(ftar)):
|
1070
1074
|
tars.append(xt.Target(ii, ftar[ii], action=self))
|
1071
1075
|
|
1072
|
-
return tars
|
1076
|
+
return tars
|
@@ -876,16 +876,15 @@ class Particles(xo.HybridClass):
|
|
876
876
|
# Reorganize particles
|
877
877
|
with self._bypass_linked_vars():
|
878
878
|
for tt, nn in self.per_particle_vars:
|
879
|
+
if nn.startswith('_rng'):
|
880
|
+
continue
|
879
881
|
vv = getattr(self, nn)
|
880
882
|
vv_active = vv[mask_active]
|
881
883
|
vv_lost = vv[mask_lost]
|
882
884
|
|
883
885
|
vv[:n_active] = vv_active
|
884
886
|
vv[n_active:n_active + n_lost] = vv_lost
|
885
|
-
|
886
|
-
vv[n_active + n_lost:] = 0
|
887
|
-
else:
|
888
|
-
vv[n_active + n_lost:] = tt._dtype.type(LAST_INVALID_STATE)
|
887
|
+
vv[n_active + n_lost:] = tt._dtype.type(LAST_INVALID_STATE)
|
889
888
|
|
890
889
|
if isinstance(self._buffer.context, xo.ContextCpu):
|
891
890
|
self._num_active_particles = n_active
|
@@ -988,6 +987,7 @@ class Particles(xo.HybridClass):
|
|
988
987
|
def init_pipeline(self, name):
|
989
988
|
|
990
989
|
self.name = name
|
990
|
+
self._needs_pipeline = True
|
991
991
|
|
992
992
|
def show(self):
|
993
993
|
|