pg_utils.eigen.compute_matrix_numerics

pg_utils.eigen.compute_matrix_numerics(read_from: Union[str, Tuple[SystemMatrix, SystemMatrix, List]], xpd_recipe: ExpansionRecipe, Ntrunc: int, par_val: dict, jacobi_rule_opt: dict = {'automatic': True, 'quadN': None}, quadrature_opt: dict = {'backend': 'scipy', 'outer': True, 'output': 'numpy'}, save_to: Optional[str] = None, format: Literal['hdf5', 'json', 'pickle'] = 'hdf5', overwrite: bool = False, verbose: int = 0) Tuple[ndarray, ndarray][source]

Eigensolver step III: computation of matrix elements

Parameters:
  • read_from (Union[str, Tuple[expansion.SystemMatrix, expansion.SystemMatrix, List]]) –

    the symbolic matrices to be computed. * If read_from is str, then this will be interpreted as a

    json file name to be loaded as symbolic matrices;

    • if read_from is a 3-tuple of two `expansion.SystemMatrix`s and

      List, these will be understood as the mass matrix, the stiffness matrix and a list of required unknown parameters.

  • expansion_recipe (expansion.ExpansionRecipe) – spectral expansion

  • Ntrunc (int) – truncation degree (for the vorticity / magnetic field),

  • par_val (dict) – the values to be used for unknown parameters,

  • jacobi_rule_opt (dict) – options for Gauss-Jacobi quadrature, to be passed to InnerQuad_GaussJacobi

  • quadrature_opt (dict) – options for forming the inner product matrix, to be passed to gramian

  • save_to (Optional[str]) – output json file name, if None (default), no file will be written.

  • format (Literal["hdf5", "json", "pickle"]) – output format

  • overwrite (bool) – whether to overwrite existing file upon output, False by default.

  • verbose (int) – verbosity level, default to 0.

Returns:

the numerical mass and stiffness matrices.