Alpha 1
This is intended to correspond to a "release" version for current Finesse veterans in the community to test so that we can receive feedback and bug reports from users who have experience in running Finesse 2 simulations.
The main feature to demonstrate in Alpha 1 will be the new syntax. This feature should be more or less finished by this release. Other parser-related new features such as unparsing in the same order as the parsed file (#200) are less critical for Alpha 1.
Required features
Below are sections identifying required features for an initial alpha release. Associated source files linked to these topics are given where relevant.
Parsing kat files
-
Legacy mode
- Any missing things we need to support from old syntax? Maybe some funny commands missing (PHIL: CREATE ISSUE)
- Relevant issues #167, #185
- Make sure all known failures get handled correctly
- Proper syntax error handling / reporting -> Relevant issue [PUT NUMBER HERE]
- Documentation page for legacy syntax
- Relevant files:
finesse/script/legacy.py
-
finesse/model.py
(seeModel.parse_legacy
,Model.parse_legacy_file
)
-
New features & syntax
- Merge Requests (!33)
- Needs examples
- Documentation page for new syntax (#187)
- Define feature-set to advertise for Alpha 1 -> this feature-set should be documented and tested
- Relevant files:
- Sub-module:
finesse/script
-
finesse/model.py
(seeModel.parse
,Model.parse_file
)
- Sub-module:
Basic plane-wave simulations
-
Optimised matrix / rhs filling for components:
-
Mirror
- Relevant files:
-
finesse/components/mirror.py
(seeMirror._get_workspace
) -
finesse/components/modal/mirror.pyx
(seec_mirror_fill
)
-
- Relevant files:
-
Beamsplitter
- Relevant files:
-
finesse/components/beamsplitter.py
(seeBeamsplitter._get_workspace
) -
finesse/components/modal/beamsplitter.pyx
(seec_beamsplitter_fill
)
-
- Relevant files:
-
Space
- Relevant files:
-
finesse/components/space.py
(seeSpace._get_workspace
) -
finesse/components/modal/space.pyx
(seec_space_fill
)
-
- Relevant files:
-
Laser
- Relevant files:
-
finesse/components/laser.py
(seeLaser._get_workspace
) -
finesse/components/modal/laser.pyx
(seec_laser_fill_rhs
)
-
- Relevant files:
-
Modulator (implemented but not yet optimised)
- Relevant files:
-
finesse/components/modal/modulator.pyx
(seemodulator_fill
)
-
- Relevant files:
-
Isolator
- Relevant files:
-
finesse/components/isolator.py
(seeIsolator._fill_matrix
)
-
- Relevant files:
-
Photodiode
- Relevant files:
-
finesse/components/photodiode.py
(seePhotodiode._fill_matrix
)
-
- Relevant files:
-
Mirror
-
Optimised detector output computations:
-
Power detector
- Relevant files:
-
finesse/detectors/compute/power.pyx
(seePDWorkspace
s and related functions)
-
- Relevant files:
-
Amplitude detector
- Relevant files:
-
finesse/detectors/compute/power.pyx
(seeADWorkspace
and related functions)
-
- Relevant files:
- Cavity detector (for non-HOM stuff like FSR, FWHM, etc.)
-
Power detector
- Scanning of non-HOM-related model parameters (e.g. detunings, reflectivity, transmission, ...)
Higher Order Modes (HOMs) for simulations
The required features for performing HOM simulations are listed below. For a first alpha release, we do not expect that aperture or map calculations will be implemented so they have been intentionally left out. These extra coupling effects will be implemented in later releases.
-
Optimised beam tracing
- ABCD matrices for all components
-
Cavity object
- Relevant files:
-
Gauss object (i.e. gauss command in old Finesse)
- Relevant files:
-
finesse/gaussian.py
(seeGauss
)
-
- Relevant files:
-
Efficient determination of changing beam parameters
- Relevant files:
-
finesse/tracing/ctracer.pyx
(seeTraceForest.make_changing_forest
) -
finesse/simulations/base.pyx
(seeBaseSimulation._determine_changing_beam_params
)
-
- Relevant files:
-
Optimised propagation during simulation
- Relevant files:
-
finesse/simulations/base.pyx
(seeBaseSimulation.trace_beam
)
-
- Relevant files:
- Documentation of beam tracing options (PUT ISSUE HERE)
-
Gouy phase calculations:
-
over spaces
- Relevant files:
-
finesse/components/modal/space.pyx
(seeset_gouy_phase
)
-
- Relevant files:
-
for Laser TEMs
- Relevant files:
-
finesse/components/modal/laser.pyx
(seeset_tem_gouy_phases
)
-
- Relevant files:
-
over spaces
-
Selection of HG modes to model
- via maxtem
- through "typed" selection method (i.e. "even", "tangential" etc.)
- Relevant files:
-
finesse/model.py
(seeModel.select_modes
)
-
-
Optimised scattering matrix (BH knmn'm' calculations):
- Mirror
- Beamsplitter
- Lens
- Modulator
- Isolator
- Relevant files:
-
finesse/knm.pyx
(this contains code for generic BH scattering matrix calculations) - All corresponding files in
finesse/components/modal
(see functions mentionknm_workspaces
)
-
-
Optimised detector output computations
-
Power detector
-
standard calculations (summing over mode indices)
- Relevant files:
-
finesse/detectors/compute/power.pyx
(seePDWorkspace
s and related functions)
-
- Relevant files:
- masks (need to be re-implemented efficiently, not difficult) (Issue: )
- custom / split PDs (same as above) (Issue: )
-
standard calculations (summing over mode indices)
-
Amplitude detector
- Relevant files:
-
finesse/detectors/compute/power.pyx
(seeADWorkspace
and related functions)
-
- Relevant files:
-
Cameras (intensity & amplitude versions)
- Pixel
- ScanLine
- Full image
- Relevant files:
-
Beam properties (e.g.
q
,w
,w0
, ...)- Relevant files:
finesse/detectors/bpdetector.py
-
finesse/detectors/compute/gaussian.pyx
(seec_bp_detector_output
)
- Relevant files:
-
Cavity properties
- Relevant files:
finesse/detectors/cavity_detector.py
-
finesse/detectors/compute/gaussian.pyx
(seec_cp_detector_output
)
- Relevant files:
-
Accumulated Gouy phase
- Relevant files:
-
Direct coupling coefficient (knm) detection
- Relevant files:
finesse/detectors/knmdetector.py
-
finesse/detectors/compute/power.pyx
(seec_knm_detector_output
)
- Relevant files:
-
Power detector
- Scanning of HOM-related model parameters
Signal matrix computations
- Signal generator object
-
Optimised signal matrix / rhs filling:
- Signal generator
- Mirror
- Beamsplitter
- Laser
-
Space
- GW signal node (Issue?:)
-
Computing multiple signal injections at once (Issue:)
- sensing matrix
- handling of operating points
-
Detectors:
- Amplitude detector
- Demodulated pds
- MotionDetector
- ComplexCameras
Quantum noise
(Phil, Dan - create list of features here)
Suggestions:
- Building of noise matrix
- qnoised detector
Radiation pressure
- Plane-wave
-
HOM effects (Issue:?)
- Torsional optical spring
- Utilities / initial framework for control part (Issue:?)
CLI
- Improvements to CLI (see #139)
General simulation utilities
-
Axis scan actions (i.e.
xaxis
,x2axis
, ...)- Relevant files:
-
finesse/analysis/actions.py
(seeStepParamND
and various Xaxis objects) finesse/analysis/axes.py
-
finesse/analysis/runners.pyx
(seerun_axes_scan
)
-
- Documentation of actions (Issue:?)
- Relevant files:
-
Solution object (from axis scans)
- Access of detector outputs
-
Plotting
- Relevant files:
-
finesse/plotting/plot.py
(seePlotter
)
-
- Relevant files:
- Serialisation(?)
- Relevant files:
-
finesse/solutions/array.pyx
(seeArraySolution
)
-
- Documentation of solution object (Issue:?)
- Locking (Issue:?)
API improvements
These refer to enhancements to interacting with Finesse for end-users; including features such as better error handling, improved CLI options and convenient methods / actions for performing common tasks.
- Sensible, and complete, model parameter validation (see #123)
- Sanity checking on non-model-parameter (info_parameter) variables (see #86)
- Reduce import times (see #135)
Optimisations
Performance is pretty good now that we are using Cythonised workspaces, with most of the code hit during a simulation being pure C at this point. There are a few areas for improvement still, however, which (of course) involve getting rid of more CPython interactions during the simulation loop(s).
Would be nice to do these but not strictly necessary for Alpha 1.
- Main thing to optimise now is symbolic expression code. These are still heavily Python dependent (as the operations are Python based rather than C based). This must be converted to C somehow, via JIT compilation for example. There are some ideas for this in #107.
- The next most important optimisation to do is Cythonising of model parameter validation. Again, issues #107 and #123 (see comments on this one) mention possible solutions for this.
Testing
Need to make more comprehensive list here -> discuss on future call.
- Radiation pressure plane-waves
- GW detector pre-tuning files
-
Beam tracing
- Full LIGO file -> overlapping cavities and such (PUT ISSUE HERE)
Documentation
(Speak to Aaron about documenting stuff)
- General documentation issue: (?)
- Documenting custom component creation with particularly attention paid to linking to Cython workspaces
Desirable features
The features listed here would be nice to have in the initial release, however are not absolutely necessary for now.
Extra features
These are features which tend not to be linked with Finesse simulations in the traditional sense, but provide additional utilties which will be useful outside of a simulation context.
Beam propagation
-
Propagation of a beam with arbitrary
q
over any path of the model- Numeric propagation
- Symbolic propagation
-
Solution object for propagated beam results
-
Access of key properties such as
q
,w
at nodes / comps - Attribute(s) and methods for determining total acc. Gouy and Gouy phase accumulated over each space of the path
-
Plotting of the propagated beam in terms of:
- Beam size
- Accumulated Gouy phase
- Wavefront curvature
- Relevant files:
-
finesse/solutions/beamtrace.py
(seePropagationSolution
)
-
-
Access of key properties such as
- Relevant files:
-
finesse/tracing/tools.pyx
(seepropagate_beam
) - Can also compute via:
finesse/model.py
(seeModel.propagate_beam
)
-
-
Compute accumulated Gouy phase over any path of the model
- Relevant files:
-
finesse/model.py
(seeModel.acc_gouy
) -
Note: this can also be found with the generic function:
propagate_beam
(see first point in this section)
-
- Relevant files:
-
Calculate composite ABCD matrix over any path of the model
- Relevant files:
-
finesse/model.py
(seeModel.ABCD
) -
Note: this can also be found with the generic function:
propagate_beam
(see first point in this section)
-
- Relevant files:
Internal code structure refactoring
The list below details code accessibility / readability issues which should be solved. This is mainly for development purposes to make it easier for new (and current!) developers to understand / remember where specific features are and where new features should go.
Note that much of the below could be considered a matter of opinion, not all of these changes might need to be made
-
finesse/components/matrixfill.pyx
needs re-organising, specifically:-
OutputFuncWrapper
needs to be somewhere infinesse/detectors
... -
... as does
DetectorWorkspace
-
ConnectorWorkspace
(andElementWorkspace
) should probably also sit somewhere else- In fact, this whole file probably needs refactoring so that pretty much only
FillFuncWrapper
is left there
- In fact, this whole file probably needs refactoring so that pretty much only
-
-
finesse/detectors/compute/power.pyx
is quite bloated, things to address:- as of 61f68851 at least (last change to this file as of writing), lines 561 onwards seem obsolete
-
the file contains
ADWorkspace
and associated functions +KnmDetectorWorkspace
and associated function, these probably should go in a different Cython file in same directory.
-
Quite a lot is going on in
finesse/analysis/actions.py
, common action types should possibly be refactored into separate files. -
finesse/element.pyx
is in a particularly bad state as of writing, things to address:-
This file should probably only contain the
ModelElement
class and themodel_parameter
,info_parameter
decorators. All else needs moving, see below. -
Symbolic related objects (
Symbol
,Constant
,Operation
) and functions (display
,evaluate
,as_symbol
) should be moved to a newfinesse/symbols.pyx
file; this has also been mentioned in #117. -
Parameter related objects (
Parameter
,GeometricParameter
,ParameterRef
,_parameter
) should be moved to a newfinesse/parameter.pyx
file.
-
This file should probably only contain the
-
(Unsure on this one)
finesse/model.py
is a particularly huge file, but this may be unavoidable anyway due to it inherently being the "main object" through which users would interact with their configuration in an OOP way.