qom.solvers.base module¶
Base module for solver functions.
- qom.solvers.base.get_all_times(params)¶
Function to obtain all times.
- Parameters:
params (dict) –
- Parameters of the solver. Required options are:
key
value
’t_min’
(float) minimum time at which integration starts.
’t_max’
(float) maximum time at which integration stops.
’t_dim’
(int) number of values from
't_max'to't_min', both inclusive.
- Returns:
T – All times.
- Return type:
numpy.ndarray
- qom.solvers.base.validate_As_Coeffs(As=None, Coeffs=None)¶
Function to validate the drift matrices and the coefficients.
- Parameters:
As (list or numpy.ndarray, optional) – Drift matrix.
Coeffs (list or numpy.ndarray, optional) – Coefficients of the characteristic equation.
- Returns:
As (numpy.ndarray) – Drift matrix.
Coeffs (numpy.ndarray) – Coefficients of the characteristic equation.
- qom.solvers.base.validate_Modes_Corrs(Modes=None, Corrs=None, is_modes_required: bool = False, is_corrs_required: bool = False)¶
Function to validate the modes and correlations.
At least one of
ModesorCorrsshould be non-None.- Parameters:
Modes (list or numpy.ndarray, optional) – Classical modes with shape
(dim, num_modes).Corrs (list or numpy.ndarray, optional) – Quadrature quadrature correlations with shape
(dim, 2 * num_modes, 2 * num_modes).is_modes_required (bool, optional) – Option to set
Modesas required.is_corrs_required (bool, optional) – Option to set
Corrsas required.
- Returns:
Modes (numpy.ndarray) – Classical modes with shape
(dim, num_modes).Corrs (numpy.ndarray) – Quadrature quadrature correlations with shape
(dim, 2 * num_modes, 2 * num_modes).
- qom.solvers.base.validate_system(system, required_system_attributes: list)¶
Function to validate the required system attributes for a given solver method.
- Parameters:
system (
qom.systems.*) – Instance of the system.required_system_attributes (list) – Required system attributes.