yasfpy.simulation ================= .. py:module:: yasfpy.simulation .. autoapi-nested-parse:: Simulation orchestration. This module defines :class:`~yasfpy.simulation.Simulation`, which orchestrates the major steps of a YASF run: lookup-table generation, Mie/incident-field coefficient computation, linear-system solve for scattering coefficients, and optional field evaluation. Classes ------- .. autoapisummary:: yasfpy.simulation.Simulation Module Contents --------------- .. py:class:: Simulation(parameters, numerics) Run container for the core YASF simulation pipeline. :param parameters: Physical and material parameters for the run. :param numerics: Numerical configuration (truncation, sampling, coupling backend, etc.). .. rubric:: Notes The simulation object owns lookup tables and intermediate arrays that are produced during preprocessing and solver stages. .. py:attribute:: initial_field_coefficients :type: numpy.ndarray .. py:attribute:: mie_coefficients :type: numpy.ndarray .. py:attribute:: scatter_to_internal :type: numpy.ndarray .. py:attribute:: scattered_field_coefficients :type: numpy.ndarray .. py:attribute:: scattered_field_err_codes :type: numpy.ndarray .. py:attribute:: sampling_points :type: numpy.ndarray .. py:attribute:: initial_field_electric :type: numpy.ndarray | None .. py:attribute:: initial_field_magnetic :type: numpy.ndarray | None .. py:attribute:: scattered_field :type: numpy.ndarray .. py:attribute:: total_field_electric :type: numpy.ndarray .. py:attribute:: lookup_particle_distances :type: numpy.ndarray .. py:attribute:: h3_table :type: numpy.ndarray .. py:attribute:: idx_lookup :type: numpy.ndarray .. py:attribute:: sph_j :type: numpy.ndarray | None .. py:attribute:: sph_h :type: numpy.ndarray | None .. py:attribute:: e_j_dm_phi :type: numpy.ndarray | None .. py:attribute:: plm :type: numpy.ndarray | None This class represents the simulation of YASF (Yet Another Scattering Framework). It contains methods for initializing the simulation, computing lookup tables, and calculating mie coefficients. .. py:attribute:: parameters .. py:attribute:: numerics .. py:attribute:: log .. py:method:: legacy_compute_lookup_particle_distances() Compute particle distance lookup for legacy tables. Delegates to `yasfpy.lookups.legacy_compute_lookup_particle_distances`. .. py:method:: legacy_compute_h3_table() Compute the legacy spherical Hankel lookup table. Delegates to `yasfpy.lookups.legacy_compute_h3_table`. .. py:method:: compute_mie_coefficients() Compute Mie coefficients, stored on the simulation. Delegates to `yasfpy.mie_coefficients.compute_mie_coefficients`. .. py:method:: compute_initial_field_coefficients() Computes initial field coefficients $a_{\tau ,l,m}$ and $b_{\tau ,l,m}$. Delegates to `yasfpy.initial_field_coefficients.compute_initial_field_coefficients`. .. py:method:: compute_right_hand_side() Computes the right hand side $T \\cdot a_I$ of the equation $M \\cdot b = T \\cdot a_I$. :ivar right_hand_side: Right hand side of the equation $M \\cdot b = T \\cdot a_I$ :vartype right_hand_side: np.ndarray .. rubric:: Notes For more information regarding the equation, please refer to the paper by Celes (https://arxiv.org/abs/1706.02145). .. py:method:: coupling_matrix_multiply(x, idx = None) Compute Wx = coupling_matrix @ x. Delegates to `yasfpy.matrix_apply.coupling_matrix_multiply`. .. py:method:: master_matrix_multiply(value, idx) Apply master operator. Delegates to `yasfpy.matrix_apply.master_matrix_multiply`. .. py:method:: compute_scattered_field_coefficients(guess = None) Compute scattered field coefficients. Delegates to `yasfpy.scattered_field_coefficients.compute_scattered_field_coefficients`. .. py:method:: compute_fields(sampling_points) Compute fields at the given sampling points. This method delegates to `yasfpy.fields.compute_fields`.