Skip to content
Snippets Groups Projects

Draft: Merge BLonD-Xsuite interface into develope

2 unresolved threads

The request will add a new file in blond/ called interfaces/xsuite.py which contains the interface between xsuite and BLonD that Thom worked on during his summer student project. Unittests for the interfaces, based on the simulation cases he ran, has also been added. Furthermore new examples have been added in the __EXAMPLES/ using the interface.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
9 import numpy as np
10 from scipy.constants import c as clight
11
12 from xtrack import ReferenceEnergyIncrease, ZetaShift
13 from blond.trackers.tracker import RingAndRFTracker
14 from blond.impedances.impedance import TotalInducedVoltage
15
16 if TYPE_CHECKING:
17 from xtrack import Particles
18 from xtrack import Line
19 from blond.beam.beam import Beam
20 from blond.beam.profile import Profile
21 from typing import Any, Union
22
23
24 def blond_to_xsuite_transform(dt: Union[float, np.ndarray], de: Union[float, np.ndarray], beta0: float,
  • 36 Synchronous energy.
    37 :param omega_rf: float.
    38 The rf angular frequency.
    39 :param phi_s: float.
    40 Synchronous phase in radians equivalent to Xsuite's phi_rf (below transition energy input should be phi_s-phi_rf).
    41 The default value is 0.
    42
    43 :return zeta, ptau: as numpy-arrays (or single variable)
    44 '''
    45
    46 ptau = de / (beta0 * energy0)
    47 zeta = -(dt - phi_s / omega_rf) * beta0 * clight
    48 return zeta, ptau
    49
    50
    51 def xsuite_to_blond_transform(zeta: Union[float, np.ndarray], ptau: Union[float, np.ndarray],
  • Helga Timko approved this merge request

    approved this merge request

  • Simon Fabian Lauber enabled an automatic merge when all merge checks for 44d623b9 pass

    enabled an automatic merge when all merge checks for 44d623b9 pass

  • Please register or sign in to reply
    Loading