finesse.model.Model

Overview

class finesse.model.Model[source]

Bases: object

Optical configuration class for handling models of interferometers.

This class stores the interferometer configuration as a directed graph and contains methods to interface with this data structure.

Properties

Model.Nhoms

Number of higher-order modes (HOMs) included in the model.

Model.analysis

The root action to apply to the model when Model.run() is called.

Model.cavities

The cavities stored in the model as a tuple object.

Model.components

The components stored in the model as a tuple object.

Model.detectors

The detectors stored in the model as a tuple object.

Model.electrical_nodes

The electrical nodes stored in the model.

Model.elements

Dictionary of all the model elements with the keys as their names.

Model.epsilon

Scaling factor for mechanical motion to optical modulation.

Model.f0

The default frequency to use for the model.

Model.frequencies

The frequencies stored in the model as a list instance.

Model.gauss_commands

A dictionary of optical nodes that have beam parameters set manually - stores the nodes themselves as keys and the corresponding beam parameters as values.

Model.homs

An array of higher-order modes (HOMs) included in the model.

Model.input_matrix_dc

The DC input matrix is used to relate degrees of freedoms and readouts within a model.

Model.is_built

Flag indicating whether the model has been built.

Model.is_modal

Flag indicating whether the model is modal or plane-wave.

Model.is_traced

Flag indicating whether the model has been traced.

Model.lambda0

The default wavelength to use for the model.

Model.last_trace

An instance of BeamTraceSolution containing the output of the most recently stored beam trace performed on the model.

Model.locks

Model.mechanical_nodes

The mechanical nodes stored in the model.

Model.mode_index_map

An ordered dictionary where the key type is the modes in the model and the mapped type is the index of the mode.

Model.modes_setting

Model.network

The directed graph object containing the optical configuration as a networkx.DiGraph instance.

Model.optical_network

A read-only view of the directed graph object stored by Model.network but only containing nodes of type OpticalNode and only with edges that have couplings to optical nodes.

Model.optical_nodes

The optical nodes stored in the model.

Model.phase_level

An integer corresponding to the phase level given to the phase command of a Finesse 2 kat script.

Model.retrace

Whether the model will be retraced during a simulation.

Model.sim_trace_config

Dictionary corresponding to beam tracing configuration options for simulations.

Model.source_frequencies

The source frequencies stored in the model as a dict instance.

Model.spatial_type

The spatial type of the model - i.e. either plane wave or modal based.

Model.trace_forest

The TraceForest instance held by the model.

Model.trace_order

A list of beam tracing dependencies, ordered by their tracing priority.

Model.trace_order_names

A convenience property to retrieve a list of the names of each TraceDependency instance in Model.trace_order.

Methods

Model.__init__()

Model.ABCD([from_node, to_node, via_node, ...])

See finesse.tracing.tools.compute_abcd()

Model.acc_gouy([from_node, to_node, ...])

See finesse.tracing.tools.acc_gouy()

Model.add(obj)

Adds an element (or sequence of elements) to the model - these can be ModelElement sub-class instances.

Model.add_all_ad(node[, f])

Adds amplitude detectors at the specified node and frequency f for all Higher Order Modes in the model.

Model.add_frequency(freq)

Add a source frequency to the model description.

Model.add_matched_gauss(node[, name, ...])

Adds a Gauss object mode matched to the model at the specified node.

Model.beam_trace([order, disable, ...])

Performs a full beam trace on the model, calculating the beam parameters at each optical node.

Model.built()

Model.cavity_mismatch([cav1, cav2])

See finesse.tracing.tools.compute_cavity_mismatches()

Model.chain(*args[, start, port])

Utility function for connecting multiple connectable objects in a sequential list together.

Model.component_tree([root])

Retrieves a tree containing the network representing the components connected to the specified root.

Model.compute_space_gouys([deg])

Calculate the Gouy phases accumulated over each space.

Model.connect(A, B[, L, nr, delay, name, ...])

Connects two ports in a model together.

Model.create_mismatch(node[, w0_mm, z_mm])

Sets the beam parameters such that a mismatch of the specified percentage magnitude (in terms of \(w_0\) and \(z\)) exists at the given node.

Model.deepcopy()

Model.detect_mismatches(**kwargs)

Detect the mode mismatches in the model.

Model.get_active_elec_mech_nodes()

Returns the electrical and mechanical nodes that are active in a model, i.e. ones that need to be solved for because:.

Model.get_changing_edges_elements()

Returns

Model.get_elements_of_type(element_type)

Extracts elements of a specific type from this model.

Model.get_frequency_object(frequency_value)

Model.get_network([network_type])

Get specified network.

Model.include_modes(modes)

Inserts the mode indices in modes into the Model.homs array at the correct (sorted) position(s).

Model.info([modes, components, detectors, ...])

Get string containing information about this model.

Model.link(*args)

Model.merge(other, from_comp, from_port, ...)

Merges the model other with this model using a connection at the specified ports.

Model.parse(text[, spec])

Parses kat script and adds the resulting objects to the model.

Model.parse_file(path[, spec])

Parses kat script from a file and adds the resulting objects to the model.

Model.parse_legacy(text)

Parses legacy (Finesse 2) kat script and adds the resulting objects to the model.

Model.parse_legacy_file(path)

Parses legacy (Finesse 2) kat script from a file and adds the resulting objects to the model.

Model.path(from_node, to_node[, via_node])

Retrieves an ordered container of the path trace between the specified nodes.

Model.plot_graph(network_type, **kwargs)

Plot the node network.

Model.print_cavity_mismatches([direction, ...])

Prints the mismatches between each cavity in an easily readable table format.

Model.print_mismatches([table_fmt])

Prints the mismatches computed by Model.detect_mismatches() to an easily readable table.

Model.print_space_gouys([table_fmt, deg])

Prints the space Gouy phases, as computed by Model.compute_space_gouys(), to an easily readable table.

Model.propagate_beam([from_node, to_node, ...])

See finesse.tracing.tools.propagate_beam()

Model.propagate_beam_astig([from_node, ...])

See finesse.tracing.tools.propagate_beam_astig()

Model.reduce_get_attr(attr)

Get an attribute of the model using a string path representation like l1.p1.o.q.

Model.reduce_set_attr(attr, value)

Set an attribute of the model using a string path representation like l1.p1.o.q.

Model.remove(obj)

Removes an object from the model.

Model.remove_modes(modes)

Removes the mode indices in modes from the Model.homs array.

Model.reset_sim_trace_config()

Resets the simulation beam tracing configuration dict, given by Model.sim_trace_config, to the default (corresponds to the default arguments of Model.beam_trace()).

Model.run([return_state])

Runs the current analysis set for this model.

Model.select_modes([modes, maxtem, include, ...])

Select the HOM indices to include in the model.

Model.sim_trace_config_manager(**kwargs)

Change the Model.sim_trace_config within a context.

Model.sub_model(from_node, to_node)

Obtains a subgraph of the complete configuration graph between the two specified nodes.

Model.switch_off_homs()

Turns off HOMs, switching the model to a plane wave basis.

Model.tag_node(node, tag)

Tag a node with a unique name.

Model.to_component_network()

Generate an undirected graph containing components as the nodes of the graph and connections (spaces, wires, joints) between component nodes as the edges of the graph.

Model.unbuild()

If a model has been built then this function undoes the process so the model can be changed and rebuilt if required.

Model.unparse()

Serialise the model to kat script.

Model.unparse_file(path)

Serialise the model to kat script in a file.

Model.update_gauss(node[, qx, qy])

Update the value of a manual beam parameter (i.e.