finesse.analysis.actions.locks module

Lock Actions.

class finesse.analysis.actions.locks.DragLocks(*locks, parameters, stop_points, relative=False, method='proportional', scale_factor=1, num_steps=11, exception_on_fail=True, max_recursions=5, max_iterations=1000, display_progress=False, show_progress_bar=False, name='drag locks')[source]

Bases: Action

An action that incrementally changes model parameter values, reaching lock at each step, until lock is reached at the desired final parameter values.

Parameters

*lockslist, optional

A list of locks to use in each RunLocks step. Acts like the *locks parameter in RunLocks: if not provided, all locks in model are used.

parameterslist

A list of strings. Each element should correspond to a parameter in the model.

stop_pointslist

The final parameter values that locks move towards incrementally.

relativeboolean

If true, stop_points are relative to the initial parameter values.

max_recursionsint

The number of times that the step size is allowed to decreased by a factor of ten when locks fail.

methodstr, either “newton” or “proportional”

The method to use in each locking step.

scale_factorfloat

Factor by which to multiply all DOF changes. Should be set below 1 if it is desired to minimize overshooting.

num_stepsint

Number of steps to calculate, starting at the initial point and ending at the stop point.

exception_on_failboolean

When true, raise exception if max_recursions is surpassed.

max_iterationsint

The maximum number of locking steps in each execution of RunLocks. If surpassed, step size is decreased.

display_progressboolean

When true, displays the status of the lock dragging.

namestr

Name of the action.

class finesse.analysis.actions.locks.RunLocks(*locks, method='proportional', scale_factor=1, sensing_matrix=None, max_iterations=10000, display_progress=False, d_dof_phase=1e-09, d_dof_gain=1e-09, exception_on_fail=True, no_warning=False, pre_step=None, show_progress_bar=None, name='run locks')[source]

Bases: Action

An action that iteratively moves the system to lock. Currently, lock error signals must be readouts, not detectors, for use in this action.

Parameters

*lockslist, optional

A list of locks to use in each RunLocks step. If not provided, all locks in model are used.

methodstr, either “newton” or “proportional”

Which method to use in the locking iterations.

scale_factorfloat

Factor by which to multiply all DOF changes. Should be set below 1 if it is desired to minimize overshooting.

sensing_matrixSensingMatrixSolution or None

Sensing matrix of gains used in locking, of the type that would be returned by state.apply(SensingMatrixDC(lock_dof_names, readout_names) If None, the sensing matrix is recalculated. Recommended to be None except when locking multiple times in a row, e.g. with DragLocks.

max_iterationsint

The maximum number of locking steps in each execution of RunLocks.

display_progressboolean

When true, displays the status of the error signals during locking iterations.

d_dof_phasefloat

Step size to use when optimizing the demodulation phase for each error signal/DOF pair.

d_dof_gainfloat

Step size to use when calculating the gain for every pair of error signals and DOFs.

exception_on_failboolean

When true, raise exception if maximum iterations are surpassed.

no_warningboolean

When true, don’t even raise a warning if maximum iterations are reached. Recommended to be false unless repeatedly testing locking.

pre_stepAction

Action to apply on each step of the lock

show_progress_barboolean

Will enable the progress bar when true.

namestr

Name of the action.

complete_pbar()[source]
init_pbar(locks)[source]
update_pbar()[source]
update_pbar_lock(lock_name, is_locked)[source]
class finesse.analysis.actions.locks.RunLocksSolution(*args, **kwargs)[source]

Bases: BaseSolution

Solution from applying the RunLocks action.

Attributes

itersint

Number of steps lock has required

max_iterationsint

Maximum number of iterations this lock can do

error_signalsarray_like

error signals during locking steps, shape [num_locks, max_iterations]

control_signalsarray_like

Control signals during locking steps, shape [num_locks, max_iterations]

lock_namestuple[str]

Names of locks being controlled, shape [num_locks]

feedback_namestuple[str]

Names of feedback for each lock, shape [num_locks]

feedback_namestuple[str]

Names of error signals for each lock, shape [num_locks]

finalarrary_like

Final control signals, shape [num_locks]

sensing_matrixSensingMatrixSolution, optional

The sensing matrix used when running the locks with Newton’s method.

plot(ax=None)[source]

Plots how the error signals vary during this lock attempt.

Parameters

axMatplotlib.Axes, optional

Axes to plot on, if no current axis is set then a new one is generated

plot_control_signals(ax=None)[source]

Plots how the controls signals vary during this lock attempt. If 0 gaps will be shown when no change has been made to that degree of freedom for that step (As it was within the locks accuracy setting).

Parameters

axMatplotlib.Axes, optional

Axes to plot on, if no current axis is set then a new one is generated

plot_error_signals(ax=None)[source]

Plots how the error signals vary during this lock attempt.

Parameters

axMatplotlib.Axes, optional

Axes to plot on, if no current axis is set then a new one is generated

class finesse.analysis.actions.locks.SetLockGains(*locks, d_dof_gain=1e-10, gain_scale=1, name='set gains', verbose=False)[source]

Bases: Action

An action that computes the optimal lock gains using the sensing matrix found with SensingMatrixDC. This action computes the error signal gradient for each lock with respect to its drive and sets the gain as -gain_scale/sensing.

Parameters

*lockslist, optional

A list of locks for which to set the gain. If none provided, all enabled locks in model are used. Disabled locks that are explicitly listed will have their gains set.

d_dof_gainfloat, optional

Step size to use when calculating the gain for each error signal/DOF pair.

gain_scalefloat, optional

Extra gain scaling factor applied to the gain calculation: -gain_scale/sensing In multiple lock models where the locks are cross coupled using a gain_scale < 1 can improve the stability of the locking algorithm to stop excessively large steps.

namestr

Name of the action.

verbosebool

If True this will print the name of the enabled locks and their gains.