qom.systems.base module¶
Module to interface QOM systems.
References
- class qom.systems.base.BaseSystem(params: dict = {}, name: str = 'Sys_00', desc: str = 'Base System', num_modes: int = 2, cb_update=None)¶
Bases:
objectClass to interface QOM systems.
Requires
system_defaultsattribute before initializing parent.Initializes
name,desc,num_modes,dim_corrs,num_corrs,params,A,Dandupdater.- Parameters:
params (dict, optional) – Parameters for the system.
name (str, default='Sys_00') – Name of the interfaced system.
desc (str, default="Base System") – Description of the interfaced system.
num_modes (int, default=2) – Number of modes of the interfaced system.
cb_update (callable, optional) – Callback function to update status and progress, formatted as
cb_update(status, progress, reset), wherestatusis a string,progressis a float andresetis a boolean.
Notes
- The following system methods follow a strict formatting:
method
returns
func_ode_modes_corrs
the rates of change of the modes and correlations, formatted as
func_ode_modes_corrs(t, v, c), wheretis the time at which the integration is performed,vis an array of the modes and correlations andcis an array of the derived constants and controls of the system. The output should match the dimension ofv. This function is already defined inside this class. Iffunc_ode_corrsparameter is given, this function is treated as the function for the modes only.func_ode_modes_deviations
the rate equations of the modes and deviations. It follows the same formatting as
func_ode_modes_corrs. However, the parametervcontains only the deviations.func_ode_corrs
the rate equations of the correlations. It follows the same formatting as
func_ode_modes_corrs. However, the parametervcontains only the correlations.get_ivc
the initial values of the modes, correlations and derived constants and controls, formatted as
get_ivc().get_A
the drift matrix, formatted as
get_A(modes, c, t), wheremodesare the mode amplitudes at timetandcare the derived constants and controls of the system.get_mode_rates
the rate of change of the modes. It follows the same formatting as
get_A.get_coeffs_A
the coefficients of the characteristic equations of the drift matrix. It follows the same formatting as
get_A.get_coeffs_dispersion
the coefficients of \(( i \omega )^{j}\) in the dispersions. It follows the same formatting as
get_A.get_nonlinearities
the nonlinearities. It follows the same formatting as
get_A.get_beta_rates
the rates of change of the mechanical modes. It follows the same formatting as
get_A.get_betas
the mechanical modes. It follows the same formatting as
get_A.get_D
the noise matrix, formatted as
get_D(modes, corrs, c, t), wheremodesandcorrsare modes and correlations at timetandcare the derived constants and controls of the system.get_coeffs_N_o
the coefficients of the polynomial in mean optical occupancy, formatted as
get_coeffs_N_o(c), wherecare the derived constants and controls of the system.get_modes_steady_state
the steady state modes with shape
(dim, num_modes). It follows the same formatting asget_coeffs_N_o.
- func_ode_modes_corrs(t, v, c)¶
Wrapper function for the rates of change of the real-valued modes and correlations.
Requires system method
get_mode_rates. Additionally,get_Ashould be defined for the correlations. Optionally,get_Dmay be defined for correlations. Refer to Notes for their implementations.The variables are casted to real-valued.
- Parameters:
t (float) – Time at which the values are calculated.
v (numpy.ndarray) – Real-valued modes and flattened correlations. First
num_modeselements contain the real parts of the modes, the nextnum_modeselements contain the imaginary parts of the modes and optionally, the lastnum_corrselements contain the correlations.c (numpy.ndarray) – Defived constants and controls.
- Returns:
rates – Rates of change of the real-valued modes and flattened correlations.
- Return type:
numpy.ndarray
- func_ode_modes_deviations(t, v, c)¶
Wrapper function for the rates of change of the real-valued modes and flattened deviations.
Requires system method
get_mode_rates. Additionally,get_Ashould be defined for the deviations. Refer to Notes for their implementations.The variables are casted to real-valued.
- Parameters:
t (float) – Time at which the values are calculated.
v (numpy.ndarray) – Real-valued modes and flattened deviations. First
num_modeselements contain the real parts of the modes, the nextnum_modeselements contain the imaginary parts of the modes and optionally, the lastnum_corrselements contain the deviations.c (numpy.ndarray) – Defived constants and controls.
- Returns:
rates – Rates of change of the real-valued modes and flattened deviations.
- Return type:
numpy.ndarray
- get_mean_optical_occupancies()¶
Method to obtain the mean optical occupancies.
Requires system methods
get_ivcandget_coeffs_N_o. Refer to Notes for their implementations.For example, the mean optical occupancy of a simple end-mirror optomechanical system can be written as [1],
\[N_{o} = |\alpha_{s}|^{2} = \frac{\left| A_{l} \right|^{2}}{\frac{\kappa^{2}}{4} + \Delta^{2}}\]where \(\Delta = \Delta_{l} + C N_{o}\). This results in a cubic equation with \(4\) coefficients. The
get_coeffs_N_omethod should return these coefficients.- Returns:
N_os – Mean optical occupancies.
- Return type:
numpy.ndarray
- get_mode_rates_real(modes_real, c, t)¶
Method to obtain the real-valued mode rates from real-valued modes.
Requires the system method
get_mode_rates. Refer to Notes for its implementation.- Parameters:
modes_real (numpy.ndarray) – Real-valued modes.
c (numpy.ndarray) – Derived constants and controls.
t (float) – Time at which the drift matrix is calculated.
- Returns:
mode_rates_real – Real-valued rates for each mode.
- Return type:
numpy.ndarray
- init_A_D()¶
Method to initialize the drift matrix and the noise matrix of the system.
- set_params(params: dict)¶
Method to validate and set the system parameters.
- Parameters:
params (dict) – Parameters of the system.
- system_defaults = {}¶
Default parameters of the system.
- Type:
dict