fdtdx.calculate_sparams#
- fdtdx.calculate_sparams(objects, arrays, config, input_port_names, show_progress=True, input_normalization_detector_name=None, key=None, return_detector_states=False)[source]#
Run FDTD simulations for multiple input ports and merge S-parameters.
Calls
calculate_sparam()once per entry in input_port_names and merges all results into a single S-parameter dictionary.- Parameters:
objects (
ObjectContainer) – ObjectContainer fromsetup_sparams_simulation().arrays (
ArrayContainer) – ArrayContainer fromsetup_sparams_simulation().config (
SimulationConfig) – SimulationConfig fromsetup_sparams_simulation().input_port_names (
Sequence[str]) – Names of the input ports to simulate.show_progress (
bool) – Whether to display the simulation progress bar.input_normalization_detector_name (
str|None) – Passed through tocalculate_sparam().key (
Array|None) – JAX random key. Defaults toPRNGKey(0).return_detector_states (
bool) – WhenTrue, return the detector states from each simulation run as a list (one entry per input port). WhenFalsean empty list is returned.
- Return type:
tuple[dict[tuple[str,str],Array],list[dict[str,dict[str,Array]]]]- Returns:
A 2-tuple
(sparams, detector_states_list)where sparams is the mergeddict[tuple[str, str], jax.Array]across all simulations and detector_states_list is either a list of per-simulation detector state dicts or an empty list.