levisim.multiphysics.utils.animations

Animations of the spectra of a MultiTrap as its parameters are varied (heatmaps and slices)

levisim.multiphysics.utils.animations.spectrum_type_to_latex(spectrum_type, **kwargs)[source]

Returns a latex symbol string given a choice of spectrum

levisim.multiphysics.utils.animations.spectrum_type_to_units(spectrum_type)[source]

Returns a units string given a choice of spectrum

levisim.multiphysics.utils.animations.calculate_area(mtrap, values)[source]

Take the area under the given spectral values

levisim.multiphysics.utils.animations.calculate_phonons_and_temperatures_from_PSD(mtrap, Sqq_values, label)[source]

Take the area under the given PSD to find the number of phonons and temperature

- area under zpf-normalised PSD = 2n + 1, where n = phonon occupation
    area = 2n + 1
    ∴
    n = ½(area - 1)
- area under (two-sided) PSD of variable = variance of variable
    〈q²〉= (1/2π) ∫ Sqq(Ω)dΩ
    ∴
    〈q²〉= ∫ Sxx(f)df
- equipartition theorem states: kinetic energy from oscillation = thermal energy
    ½mΩ²〈q²〉 = ½kB×T
    ∴
    T = (mΩ² / kB) × 〈q²〉
levisim.multiphysics.utils.animations.update_parameter_in_multitrap_kwargs(multitrap_kwargs, parameter, new_value)[source]

Updates the given parameter from Multitrap instance to the given value

levisim.multiphysics.utils.animations.calculate_spectra_across_y_range_for_one_frame(multitrap_kwargs, spectrum_type, y, frame, frame_value, method=Numerical H, **kwargs)[source]

Given a value of the frame variable, returns a spectrum calculated at each value in the y-variable’s range

levisim.multiphysics.utils.animations.title_string_for_one_frame(multitrap_kwargs, spectrum_type, y, frame, frame_value, all_parameters, **kwargs)[source]

Generate a title that updates each frame

levisim.multiphysics.utils.animations.calculate_spectra_for_all_frames(multitrap_kwargs, spectrum_type, y, frame, **kwargs)[source]

Calculates the spectra across the y range for every frame value

Returns (spectra per frame, their global (min, max), info per frame).

levisim.multiphysics.utils.animations.generate_heatmap_animation_frames(multitrap_kwargs, all_parameters, x, y, frame, spectrum_type, all_spectra_by_frame, limits, info_for_all_frames, **kwargs)[source]

Draws a heatmap of the spectra over frequency and the y parameter for each frame value

Returns (fig, animation frames).

levisim.multiphysics.utils.animations.generate_slices_animation_frames(multitrap_kwargs, all_parameters, x, y, frame, spectrum_type, all_spectra_by_frame, limits, info_for_all_frames, **kwargs)[source]

Draws the spectrum for each y value, with its area (optical spectra) or phonons and temperatures (position PSDs) below, for each frame value

Returns (fig, animation frames).

levisim.multiphysics.utils.animations.animate_spectra(animation_type, multitrap_kwargs, all_parameters, x, y, frame, spectrum_type, **kwargs)[source]

Animates the spectra as the frame parameter is varied, as a ‘heatmap’ or ‘slices’ animation

Saved as an .mp4 if save_mp4=True. Returns the matplotlib ArtistAnimation.