# Development meeting 3 March

## General Discussion
- Random test ordering under development
    - Reveals unexpected side effects (e.g. with backend mutations)

## Feedback Alex & Leandro
### Leandro:
- Comparing two simple examples, same setup in both BLonD2 and BLonD3:
    1: SPS single bunch with full impedance
    2: 1 + phase shift at start tracking
- BLonD3 takes 3 objects to replace BLonD2 ring
- Necessary to have Single AND MultiRFStation?
- Difficult to handle particle distribution
- Tracking was slower in BLonD3 than BLonD2
    - BLonD3 defaults to the Python backend because it does not require any compilation and gives friendlier errors than numba
- Profiles and induced voltages roughly equivalent, statistical moments have differences, but they're not significant
- Big change required to rewrite existing simulations, very hard to motivate the change
- More things should be moved out of `experimental`

### Alex:
- FCC-ee and Triple splitting in the PS
- Some optional arguments (e.g. voltage etc in RF station objects) are not really optional
    - Error comes when starting simulation
    - A bit unexpected, mandatory values should be required at init
    - Implemented due to scheduling, but should be clearer
- Similar issue to Leandro regarding particle distribution
    - `read_particle_dt` etc are part of `BeamBaseClass` so don't show up in docs of derived classes
- Direct access needed for debugging
- Some overlap between parameters of `Drift` and `Ring`, expected to find `t_rev` in `Ring`
- Manually specifying number of turns is a problem, should be determined from momentum program
    - Interpolator doesn't allow more turns than program gives
- Should be possible to get something like a "Program overview" that gives the design values all through the simulation
    - Possible to run simulations with empty beam and record values for parameters of interest
- Suggest `RFClock` object
    - Causes issues for Muon collider
    - Expected to show up a lot with feedbacks
- Want status of all params before `Simulation` object
- Most of the problems are UI rather than computational, need to facilitate friendly UI without breaking MuCol
- Allow single-core cpp
- Took about 1 day of effort to make these examples, not difficult, more people should try
- Plan a training program for new users and identify missing features for existing users

### Discussion:
- How to handle default backend?
    - numba and python most reliable, python chosen because it's friendlier
    - Would be good to default to something faster
    - Try and find a way to start with C++ if possible
- Leandro's examples should be repeated with exact same distributions
- Accessing distribution should be "easy", `write_partial_dt()` is not friendly
    - Simon L: Two main reasons for indirect access:
        - MPI operation safer
        - Allows caching attributes like `mean(dt)`
    - BLonD2 forced you to handle MPI yourself and wasn't safe, which BLonD3 resolves
    - Could be done by a function that does it, but that makes it harder to find
    - Need to make life easy for new people
- Single vs Multi RF Station:
    - Partly for speed
    - Partly to allow explicit identification of features that are purely single harmonic
- Documentation:
    - Alex: Helpful, but not as much as would be expected, always start with source code
    - Difficult to convince people to write documentation
    - NumPy documentation is a good guide
- Make example files from both talks


## Low-Q Resonators
- Long standing issue with Low-Q resonators
- Profile a few buckets in length
- Resonator with Q=1 and resonace freq 20*f_rf
- Compare `InducedVoltageFreq` and `InducedVoltageTime`
- Matching wihtout intensity effects
- Compute profile and then both induced voltages
    - Significant difference between time and frequency domain
    - Frequency domain works correctly
- Alex:
    - May not be surprising, similar seen in paper of Mauro Migliorati
    - Comes from wake at t=0 being purely resistive, with poor time resolution t>0 is 0
- Time domain _should_ be faster, but for this special case, large numbers of bins are required, which reduces the benefit
- To be tested with Simon L's new pole based model

## Future topic
- More hands-on experience
