finesse.model.Model.sim_trace_config

property Model.sim_trace_config

Dictionary corresponding to beam tracing configuration options for simulations.

The (string) keys of this dict are:

  • The arguments of Model.beam_trace(), see the linked docs for descriptions of each of these. These config values are passed to the initial beam trace call when building a modal simulation, thereby determining the structure of both the Model.trace_forest used for computing the initial beam parameters, as well as the trace forest of changing beam paths as stored by the simulation itself.

  • “retrace” — flag determining whether beam tracing is re-executed, during a simulation, whenever some dependent parameter changes. This is True by default, meaning that any paths in the model with changing geometric parameters will automatically be retraced during the simulation. Setting this to False means that the initial beam parameters (from the beam trace executed at the start of the simulation) are used for all data points, regardless of whether any geometric parameter is changing or not.

  • “unstable_handling” — the strategy to use when encountering unstable optical cavities during a simulation (as a potential result of scanning geometric parameters). The accepted values for this config option are:

    • “auto” — (default) contingency TraceForest instances are created when entering unstable cavity regions; or, if there are no stable TraceDependency objects, detector outputs are masked appropriately in these regions.

    • “mask” — detector outputs masked appropriately whenever an unstable cavity is encountered; i.e. nothing else (scatter matrices, gouy phases, refills etc.) is computed for such data points.

    • “abort” — immediately aborts the simulation, if an unstable cavity is encountered,

      by raising a BeamTraceException.

Hint

Most of the time it is better to use Model.sim_trace_config_manager() to temporarily set simulation beam tracing configuration options, rather than modifying the entries here directly (which then requires manual re-setting as outlined below).

Getter:

Beam tracing configuration options for simulations.

Examples

One can use this property to change the behaviour of beam tracing for a simulation. For example, this:

model.sim_trace_config["disable"] = "cav1"

would switch off tracing from the trace-dependency named “cav1” during a simulation.

It can also be used to temporarily override the trace order used, without modifying TraceDependency.priority values and, thus, without modifying the actual Model.trace_order. For example:

model.sim_trace_config["order"] = ["gL0", "cav2", "cav1"]

would set the trace ordering for the next simulation using this model to the order given.

To reset the sim_trace_config dict entries to the default values, call Model.reset_sim_trace_config().