# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


from builtins import range, object
from ..utils import bmath as bm
import numpy as np
        if (i_turn != 0 and self.ring.energy[0, i_turn] !=
                self.ring.energy[0, i_turn-1]):
            self.calculate_SR_params()
        for i in range(self.n_kicks):
            self.beam.dE += -(2.0 / self.tau_z / self.n_kicks * self.beam.dE +
                              self.U0 / self.n_kicks - 2.0 * self.sigma_dE /
                              np.sqrt(self.tau_z * self.n_kicks) *
                              self.ring.energy[0, i_turn] *
                              np.random.randn(self.beam.n_macroparticles))

    # Track particles with SR only (without quantum excitation)
    # C implementation
    def track_SR_C(self):
        i_turn = self.rf_params.counter[0]
        # Recalculate SR parameters if energy changes
        if (i_turn != 0 and self.ring.energy[0, i_turn] !=
                self.ring.energy[0, i_turn-1]):
            self.calculate_SR_params()

        bm.synchrotron_radiation(self.beam.dE, self.U0,
                                 self.n_kicks, self.tau_z)

    # Track particles with SR and quantum excitation. C implementation
    def track_full_C(self):
        i_turn = self.rf_params.counter[0]
        # Recalculate SR parameters if energy changes
        if (i_turn != 0 and self.ring.energy[0, i_turn] !=
                self.ring.energy[0, i_turn-1]):
            self.calculate_SR_params()


# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


# Path: blond/synchrotron_radiation/synchrotron_radiation.py
from builtins import range, object
from ..utils import bmath as bm
import numpy as np

        if (i_turn != 0 and self.ring.energy[0, i_turn] !=
                self.ring.energy[0, i_turn-1]):
            self.calculate_SR_params()
        for i in range(self.n_kicks):
            self.beam.dE += -(2.0 / self.tau_z / self.n_kicks * self.beam.dE +
                              self.U0 / self.n_kicks - 2.0 * self.sigma_dE /
                              np.sqrt(self.tau_z * self.n_kicks) *
                              self.ring.energy[0, i_turn] *
                              np.random.randn(self.beam.n_macroparticles))

    # Track particles with SR only (without quantum excitation)
    # C implementation
    def track_SR_C(self):
        i_turn = self.rf_params.counter[0]
        # Recalculate SR parameters if energy changes
        if (i_turn != 0 and self.ring.energy[0, i_turn] !=
                self.ring.energy[0, i_turn-1]):
            self.calculate_SR_params()

        bm.synchrotron_radiation(self.beam.dE, self.U0,
                                 self.n_kicks, self.tau_z)

    # Track particles with SR and quantum excitation. C implementation
    def track_full_C(self):
        i_turn = self.rf_params.counter[0]
        # Recalculate SR parameters if energy changes
        if (i_turn != 0 and self.ring.energy[0, i_turn] !=
                self.ring.energy[0, i_turn-1]):
            self.calculate_SR_params()


        bm.synchrotron_radiation_full(self.beam.dE, self.U0, self.n_kicks,