**Changes:**
- Introduce computation of equilibrium emittances in the result of `twiss(..., ene_loss_and_damping=True)`.
- Introduce `Line.match(compensate_radiation_energy_loss=True)`.
- Introduce `Line.vv` as alias of `Line.varval`.
- Introduce `Line.attr` for quick extraction of commonly used element attributes (length, hxl, hyl, low order strengths).
- Introduce backtrack for `CombinedFunctionMagnet`.
- Introduce `Line.metadata` and `Multiline.metadata`.
- Introduce `Target(..., optimize_log=True)` flag to optimize the logarithm of a quantity.
- Introduce support for `Int64` attributes in `Multisetter`.
- Introduce `TwissInit.to_dict(...)`, `TwissInit.from_dict(...)`, `TwissInit.to_json(...)`, `TwissInit.from_json(...)`.
- Refactor prebuilt kernel management to control the order in which they are checked.
- Refactor `Line.compensate_radiation_energy_loss()` to preserve expressions. New implementation is also considerably faster.
- Switched to `radiation_method = "kick_as_co"` as default in the presence of radiation (significantly faster than `full`).
- Fix sign error on weak focusing from `hyl` in multipole.
- In mad_loader, add entry and exit markers also for thin elements that are not markers themselves.
- Use shorter suffix when splitting drifts to insert elements.
- Performance improvement in `line.__getitem__`.
- Improved speed in `LastTurnMonitor`.
**Full Changelog**: https://github.com/xsuite/xtrack/compare/v0.40.2...v0.41.0