# 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
        self.I4 = self.ring.ring_circumference * self.ring.alpha_0[0, 0] / self.rho**2.0
        self.jz = 2.0 + self.I4 / self.I2

        # Calculate synchrotron radiation parameters
        self.calculate_SR_params()

        # Initialize the random number array if quantum excitation is included
        if quantum_excitation:
            self.random_array = np.zeros(self.beam.n_macroparticles)

        # Displace the beam in phase to account for the energy loss due to
        # synchrotron radiation (temporary until bunch generation is updated)
        if (shift_beam) and (self.rf_params.section_index == 0):
            self.beam_phase_to_compensate_SR = np.abs(np.arcsin(
                self.U0 / (self.ring.Particle.charge * self.rf_params.voltage[0][0]) ))
            self.beam_position_to_compensate_SR = self.beam_phase_to_compensate_SR \
                * self.rf_params.t_rf[0, 0] / (2.0*np.pi)

            self.beam.dt -= self.beam_position_to_compensate_SR

        # Select the right method for the tracker according to the selected
        # settings
        if python:
            if quantum_excitation:
                self.track = self.track_full_python
            else:
                self.track = self.track_SR_python
        else:
            if quantum_excitation:
                if seed is not None:

# 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

        self.I4 = self.ring.ring_circumference * self.ring.alpha_0[0, 0] / self.rho**2.0
        self.jz = 2.0 + self.I4 / self.I2

        # Calculate synchrotron radiation parameters
        self.calculate_SR_params()

        # Initialize the random number array if quantum excitation is included
        if quantum_excitation:
            self.random_array = np.zeros(self.beam.n_macroparticles)

        # Displace the beam in phase to account for the energy loss due to
        # synchrotron radiation (temporary until bunch generation is updated)
        if (shift_beam) and (self.rf_params.section_index == 0):
            self.beam_phase_to_compensate_SR = np.abs(np.arcsin(
                self.U0 / (self.ring.Particle.charge * self.rf_params.voltage[0][0]) ))
            self.beam_position_to_compensate_SR = self.beam_phase_to_compensate_SR \
                * self.rf_params.t_rf[0, 0] / (2.0*np.pi)

            self.beam.dt -= self.beam_position_to_compensate_SR

        # Select the right method for the tracker according to the selected
        # settings
        if python:
            if quantum_excitation:
                self.track = self.track_full_python
            else:
                self.track = self.track_SR_python
        else:
            if quantum_excitation:
                if seed is not None:

                    bm.set_random_seed(seed)