Utilities

change
Change

Changes a model Parameter to some value during an analysis.

Syntax
change(change_dict=none, relative=false, name='change', **kwargs)
Required

**kwargs: Alternative method to specify parameter:value pairs to change

Optional

change_dict: Dictionary of parameter:value pairs to change.

relative: Whether to increment from the parameters current value or not

name: Name of action

dc_fields
DCFields

An action that saves the DC (carrier) fields at all nodes, frequencies, and higher order modes for the current state of the simulation.

Syntax
dc_fields(name='dcfields')
Optional

name: Name of the solution generated by this action

debug
Debug

An action that will start an IPython debug shell.

To access the current model use state.model.

Syntax
debug(name='Debug')
maximize
Maximize

An action that maximizes some detector output by applying some feedback to multiple targets in a model.

An action that will optimize the value of parameter to either maximize or minimize the output of a detector during a simulation. Extra keyword arguments are passed on to the Scipy method: minimize This action offers a simplified interface that allows an optimization to be done during a simulation. By default the the Nelder-Mead optimization method is used but can be overriden. The user should read the Scipy documentation to determine which options should be used which are method dependant.

Syntax
maximize(detector, parameter, *args, name='maximize', **kwargs)
Required

detector: The name of the detector output to maximize / minimize.

parameter: The parameter or name of the parameter to optimize, or a tuple of parameters when using multiple targets to optimize over.

**kwargs: Optional parameters passed to the Scipy optimisation routine as the options input. See Scipy method documentation to determine what is available.

Optional

bounds: A pair of (lower, upper) bounds on the parameter value. Requires a method that uses bounds.

offset: An offset applied to the detector output when optimizing, defaults to 0.

kind: Either ‘max’ for maximization or ‘min’ for minimization, defaults to ‘max’.

max_iterations: Maximum number of solver iterations, defaults to 10000.

method: Optimisation method to use, see Scipy documentation for options.

name: The name of this action, defaults to ‘maximize’.

update_maps: If you are changing some parameter or variable that a Map depends on then setting this flag to True will recompute the Map data for each iteration of the optimiser.

pre_step: Action to run on each step of the optimisation.

See Also

minimize

minimize
Minimize

An action that minimizes some detector output by applying some feedback to multiple targets in a model.

An action that will optimize the value of parameter to either maximize or minimize the output of a detector during a simulation. Extra keyword arguments are passed on to the Scipy method: minimize This action offers a simplified interface that allows an optimization to be done during a simulation. By default the the Nelder-Mead optimization method is used but can be overriden. The user should read the Scipy documentation to determine which options should be used which are method dependant.

Syntax
minimize(detector, parameter, *args, name='minimize', **kwargs)
Required

detector: The name of the detector output to maximize / minimize.

parameter: The parameter or name of the parameter to optimize, or a tuple of parameters when using multiple targets to optimize over.

**kwargs: Optional parameters passed to the Scipy optimisation routine as the options input. See Scipy method documentation to determine what is available.

Optional

bounds: A pair of (lower, upper) bounds on the parameter value. Requires a method that uses bounds.

offset: An offset applied to the detector output when optimizing, defaults to 0.

kind: Either ‘max’ for maximization or ‘min’ for minimization, defaults to ‘max’.

max_iterations: Maximum number of solver iterations, defaults to 10000.

method: Optimisation method to use, see Scipy documentation for options.

name: The name of this action, defaults to ‘maximize’.

update_maps: If you are changing some parameter or variable that a Map depends on then setting this flag to True will recompute the Map data for each iteration of the optimiser.

pre_step: Action to run on each step of the optimisation.

See Also

maximize

noise_projection
NoiseProjection
Syntax
noise_projection(f, *output_nodes, scaling=none, name='loop')
plot
Plot
Syntax
plot(name=abcd)
print
Printer
Syntax
print(*args, name='printer', eval=true)
print_model
PrintModel

An action that prints the model object being currently used to run actions.

Syntax
print_model(name='print_model')
print_model_attr
PrintModelAttr

Prints an attribute of the model being currently used.

Syntax
print_model_attr(*args, eval=true, prefix='')
Required

*args: Strings input for the attribute to print

Optional

eval: When True symbolic expressions will be evaluated before printing. Defaults to True.

prefix: Optional string to print before the attributes

pseudo_lock_cavity
PseudoLockCavity

An action that locks a cavity defined by a Cavity element to a specific mode without using any radio-frequency sensing scheme. This will only work on simple cavities that are not coupled in any way. You can specify whether to try and lock to a particular HG mode with the mode=[n,m] keyword argument, or just pick the lowest loss mode, lowest_loss=True.

Syntax
pseudo_lock_cavity(
    cavity,
    mode=none,
    lowest_loss=false,
    feedback=none,
    name='pseudo_lock_cavity'
)
Required

cavity: Cavity element describing some Fabry-Perot like optical cavity

Optional

mode: HG mode to try and lock to, default is [0,0]

lowest_loss: Select the eigenmode which has the lowest loss, most likely the fundamental mode of the cavity. Using lowest loss will override the mode selection.

feedback: If None the required cavity tuning to lock to the calculated mode will be determined from the cavity objects source node element, and the relevant phi parameter will be used. Alternatively you can specify which tuning parameter is used instead. Which should be a phi of some mirror in the cavity or a DegreeOfFreedom which controls the cavity length.

name: Name of the solution generated by this action

pseudo_lock_drfpmi
PseudoLockDRFPMI

Pseudo-locking is attempting to find an operating point for a LIGO like model without needing to use RF sidebands and readouts. Although it is not physically accurate it does provide a useful tool for analysing detectors from a more theoretical basis. This generates a PseudoLockDRFPMISolution solution containing various operators and results.

This action is hardcoded to work with a LIGO like model. Mirrors should be named with ITMX, ETMX, PRM, etc. This currently action only really works for finding the lock points for the PRC, SRC, XARM, and YARM – which all have defined cavity roundtrips which allow eigendecomposition of roundtrip operators. The eigenvectors describe the HOM mix for each resonant mode in a cavity and the eigenvalues the roundtrip phase and loss of the mode. This code looks for eigenvectors with the largest HG00 content and then uses the eigenvalues to compute what cavity tunings need to make this mode resonant. The corner is the most complicated here as the PRC and SRC are coupled via the beamsplitter. The eigendecomposition is performed on the 2x2 operator matrix for the PRC, SRC, and the coupling matrices between them. When the coupling is small the results are the same as performing the decomposition on each SRC and PRC separately. Note that the only degree of freedom that this does not handle currently is MICH. MICH is awkward because it is not a cavity. It is essentially the beamsplitter position that makes the anti-symmetric port dark.

Syntax
pseudo_lock_drfpmi(frequency=0, apply_tunings=true, name='operator_lock')
Optional

frequency: Frequency to use for calculating the operators

apply_tunings: When True the action will modify the model tunings

name: Name of the solution generated by this action

run_locks
RunLocks

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

Syntax
run_locks(
    *locks,
    method='proportional',
    scale_factor=1,
    sensing_matrix=none,
    max_iterations=10000,
    display_progress=false,
    optimize_phase=none,
    d_dof_phase=1e-09,
    set_gains=true,
    d_dof_gain=1e-09,
    exception_on_fail=true,
    no_warning=false,
    pre_step=none,
    show_progress_bar=none,
    name='run locks'
)
Required

method: Which method to use in the locking iterations.

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

sensing_matrix: 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_iterations: The maximum number of locking steps in each execution of RunLocks.

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

optimize_phase: Deprecated: Use an action like OptimiseRFReadoutPhaseDC instead.

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

set_gains: Only applies if method is “proportional”. If true, sets the gains for each error signal/DOF pair. If false, uses pre-set gains.

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

exception_on_fail: When true, raise exception if maximum iterations are surpassed.

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

pre_step: Action to apply on each step of the lock

show_progress_bar: Will enable the progress bar when true.

name: Name of the action.

Optional

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

save_matrix
SaveMatrix

An action that will save the current state of the matrix being used by the simulation.

Not something that should be used lightly in loops or multiple times in a large simulation. Using this in something like a full LIGO model with many HOMs and sidebands will quickly fill up memory.

Syntax
save_matrix(name='savematrix')