solrat.atom_model.multi_term_atom_model.object.rho_matrix_builder module

solrat.atom_model.multi_term_atom_model.object.rho_matrix_builder.construct_coherence_id(term: Term, K: float, Q: float, J: float, : float)[source]

Construct a unique ID for a coherence

solrat.atom_model.multi_term_atom_model.object.rho_matrix_builder.construct_coherence_id_from_term_id(term_id: str, K: float, Q: float, J: float, : float)[source]

Construct a unique ID for a coherence

class solrat.atom_model.multi_term_atom_model.object.rho_matrix_builder.Rho(terms: List[Term])[source]

Bases: BaseRho

A container for the density tensor Rho :param terms: list of all terms.

set_from_term_id(term_id: str, K: float, Q: float, J: float, : float, value: complex)[source]

Set the value

class solrat.atom_model.multi_term_atom_model.object.rho_matrix_builder.RhoMatrixBuilder(terms: List[Term])[source]

Bases: object

This class helps to build the matrix for rhos. All possible rhos are defined by terms.

Parameters:

terms – list of all terms.

reset_matrix()[source]

Reset the matrix to fill it from scratch later.

select_equation(term: Term, K: int, Q: int, J: float, : float)[source]

Selects the equation to add coefficients to.

The equation is of a form \(M_{ij} \rho_j = 0\). Here we select i.

add_coefficient(term: Term, K: int, Q: int, J: float, : float, coefficient: complex)[source]

Adds a coefficient to the selected equation.

The equation is of a form \(M_{ij} \rho_j = 0\). We have already selected i. Now we do \(M_{ij} += coefficient\), where j is defined by {term, \(K, Q, J, Jʹ\)}.

add_coefficient_from_df(df: DataFrame)[source]

Adds a coefficient to the selected equation from the dataframe of the form “index0”, “index1”, “coefficient”.

The equation is of a \(M_{ij} \rho_j = 0\). For each df row, we do \(M_{ij} += coefficient\), where i=index0 and j=index1.