xtrack 0.98.11__tar.gz → 0.98.13__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.98.11/xtrack.egg-info → xtrack-0.98.13}/PKG-INFO +1 -1
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_bucket_with_ref_energy_change.py +31 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_coupling_edwards_teng.py +14 -15
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_quadrupole_fringe_ptc.py +7 -7
- xtrack-0.98.13/xtrack/_version.py +1 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/line.py +74 -8
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/twiss.py +193 -83
- {xtrack-0.98.11 → xtrack-0.98.13/xtrack.egg-info}/PKG-INFO +1 -1
- xtrack-0.98.11/xtrack/_version.py +0 -1
- {xtrack-0.98.11 → xtrack-0.98.13}/LICENSE +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/MANIFEST.in +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/README.md +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/base_classes.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/BB6D.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/beambeam.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/boost.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/qgauss.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/slicing.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/be_beamfields/spacecharge.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/elements.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/line.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/mathlibs.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/particles.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/ducktrack/temp_pyparticles.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/pyproject.toml +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/setup.cfg +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/setup.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_acceleration.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_acdipole.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_acdipole_twiss.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_amplitude_detuning.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_aperture_polygon.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_aperture_table.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_apertures.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_attr_replicas_and_slices.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_boris_spatial.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_cavity_absolute_time.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_cavity_harmonic.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_chromatic_functions_vs_madx.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_coasting.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_collective_tracker.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_collimation.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_electron_cooler.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_element_characterization_functions.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_element_internal_record.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_elements.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_elements_classflags.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_elements_thick.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_environment.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_fcc_ee_solenoid_correction.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_footprint.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_freeze_longitudinal.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_full_rings.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_h6_sps_beamline.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_hvkick.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_ions.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_json.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_lhc_env.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_lhc_match_phase_15.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_line.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_load.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_load_vars.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_lumi.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_mad_writer.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_madloader.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_madnginterface.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_magnet.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_and_track_from_element.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_coupling_knob.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_nested.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_optics_and_ip_knob.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_orbit_bump.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_match_tune_chroma_cminus.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_misalign.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_multi_bunch_gauss.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_multiline.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_multisetter.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_multispecies.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_native_madloader.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_native_madloader_lhc.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_native_madloader_lhc_thin.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_native_madloader_ps.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_native_madloader_sps.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_native_madloader_ti2.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_optimize_for_tracking.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_particles.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_particles_basics.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_particles_pdg.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_pipeline.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_prebuild_kernels.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_ps_against_ptc.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_ps_multiturn_twiss.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_psb_chicane.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_pyht_interface.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_quadrupole_wedge.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_radial_steering.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_radiation.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_radiation_equilibrium_emittances.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_radiation_equilibrium_emittances_thick.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_radiation_integrals.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_random_gen.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_random_gen_exp.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_random_gen_gauss.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_random_gen_ruth.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_rbend_straight_body.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_rf_track.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_rotation_signs.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_second_order_taylor_map.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_seeds.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_slice_and_insert_with_replicas.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_slice_elements.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_slicing.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_solenoid_bz_map_vs_boris_legacy.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_spacecharge_in_ring.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_spin.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_sps_thick_cpymad_loader.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_sps_thick_native_loader.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_survey.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_tapering.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_thick_kickers_rf_crab.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_thick_lhc.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_tilt_shifts.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_tracker.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_trajectory_correcton.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_twiss.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_twiss_to_file.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_twiss_vs_madx_psb.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_vs_madx.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/tests/test_xmask_orbit_correction.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/lhc_match/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/lhc_match/var_limits.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/python_lattice_writer/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/_temp/python_lattice_writer/lattice_py_generation.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/aperture_meas.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/base_element.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/acdipole.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/beam_interaction.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/_generate_slice_elements_c_code.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/_include_integrator.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/acdipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/bend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/crab_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/default_magnet_config.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/dipole_fringe.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_exact.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_exact_slice.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_crab_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_multipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_rbend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/drift_slice_uniform_solenoid.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/electroncooler.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/elens.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/exciter.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/legacy_solenoid.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/magnet.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/magnet_drift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/magnet_edge.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/magnet_kick.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/marker.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/misalignment.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/multipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/multipoleedge.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/octupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/rbend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/slnd.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/srotation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_crab_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_multipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_rbend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thick_slice_uniform_solenoid.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_crab_cavity.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_multipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_octupole_entry.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_octupole_exit.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_entry.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_exit.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_rbend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_rbend_entry.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_rbend_exit.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_sextupole_entry.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_sextupole_exit.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_entry.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_exit.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_acdipole.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_drift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_legacy_solenoid.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_legacy_solenoid_multipolar_components.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_legacy_solenoid_radiation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet.template.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet_configure.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet_drift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet_edge.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet_kick.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_magnet_radiation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_misalignments.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_mult_fringe.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_rf.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_rf.template.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_thick_bend.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_thick_cfd.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_wedge.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_xyshift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/variable_solenoid.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/wedge.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/wire.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/exciter.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/rft_element.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/slice_base.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/slice_elements_drift.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/slice_elements_edge.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/slice_elements_thick.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/beam_elements/slice_elements_thin.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/boris.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/builder.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/environment.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/footprint.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/functions.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/general.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/atomicadd.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/checks.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/constants.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/particle_states.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/synrad_spectrum.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/track.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/headers/track_local_particle_with_transformations.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/internal_record.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/json.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/linear_normal_form.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/load.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/loss_location_refinement/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/lumi.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/mad_loader.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/mad_parser/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/mad_parser/loader.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/mad_parser/madx.lark +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/mad_parser/parse.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/mad_writer.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/madng_interface.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/match.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/beam_position_monitor.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/beam_position_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/beam_profile_monitor.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/beam_profile_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/beam_size_monitor.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/beam_size_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/last_turns_monitor.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/last_turns_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/particles_monitor.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/monitors/particles_monitor.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multiline.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multiline_legacy/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multiline_legacy/multiline_legacy.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multiline_legacy/shared_knobs.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multisetter/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multisetter/multisetter.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/multisetter/multisetter.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/constants.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/local_particle_custom_api.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/masses.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/particles.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/pdg.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/rng_src/base_rng.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/particles/rng_src/particles_rng.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/pipeline/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/pipeline/core.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/pipeline/manager.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/pipeline/multitracker.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/prebuilt_kernel_definitions/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/prebuilt_kernel_definitions/element_inits.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/prebuilt_kernel_definitions/element_types.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/progress_indicator.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_generators.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_src/exponential.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_src/normal.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_src/rutherford.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_src/uniform.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/random/random_src/uniform_accurate.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/slicing.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/survey.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/svgutils/__init__.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/svgutils/parser.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/svgutils/path.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/svgutils/svgutils.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/synctime.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/table.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/tapering.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/targets.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/track_flags.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/tracker.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/tracker_data.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/tracker_src/tracker.h +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/trajectory_correction.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/twissplot.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack/view.py +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack.egg-info/SOURCES.txt +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack.egg-info/dependency_links.txt +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack.egg-info/entry_points.txt +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack.egg-info/requires.txt +0 -0
- {xtrack-0.98.11 → xtrack-0.98.13}/xtrack.egg-info/top_level.txt +0 -0
|
@@ -4,6 +4,10 @@ import xobjects as xo
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
from scipy.constants import c as clight
|
|
7
|
+
import pathlib
|
|
8
|
+
|
|
9
|
+
test_data_folder = pathlib.Path(
|
|
10
|
+
__file__).parent.joinpath('../test_data').absolute()
|
|
7
11
|
|
|
8
12
|
def test_bucket_below_transition():
|
|
9
13
|
|
|
@@ -1014,3 +1018,30 @@ def test_bucket_with_reference_ernergy_increase_elem():
|
|
|
1014
1018
|
xo.assert_allclose(z_std, np.mean(z_std), atol=0.025*sigma_z)
|
|
1015
1019
|
xo.assert_allclose(delta_mean, np.mean(delta_mean), atol=0.025*sigma_delta)
|
|
1016
1020
|
xo.assert_allclose(delta_std, np.mean(delta_std), atol=0.025*sigma_delta)
|
|
1021
|
+
|
|
1022
|
+
def test_bucket_with_radiation():
|
|
1023
|
+
|
|
1024
|
+
env = xt.load(test_data_folder / 'fcc_ee/fccee_h.seq')
|
|
1025
|
+
pc_gev = 120.
|
|
1026
|
+
|
|
1027
|
+
line = env.fccee_p_ring
|
|
1028
|
+
line.set_particle_ref('positron', p0c=pc_gev*1e9)
|
|
1029
|
+
|
|
1030
|
+
tw_no_rad = line.twiss6d()
|
|
1031
|
+
rfb_no_rad = line._get_bucket()
|
|
1032
|
+
|
|
1033
|
+
line.configure_radiation(model='mean')
|
|
1034
|
+
line.compensate_radiation_energy_loss()
|
|
1035
|
+
|
|
1036
|
+
tw_rad = line.twiss6d(eneloss_and_damping=True)
|
|
1037
|
+
rfb_rad = line._get_bucket()
|
|
1038
|
+
|
|
1039
|
+
# Check that the effect of the radiation is visible on qs
|
|
1040
|
+
assert tw_no_rad.qs > 0.045
|
|
1041
|
+
assert tw_rad.qs < 0.035
|
|
1042
|
+
|
|
1043
|
+
# Check consistency of qs and bets0 between twiss and rfb
|
|
1044
|
+
xo.assert_allclose(rfb_no_rad.Q_s, tw_no_rad.qs, rtol=0.01)
|
|
1045
|
+
xo.assert_allclose(rfb_rad.Q_s, tw_rad.qs, rtol=0.01)
|
|
1046
|
+
xo.assert_allclose(rfb_no_rad.beta_z, tw_no_rad.bets0, rtol=0.015)
|
|
1047
|
+
xo.assert_allclose(rfb_rad.beta_z, tw_rad.bets0, rtol=0.015)
|
|
@@ -69,24 +69,23 @@ def test_coupling_edwards_teng():
|
|
|
69
69
|
betx_mad_at_s, bety_mad_at_s, alfx_mad_at_s, alfy_mad_at_s)
|
|
70
70
|
|
|
71
71
|
xo.assert_allclose(tw.r11_edw_teng, r11_mad_at_s,
|
|
72
|
-
rtol=1e-5, atol=
|
|
72
|
+
rtol=1e-5, atol=5e-4*np.max(np.abs(r11_mad_at_s)))
|
|
73
73
|
xo.assert_allclose(tw.r12_edw_teng, r12_mad_at_s,
|
|
74
|
-
rtol=1e-5, atol=
|
|
74
|
+
rtol=1e-5, atol=5e-4*np.max(np.abs(r12_mad_at_s)))
|
|
75
75
|
xo.assert_allclose(tw.r21_edw_teng, r21_mad_at_s,
|
|
76
|
-
rtol=1e-5, atol=
|
|
76
|
+
rtol=1e-5, atol=6e-4*np.max(np.abs(r21_mad_at_s)))
|
|
77
77
|
xo.assert_allclose(tw.r22_edw_teng, r22_mad_at_s,
|
|
78
|
-
rtol=1e-5, atol=
|
|
79
|
-
xo.assert_allclose(tw.betx_edw_teng, betx_mad_at_s, atol=0, rtol=1e-
|
|
80
|
-
|
|
81
|
-
xo.assert_allclose(tw.
|
|
82
|
-
xo.assert_allclose(tw.
|
|
83
|
-
|
|
84
|
-
xo.assert_allclose(tw.
|
|
85
|
-
|
|
86
|
-
xo.assert_allclose(tw.
|
|
87
|
-
atol=
|
|
88
|
-
|
|
89
|
-
atol=1e-5 * np.max(np.abs(rdt_mad_at_s['f1010'])))
|
|
78
|
+
rtol=1e-5, atol=5e-4*np.max(np.abs(r22_mad_at_s)))
|
|
79
|
+
xo.assert_allclose(tw.betx_edw_teng, betx_mad_at_s, atol=0, rtol=1e-6)
|
|
80
|
+
xo.assert_allclose(tw.alfx_edw_teng, alfx_mad_at_s, atol=1e-4, rtol=1e-6)
|
|
81
|
+
xo.assert_allclose(tw.bety_edw_teng, bety_mad_at_s, atol=0, rtol=1e-6)
|
|
82
|
+
xo.assert_allclose(tw.alfy_edw_teng, alfy_mad_at_s, atol=1e-4, rtol=1e-6)
|
|
83
|
+
|
|
84
|
+
xo.assert_allclose(tw.f1001, rdt_mad_at_s['f1001'], rtol=1e-3,
|
|
85
|
+
atol=5e-4 * np.max(np.abs(rdt_mad_at_s['f1001'])))
|
|
86
|
+
xo.assert_allclose(tw.f1010, rdt_mad_at_s['f1010'], rtol=1e-3,
|
|
87
|
+
atol=5e-3 * np.max(np.abs(rdt_mad_at_s['f1010'])))
|
|
88
|
+
|
|
90
89
|
|
|
91
90
|
|
|
92
91
|
def compute_rdt(r11, r12, r21, r22, betx, bety, alfx, alfy):
|
|
@@ -20,7 +20,7 @@ def test_quadrupole_fringe_ptc():
|
|
|
20
20
|
|
|
21
21
|
p0 = xt.Particles(x=x0,px=px0,y=y0,py=py0,delta=delta0,zeta=zeta0,beta0=beta0)
|
|
22
22
|
|
|
23
|
-
ptau0 =
|
|
23
|
+
ptau0 = p0.ptau[0]
|
|
24
24
|
tau0 = zeta0/beta0
|
|
25
25
|
|
|
26
26
|
# XSuite
|
|
@@ -58,9 +58,9 @@ def test_quadrupole_fringe_ptc():
|
|
|
58
58
|
|
|
59
59
|
df = madx.table.tracksumm.dframe()
|
|
60
60
|
|
|
61
|
-
assert np.isclose(p0.x, df.x[-1])
|
|
62
|
-
assert np.isclose(p0.px, df.px[-1])
|
|
63
|
-
assert np.isclose(p0.y, df.y[-1])
|
|
64
|
-
assert np.isclose(p0.py, df.py[-1])
|
|
65
|
-
assert np.isclose(p0.ptau, df.pt[-1])
|
|
66
|
-
assert np.isclose(p0.zeta/p0.beta0, df.t[-1])
|
|
61
|
+
assert np.isclose(p0.x, df.x.values[-1])
|
|
62
|
+
assert np.isclose(p0.px, df.px.values[-1])
|
|
63
|
+
assert np.isclose(p0.y, df.y.values[-1])
|
|
64
|
+
assert np.isclose(p0.py, df.py.values[-1])
|
|
65
|
+
assert np.isclose(p0.ptau, df.pt.values[-1])
|
|
66
|
+
assert np.isclose(p0.zeta/p0.beta0, df.t.values[-1])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.98.13'
|
|
@@ -1748,29 +1748,95 @@ class Line:
|
|
|
1748
1748
|
element0=0, reverse=None):
|
|
1749
1749
|
|
|
1750
1750
|
"""
|
|
1751
|
-
|
|
1751
|
+
Compute the geometrical layout, i.e. the coordinates of all beam line
|
|
1752
|
+
elements in the global reference system. (for detailed definitions of
|
|
1753
|
+
the involved quantities please refer to the Xsuite Physics Guide
|
|
1754
|
+
(https://xsuite.readthedocs.io/en/latest/physicsguide.html)
|
|
1752
1755
|
|
|
1753
1756
|
Parameters
|
|
1754
1757
|
----------
|
|
1755
1758
|
X0 : float
|
|
1756
|
-
Initial X coordinate in meters.
|
|
1759
|
+
Initial X coordinate in meters. Default is 0.
|
|
1757
1760
|
Y0 : float
|
|
1758
|
-
Initial Y coordinate in meters.
|
|
1761
|
+
Initial Y coordinate in meters. Default is 0.
|
|
1759
1762
|
Z0 : float
|
|
1760
|
-
Initial Z coordinate in meters.
|
|
1763
|
+
Initial Z coordinate in meters. Default is 0.
|
|
1761
1764
|
theta0 : float
|
|
1762
|
-
Initial theta coordinate in radians.
|
|
1765
|
+
Initial theta coordinate in radians. Default is 0.
|
|
1763
1766
|
phi0 : float
|
|
1764
|
-
Initial phi coordinate in radians.
|
|
1767
|
+
Initial phi coordinate in radians. Default is 0.
|
|
1765
1768
|
psi0 : float
|
|
1766
|
-
Initial psi coordinate in radians.
|
|
1769
|
+
Initial psi coordinate in radians. Default is 0.
|
|
1767
1770
|
element0 : int or str
|
|
1768
|
-
Element at which the given coordinates are defined.
|
|
1771
|
+
Element at which the given coordinates are defined. Default is the
|
|
1772
|
+
first element in the beam line.
|
|
1773
|
+
reverse : bool
|
|
1774
|
+
If True, the survey is computed in the reversed reference frame.
|
|
1769
1775
|
|
|
1770
1776
|
Returns
|
|
1771
1777
|
-------
|
|
1772
1778
|
survey : SurveyTable
|
|
1773
1779
|
Survey table.
|
|
1780
|
+
|
|
1781
|
+
Notes
|
|
1782
|
+
-----
|
|
1783
|
+
|
|
1784
|
+
The output survey table contains the following columns:
|
|
1785
|
+
|
|
1786
|
+
- ``name``: element name (with occurrence counts for repeated names).
|
|
1787
|
+
- ``element_type``: type of the element (e.g. Drift, Marker, Bend).
|
|
1788
|
+
- ``s``: longitudinal coordinate at the element entrance [m].
|
|
1789
|
+
- ``X``, ``Y``, ``Z``: position of the element entrance in the global frame [m].
|
|
1790
|
+
- ``theta``, ``phi``, ``psi``: orientation angles of the local frame
|
|
1791
|
+
(azimuth, elevation, roll) unwrapped along the line [rad].
|
|
1792
|
+
- ``ex``, ``ey``, ``ez``: unit vectors of the local frame expressed in
|
|
1793
|
+
the global frame (they are the columns of ``W``).
|
|
1794
|
+
- ``W``: 3x3 rotation matrices describing the local frame at each
|
|
1795
|
+
element entrance.
|
|
1796
|
+
- ``p0``: position vectors stacked as ``[X, Y, Z]``.
|
|
1797
|
+
- ``isthick``: ``True`` for thick elements, ``False`` for markers.
|
|
1798
|
+
- ``drift_length``: length used while advancing the survey (zero for
|
|
1799
|
+
thin elements) [m].
|
|
1800
|
+
- ``length``: physical length of the element [m].
|
|
1801
|
+
- ``angle``: bending angle of the element [rad].
|
|
1802
|
+
- ``rot_s_rad``: rotation around the longitudinal axis applied before
|
|
1803
|
+
the element [rad].
|
|
1804
|
+
- ``ref_shift_x``, ``ref_shift_y``: alignment shifts applied before the
|
|
1805
|
+
element [m].
|
|
1806
|
+
- ``ref_rot_x_rad``, ``ref_rot_y_rad``, ``ref_rot_s_rad``: alignment
|
|
1807
|
+
rotations applied before the element [rad].
|
|
1808
|
+
|
|
1809
|
+
Examples
|
|
1810
|
+
--------
|
|
1811
|
+
.. code-block:: python
|
|
1812
|
+
|
|
1813
|
+
import xtrack as xt
|
|
1814
|
+
|
|
1815
|
+
# Create a simple line
|
|
1816
|
+
env = xt.Environment(particle_ref=xt.Particles(p0c=1e9))
|
|
1817
|
+
line = env.new_line(length=6, components=[
|
|
1818
|
+
env.new('b1', xt.Bend, length=0.2, angle=0.1, at=1),
|
|
1819
|
+
env.new('q1', xt.Quadrupole, length=0.1, k1=0.5, at=2),
|
|
1820
|
+
env.new('b2', xt.Bend, length=0.2, angle=-0.1, at=3),
|
|
1821
|
+
env.new('q2', xt.Quadrupole, length=0.1, k1=-0.5, at=4),
|
|
1822
|
+
])
|
|
1823
|
+
|
|
1824
|
+
# Compute the survey
|
|
1825
|
+
sv = line.survey()
|
|
1826
|
+
# sv.X, sv.Y, sv.Z contain the coordinates of the reference
|
|
1827
|
+
# trajectory in the global frame
|
|
1828
|
+
|
|
1829
|
+
# Compute the trajectory of a particle entering with x=1 mm and y=2 mm
|
|
1830
|
+
tw = line.twiss4d(betx=1, bety=1, x=1e-3, y=2e-3)
|
|
1831
|
+
# tw.x, tw.y contain the coordinates of the particle in the local frame
|
|
1832
|
+
|
|
1833
|
+
# Compute the trajectory of the particle in the global frame
|
|
1834
|
+
p_global = tw.x[:, None] * sv.ex + tw.y[:, None] * sv.ey + sv.p0
|
|
1835
|
+
|
|
1836
|
+
X_trajectory = p_global[:, 0]
|
|
1837
|
+
Y_trajectory = p_global[:, 1]
|
|
1838
|
+
Z_trajectory = p_global[:, 2]
|
|
1839
|
+
|
|
1774
1840
|
"""
|
|
1775
1841
|
|
|
1776
1842
|
if not self._has_valid_tracker():
|
|
@@ -944,6 +944,8 @@ def twiss_line(line, particle_ref=None, method=None,
|
|
|
944
944
|
alfy1, alfy2 = twiss_res['alfy1'], twiss_res['alfy2']
|
|
945
945
|
coupling_result = _compute_coupling_elements_edwards_teng(
|
|
946
946
|
W_matrix=twiss_res['W_matrix'],
|
|
947
|
+
mux=twiss_res['mux'],
|
|
948
|
+
muy=twiss_res['muy'],
|
|
947
949
|
qx=twiss_res['qx'],
|
|
948
950
|
qy=twiss_res['qy']
|
|
949
951
|
)
|
|
@@ -1409,100 +1411,51 @@ def _compute_lattice_functions(Ws, use_full_inverse, s_co):
|
|
|
1409
1411
|
|
|
1410
1412
|
def _compute_coupling_elements_edwards_teng(
|
|
1411
1413
|
W_matrix: np.ndarray,
|
|
1414
|
+
mux: np.ndarray,
|
|
1415
|
+
muy: np.ndarray,
|
|
1412
1416
|
qx: float = None,
|
|
1413
1417
|
qy: float = None,
|
|
1414
1418
|
):
|
|
1415
1419
|
"""Compute coupling matrix elements using the Edwards-Teng method.
|
|
1416
1420
|
|
|
1417
|
-
Using definition in chapter 7 of MAD8 guide
|
|
1418
|
-
|
|
1419
|
-
For the RDTs calculation, refer to R. Calaga and R. Tomás, "Betatron coupling:
|
|
1420
|
-
Merging Hamiltonian and matrix approaches", 10.1103/PhysRevSTAB.8.034001.
|
|
1421
|
-
|
|
1422
|
-
Returns
|
|
1423
|
-
-------
|
|
1424
|
-
r11, r12, r21, r22: complex
|
|
1425
|
-
Coupling matrix elements.
|
|
1426
|
-
f1010, f1001: complex
|
|
1427
|
-
Resonance driving terms f1010 and f1001.
|
|
1428
1421
|
"""
|
|
1429
1422
|
|
|
1423
|
+
# R matrix of the full ring (4D)
|
|
1430
1424
|
Rot = np.zeros(shape=(6, 6), dtype=np.float64)
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
WW_inv = lnf.S.T @ WW.T @ lnf.S
|
|
1450
|
-
|
|
1451
|
-
RR = WW @ Rot @ WW_inv
|
|
1425
|
+
Rot[0:2,0:2] = lnf.Rot2D(2 * np.pi * qx)
|
|
1426
|
+
Rot[2:4,2:4] = lnf.Rot2D(2 * np.pi * qy)
|
|
1427
|
+
WW0 = W_matrix[0, :, :]
|
|
1428
|
+
WW0_inv = lnf.S.T @ WW0.T @ lnf.S
|
|
1429
|
+
RR = WW0 @ Rot @ WW0_inv
|
|
1430
|
+
|
|
1431
|
+
# Edwards-Teng initial conditions
|
|
1432
|
+
edw_teng_init = _compute_edwards_teng_initial(RR)
|
|
1433
|
+
|
|
1434
|
+
# Edwards-Teng parameters along the ring
|
|
1435
|
+
edw_teng_cols = _propagate_edwards_teng(
|
|
1436
|
+
WW=W_matrix, mux=mux, muy=muy,
|
|
1437
|
+
RR_ET0=edw_teng_init['RR_ET0'],
|
|
1438
|
+
betx0=edw_teng_init['betx0'],
|
|
1439
|
+
alfx0=edw_teng_init['alfx0'],
|
|
1440
|
+
bety0=edw_teng_init['bety0'],
|
|
1441
|
+
alfy0=edw_teng_init['alfy0']
|
|
1442
|
+
)
|
|
1452
1443
|
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
if np.linalg.norm(BB) < 1e-10 and np.linalg.norm(CC) < 1e-10:
|
|
1459
|
-
R_edw_teng = np.zeros((2, 2))
|
|
1460
|
-
else:
|
|
1461
|
-
tr = np.linalg.trace
|
|
1462
|
-
b_pl_c = CC + _conj_mat(BB)
|
|
1463
|
-
det_bc = np.linalg.det(b_pl_c)
|
|
1464
|
-
tr_a_m_tr_d = tr(AA) - tr(DD)
|
|
1465
|
-
coeff = - (0.5 * tr_a_m_tr_d
|
|
1466
|
-
+ np.sign(det_bc) * np.sqrt(det_bc + 0.25 * tr_a_m_tr_d**2))
|
|
1467
|
-
R_edw_teng = 1/coeff * b_pl_c
|
|
1468
|
-
|
|
1469
|
-
EE = AA - BB@R_edw_teng
|
|
1470
|
-
FF = DD + R_edw_teng@BB
|
|
1471
|
-
|
|
1472
|
-
quarter = 0.25
|
|
1473
|
-
two = 2.0
|
|
1474
|
-
|
|
1475
|
-
sinmu2 = -EE[0,1]*EE[1,0] - quarter*(EE[0,0] - EE[1,1])**2
|
|
1476
|
-
sinmux = np.sign(EE[0,1]) * np.sqrt(abs(sinmu2))
|
|
1477
|
-
betx_et_this = EE[0,1] / sinmux
|
|
1478
|
-
alfx_et_this = (EE[0,0] - EE[1,1]) / (two * sinmux)
|
|
1479
|
-
|
|
1480
|
-
sinmu2 = -FF[0,1]*FF[1,0] - quarter*(FF[0,0] - FF[1,1])**2
|
|
1481
|
-
sinmuy = np.sign(FF[0,1]) * np.sqrt(abs(sinmu2))
|
|
1482
|
-
bety_et_this = FF[0,1] / sinmuy
|
|
1483
|
-
alfy_et_this = (FF[0,0] - FF[1,1]) / (two * sinmuy)
|
|
1484
|
-
|
|
1485
|
-
r11[idx] = R_edw_teng[0,0]
|
|
1486
|
-
r12[idx] = R_edw_teng[0,1]
|
|
1487
|
-
r21[idx] = R_edw_teng[1,0]
|
|
1488
|
-
r22[idx] = R_edw_teng[1,1]
|
|
1489
|
-
betx_et[idx] = betx_et_this
|
|
1490
|
-
alfx_et[idx] = alfx_et_this
|
|
1491
|
-
bety_et[idx] = bety_et_this
|
|
1492
|
-
alfy_et[idx] = alfy_et_this
|
|
1493
|
-
|
|
1494
|
-
rdts = _compute_coupling_rdts(r11, r12, r21, r22,
|
|
1495
|
-
betx_et, bety_et, alfx_et, alfy_et)
|
|
1444
|
+
# Coupling RDTs from Edwards-Teng parameters
|
|
1445
|
+
rdts = _compute_coupling_rdts(edw_teng_cols['r11'], edw_teng_cols['r12'],
|
|
1446
|
+
edw_teng_cols['r21'], edw_teng_cols['r22'],
|
|
1447
|
+
edw_teng_cols['betx'], edw_teng_cols['bety'],
|
|
1448
|
+
edw_teng_cols['alfx'], edw_teng_cols['alfy'])
|
|
1496
1449
|
|
|
1497
1450
|
out = {
|
|
1498
|
-
'r11_edw_teng': r11,
|
|
1499
|
-
'r12_edw_teng': r12,
|
|
1500
|
-
'r21_edw_teng': r21,
|
|
1501
|
-
'r22_edw_teng': r22,
|
|
1502
|
-
'betx_edw_teng':
|
|
1503
|
-
'alfx_edw_teng':
|
|
1504
|
-
'bety_edw_teng':
|
|
1505
|
-
'alfy_edw_teng':
|
|
1451
|
+
'r11_edw_teng': edw_teng_cols['r11'],
|
|
1452
|
+
'r12_edw_teng': edw_teng_cols['r12'],
|
|
1453
|
+
'r21_edw_teng': edw_teng_cols['r21'],
|
|
1454
|
+
'r22_edw_teng': edw_teng_cols['r22'],
|
|
1455
|
+
'betx_edw_teng': edw_teng_cols['betx'],
|
|
1456
|
+
'alfx_edw_teng': edw_teng_cols['alfx'],
|
|
1457
|
+
'bety_edw_teng': edw_teng_cols['bety'],
|
|
1458
|
+
'alfy_edw_teng': edw_teng_cols['alfy'],
|
|
1506
1459
|
}
|
|
1507
1460
|
out.update(rdts)
|
|
1508
1461
|
|
|
@@ -1556,6 +1509,50 @@ def _compute_coupling_rdts(r11, r12, r21, r22, betx, bety, alfx, alfy):
|
|
|
1556
1509
|
|
|
1557
1510
|
return {'f1001': f1001, 'f1010': f1010}
|
|
1558
1511
|
|
|
1512
|
+
def _compute_edwards_teng_initial(RR):
|
|
1513
|
+
|
|
1514
|
+
AA = RR[:2, :2]
|
|
1515
|
+
BB = RR[:2, 2:4]
|
|
1516
|
+
CC = RR[2:4, :2]
|
|
1517
|
+
DD = RR[2:4, 2:4]
|
|
1518
|
+
|
|
1519
|
+
if np.linalg.norm(BB) < 1e-10 and np.linalg.norm(CC) < 1e-10:
|
|
1520
|
+
RR_ET0 = np.zeros((2, 2))
|
|
1521
|
+
else:
|
|
1522
|
+
tr = np.linalg.trace
|
|
1523
|
+
b_pl_c = CC + _conj_mat(BB)
|
|
1524
|
+
det_bc = np.linalg.det(b_pl_c)
|
|
1525
|
+
tr_a_m_tr_d = tr(AA) - tr(DD)
|
|
1526
|
+
coeff = - (0.5 * tr_a_m_tr_d
|
|
1527
|
+
+ np.sign(det_bc) * np.sqrt(det_bc + 0.25 * tr_a_m_tr_d**2))
|
|
1528
|
+
RR_ET0 = 1/coeff * b_pl_c
|
|
1529
|
+
|
|
1530
|
+
EE = AA - BB@RR_ET0
|
|
1531
|
+
FF = DD + RR_ET0@BB
|
|
1532
|
+
|
|
1533
|
+
quarter = 0.25
|
|
1534
|
+
two = 2.0
|
|
1535
|
+
|
|
1536
|
+
sinmu2 = -EE[0,1]*EE[1,0] - quarter*(EE[0,0] - EE[1,1])**2
|
|
1537
|
+
sinmux = np.sign(EE[0,1]) * np.sqrt(abs(sinmu2))
|
|
1538
|
+
betx0 = EE[0,1] / sinmux
|
|
1539
|
+
alfx0 = (EE[0,0] - EE[1,1]) / (two * sinmux)
|
|
1540
|
+
|
|
1541
|
+
sinmu2 = -FF[0,1]*FF[1,0] - quarter*(FF[0,0] - FF[1,1])**2
|
|
1542
|
+
sinmuy = np.sign(FF[0,1]) * np.sqrt(abs(sinmu2))
|
|
1543
|
+
bety0 = FF[0,1] / sinmuy
|
|
1544
|
+
alfy0 = (FF[0,0] - FF[1,1]) / (two * sinmuy)
|
|
1545
|
+
|
|
1546
|
+
edw_teng_init = {
|
|
1547
|
+
'RR_ET0': RR_ET0,
|
|
1548
|
+
'betx0': betx0,
|
|
1549
|
+
'alfx0': alfx0,
|
|
1550
|
+
'bety0': bety0,
|
|
1551
|
+
'alfy0': alfy0
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
return edw_teng_init
|
|
1555
|
+
|
|
1559
1556
|
def _conj_mat(mm):
|
|
1560
1557
|
a = mm[0,0]
|
|
1561
1558
|
b = mm[0,1]
|
|
@@ -1563,6 +1560,119 @@ def _conj_mat(mm):
|
|
|
1563
1560
|
d = mm[1,1]
|
|
1564
1561
|
return np.array([[d, -b], [-c, a]])
|
|
1565
1562
|
|
|
1563
|
+
def _propagate_edwards_teng(WW, mux, muy, RR_ET0, betx0, alfx0, bety0, alfy0):
|
|
1564
|
+
|
|
1565
|
+
lnf = xt.linear_normal_form
|
|
1566
|
+
SS2D = lnf.S[:2, :2]
|
|
1567
|
+
|
|
1568
|
+
RR_ET = RR_ET0.copy()
|
|
1569
|
+
|
|
1570
|
+
n_elem = len(mux)
|
|
1571
|
+
betx = np.zeros(n_elem)
|
|
1572
|
+
alfx = np.zeros(n_elem)
|
|
1573
|
+
bety = np.zeros(n_elem)
|
|
1574
|
+
alfy = np.zeros(n_elem)
|
|
1575
|
+
r11 = np.zeros(n_elem)
|
|
1576
|
+
r12 = np.zeros(n_elem)
|
|
1577
|
+
r21 = np.zeros(n_elem)
|
|
1578
|
+
r22 = np.zeros(n_elem)
|
|
1579
|
+
|
|
1580
|
+
betx[0] = betx0
|
|
1581
|
+
alfx[0] = alfx0
|
|
1582
|
+
bety[0] = bety0
|
|
1583
|
+
alfy[0] = alfy0
|
|
1584
|
+
r11[0] = RR_ET[0, 0]
|
|
1585
|
+
r12[0] = RR_ET[0, 1]
|
|
1586
|
+
r21[0] = RR_ET[1, 0]
|
|
1587
|
+
r22[0] = RR_ET[1, 1]
|
|
1588
|
+
|
|
1589
|
+
for ii in range(n_elem - 1):
|
|
1590
|
+
|
|
1591
|
+
# Build 2D R matrix of the element
|
|
1592
|
+
WW1 = WW[ii, :, :]
|
|
1593
|
+
WW2 = WW[ii+1, :, :]
|
|
1594
|
+
WW1_inv = lnf.S.T @ WW1.T @ lnf.S
|
|
1595
|
+
Rot_e_ii = np.zeros((6,6), dtype=np.float64)
|
|
1596
|
+
Rot_e_ii[0:2,0:2] = lnf.Rot2D(2*np.pi*(mux[ii+1] - mux[ii]))
|
|
1597
|
+
Rot_e_ii[2:4,2:4] = lnf.Rot2D(2*np.pi*(muy[ii+1] - muy[ii]))
|
|
1598
|
+
RRe_ii = WW2 @ Rot_e_ii @ WW1_inv
|
|
1599
|
+
|
|
1600
|
+
# Blocks of the R matrix of the element
|
|
1601
|
+
AA = RRe_ii[:2, :2]
|
|
1602
|
+
BB = RRe_ii[:2, 2:4]
|
|
1603
|
+
CC = RRe_ii[2:4, :2]
|
|
1604
|
+
DD = RRe_ii[2:4, 2:4]
|
|
1605
|
+
|
|
1606
|
+
# Propagate EE, FF and RR_ET through the element
|
|
1607
|
+
# Bases on MAD-X implementation (see madx/src/twiss.f90, subroutine twcptk)
|
|
1608
|
+
|
|
1609
|
+
if np.allclose(BB, 0, atol=1e-12) and np.allclose(CC, 0, atol=1e-12):
|
|
1610
|
+
# Case in which the matrix is block diagonal (no coupling in the element)
|
|
1611
|
+
EE = AA
|
|
1612
|
+
FF = DD
|
|
1613
|
+
EEBAR = SS2D @ EE.T @ SS2D.T
|
|
1614
|
+
edet = EE[0,0]*EE[1,1] - EE[0,1]*EE[1,0]
|
|
1615
|
+
CCDD = -FF @ RR_ET
|
|
1616
|
+
RR_ET = -CCDD @ EEBAR / edet
|
|
1617
|
+
else:
|
|
1618
|
+
RR_ET_BAR = SS2D @ RR_ET.T @ SS2D.T
|
|
1619
|
+
EE = AA - BB @ RR_ET
|
|
1620
|
+
edet = EE[0,0]*EE[1,1] - EE[0,1]*EE[1,0]
|
|
1621
|
+
EEBAR = SS2D @ EE.T @ SS2D.T
|
|
1622
|
+
CCDD = CC - DD @ RR_ET
|
|
1623
|
+
FF = DD + CC @ RR_ET_BAR
|
|
1624
|
+
RR_ET = -CCDD @ EEBAR / edet
|
|
1625
|
+
|
|
1626
|
+
# Propagate Edwards-Teng Twiss parameters through the element
|
|
1627
|
+
# Based on MAD-X implementation (see madx/src/twiss.f90, subroutine twcptk_twiss)
|
|
1628
|
+
|
|
1629
|
+
betx1 = betx[ii]
|
|
1630
|
+
alfx1 = alfx[ii]
|
|
1631
|
+
bety1 = bety[ii]
|
|
1632
|
+
alfy1 = alfy[ii]
|
|
1633
|
+
|
|
1634
|
+
Rx11 = EE[0,0]
|
|
1635
|
+
Rx12 = EE[0,1]
|
|
1636
|
+
Rx21 = EE[1,0]
|
|
1637
|
+
Rx22 = EE[1,1]
|
|
1638
|
+
detx = Rx11 * Rx22 - Rx12 * Rx21
|
|
1639
|
+
tempb = Rx11 * betx1 - Rx12 * alfx1
|
|
1640
|
+
tempa = Rx21 * betx1 - Rx22 * alfx1
|
|
1641
|
+
alfx2 = - (tempa * tempb + Rx12 * Rx22) / (detx*betx1)
|
|
1642
|
+
betx2 = (tempb * tempb + Rx12 * Rx12) / (detx*betx1)
|
|
1643
|
+
|
|
1644
|
+
Ry11 = FF[0,0]
|
|
1645
|
+
Ry12 = FF[0,1]
|
|
1646
|
+
Ry21 = FF[1,0]
|
|
1647
|
+
Ry22 = FF[1,1]
|
|
1648
|
+
dety = Ry11 * Ry22 - Ry12 * Ry21
|
|
1649
|
+
tempb = Ry11 * bety1 - Ry12 * alfy1
|
|
1650
|
+
tempa = Ry21 * bety1 - Ry22 * alfy1
|
|
1651
|
+
alfy2 = - (tempa * tempb + Ry12 * Ry22) / (dety*bety1)
|
|
1652
|
+
bety2 = (tempb * tempb + Ry12 * Ry12) / (dety*bety1)
|
|
1653
|
+
|
|
1654
|
+
betx[ii+1] = betx2
|
|
1655
|
+
alfx[ii+1] = alfx2
|
|
1656
|
+
r11[ii+1] = RR_ET[0, 0]
|
|
1657
|
+
r12[ii+1] = RR_ET[0, 1]
|
|
1658
|
+
r21[ii+1] = RR_ET[1, 0]
|
|
1659
|
+
r22[ii+1] = RR_ET[1, 1]
|
|
1660
|
+
bety[ii+1] = bety2
|
|
1661
|
+
alfy[ii+1] = alfy2
|
|
1662
|
+
|
|
1663
|
+
out_dict = {
|
|
1664
|
+
'betx': betx,
|
|
1665
|
+
'alfx': alfx,
|
|
1666
|
+
'bety': bety,
|
|
1667
|
+
'alfy': alfy,
|
|
1668
|
+
'r11': r11,
|
|
1669
|
+
'r12': r12,
|
|
1670
|
+
'r21': r21,
|
|
1671
|
+
'r22': r22
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
return out_dict
|
|
1675
|
+
|
|
1566
1676
|
|
|
1567
1677
|
def _compute_global_quantities(line, twiss_res, method):
|
|
1568
1678
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.98.11'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|