finesse.simulations.sparse package

Submodules

finesse.simulations.sparse.KLU module

class finesse.simulations.sparse.KLU.KLUSolver(*args, **kwargs)

Bases: SparseSolver

This extends the BaseSolver for using the KLU (Suitesparse) library for solving linear sparse systems of equations. It sets the _M member to a KLUMatrix.

add_noise_matrix(self, key)
add_rhs(self, str key)
condest(self) double
initial_run(self)
rcond(self) double
refactor(self)
rgrowth(self) double
solve(self)
solve_noises(self)
class finesse.simulations.sparse.KLU.KLUStatWorkspace

Bases: DetectorWorkspace

class finesse.simulations.sparse.KLU.KLUStatsDetector(*args, **kwargs)

Bases: Detector

A detector that can be used to output some of the KLU solver statistics.

fill(self, ws)

finesse.simulations.sparse.simulation module

class finesse.simulations.sparse.simulation.SparseMatrixSimulation(model, str name, dict simulation_options, bool needs_matrix=True)

Bases: BaseSimulation

A simulation type which solves the carrier and signal simulations using large sparse matrices, solving systems such as Ma=b.

build_carrier_solver(self, nodes, optical_frequencies)
build_signal_solver(self, nodes, optical_frequencies, signal_frequencies)
compute_knm_matrices(self)
initialise_noise_matrices(self)
initialise_noise_selection_vectors(self)
initialise_noise_sources(self)
initialise_workspaces(self)
modal_update(self)
setup_build(self)

finesse.simulations.sparse.solver module

class finesse.simulations.sparse.solver.SparseSolver(matrix_type, str name, list nodes, FrequencyContainer optical_frequencies, dict signal_frequencies, bool is_signal_matrix, bool forced_refill, dict node_aliases, int num_optical_homs, bool debug_mode=False, dict matrix_kwargs=None)

Bases: HOMSolver

This class overrides the BaseSolver and adds the features required to use a sparse (compressed column, CCS) matrix. The type of sparse solver is not assumed here and must be provided by the matrix_type argument. This should be inherited and the matrix type provided for specific linear algebra solvers.

Notes

This is the original solver used in Finesse 3.

M

A weak reference to the underlying Matrix object.

Note

References to the Matrix should not be kept.

Getter:

Returns a weak reference to the underlying matrix (read-only).

assign_noise_operators(self, connector_workspaces)
assign_operators(self, connector_workspaces)
clear_rhs(self)
construct(self)
destruct(self)

This is called when finishing and unbuilding the simulation.

Classes that override this call should mindful of what this method is doing to and call it.

fill_noise_inputs(self)
fill_rhs(self)
initial_fill(self)
print_matrix(self)
refill(self)
refill_rhs(self)
set_source(self, node, int freq_idx, int hom_idx, double complex value)

Module contents

This modules contains the functionality for building and running a sparse matrix solver for computing the outputs of a simulation.

This is typically what earlier versions of FINESSE did in that two large sparse matrices are built and solved for both the carrier and signal systems.