1. 27 Dec, 2020 1 commit
  2. 23 Dec, 2020 1 commit
    • Daniel Brown's avatar
      A mix of changes that started whilst trying to fix issue #151, but then wanted... · d48aba1f
      Daniel Brown authored
      A mix of changes that started whilst trying to fix issue #151, but then wanted to tidy various parts of the code up.
      
      - Removed connections_type for Connector constructor. No other code uses it and it means the general component constructor needs to have some knowledge of the type of connections that will exist before anything is constructed, which doesn't make sense.
      
      - Removing all the type checking/specific code for knm methods. These are just now in the KnmConnectorWorkspace class. We shouldn't need to hard code specfic components into the BaseSimulation logic.
      d48aba1f
  3. 01 Nov, 2020 1 commit
    • Samuel Rowlinson's avatar
      Cleaning up some scattering matrix allocation code · 9319cce0
      Samuel Rowlinson authored
      Removed knm_matrices dicts from Mirror and Beamsplitter Workspace objects, these
      are not used anymore (a legacy from an earlier version of the code).
      
      Added some notes in the above Workspace pxd files about storing KnmMatrix objects
      for separate scattering matrices (i.e. map, aperture Knm matrices) in the near
      future.
      
      Only allocating new memory for scattering matrices when the simulation object
      is non-audio (i.e. carrier sim). If the carrier is audio (i.e. signal), then
      the scattering matrices of each workspace will be set to the corresponding
      DC workspace matrices in the _get_workspace method of the relevant connector.
      
      Also now pointing audio simulation `trace` data to the carrier sim `trace` array,
      ensuring correct beam parameters are obtained from audio simulation workspaces
      if accessed.
      9319cce0
  4. 25 Oct, 2020 1 commit
    • Samuel Rowlinson's avatar
      Improving storage of changing ABCD expressions in workspaces, fixing final known cy_expr bugs · d9411b07
      Samuel Rowlinson authored
      Now storing changing ABCD element expressions in relevant workspaces based on apriori
      knowledge. For example, we know that only the C element of Mirror ABCD matrices can
      change so only the C element changing expressions are stored and updated (if they
      are indeed changing).
      
      Cleaned up the way ABCD matrices get stored in the components themselves. Now only keeping
      a single reference to each numpy array where relevant - e.g. Lens now stores just has
      directions as keys in its _abcd_matrices dict as both forward & backward propagations
      give the same matrix. This just makes dealing with this stuff easier in the C code when
      considering views and pointers to each matrix.
      d9411b07
  5. 23 Oct, 2020 1 commit
    • Samuel Rowlinson's avatar
      Using cy_expr for fast evaluation of changing symbolic ABCD matrix elements · 96392eaf
      Samuel Rowlinson authored
      Each relevant ConnectorWorkspace now stores an array of pointers to cy_expr
      containing the changing symbolic ABCD matrix elements (NULL if not changing).
      These are evaluated (with direct pointer access) during the update_parameter_values
      routine of each of these workspaces.
      
      This optimisation also allows for a cleaner API for ABCD methods of components,
      removing the _sim_cache argument and now just storing the full symbolic and
      corresponding numeric matrix in _abcd_matrices dict rather than a bunch of simulation
      stuff that needed to be reset / cleared on simulation completion. The method for
      updating ABCD matrices outside of simulations remains the same.
      
      Also fixed a bug in cy_expr_init which resulted in inconsistency between changing
      parameter target pointers used due to an incorrect method for finding the index.
      96392eaf
  6. 20 Oct, 2020 1 commit
    • Samuel Rowlinson's avatar
      Refactoring components/matrixfill extension code into separate, sensible locations · 4913e79e
      Samuel Rowlinson authored
      As noted in the Alpha 1 milestone, the matrixfill extension was bloated with code
      from several iterations of development. This has now been refactored into relevant
      component and detector workspace extensions, with the ElementWorkspace and BaseCValues
      structures now sitting in finesse.element. The matrixfill extension has been removed
      now that its code has been distributed to better locations.
      4913e79e
  7. 01 Jul, 2020 1 commit
  8. 01 Jun, 2020 1 commit
  9. 31 May, 2020 1 commit
  10. 21 May, 2020 1 commit
    • Samuel Rowlinson's avatar
      Re-factor finesse.cmath extension into finesse.cymath extensions, improved... · 173918c3
      Samuel Rowlinson authored
      Re-factor finesse.cmath extension into finesse.cymath extensions, improved KnmWorkspace cpow caching
      
      The finesse.cmath Cython extension has been completely re-factored into several different
      files (according to category of equations) in a new `finesse.cymath` sub-module (no name
      conflict with Python `cmath` module now if doing relative imports).
      
      Caching of X, XS, F, FS parameter complex powers in KnmWorkspace has been re-worked so that the
      powers needed get computed on initialisation of the workspace. Then they are accessed via a simple
      array index look-up in S_g and S_u functions.
      173918c3
  11. 19 May, 2020 1 commit
    • Samuel Rowlinson's avatar
      Switched last remaining mode scattering component (isolator) over to new knm... · 28c4ddf3
      Samuel Rowlinson authored
      Switched last remaining mode scattering component (isolator) over to new knm computing pattern, minor bug fixes
      
      All components (Mirror, Beamsplitter, Lens, Modulator, Isolator) now use the new scattering matrix
      Cythonised pattern. Isolator knm code was all commented out Python code before this commit, it has
      now been converted to using the same Cython code style for these calculations as the above objects.
      
      Removed the Is attributes from the above object workspaces as it is no longer required.
      
      Fixed an incorrect beam parameter being used in the Modulator update_changing_knm_workspaces function.
      28c4ddf3
  12. 15 May, 2020 2 commits
    • Samuel Rowlinson's avatar
      Reduced Python interaction in any knm related code to essentially zero · 6f12580d
      Samuel Rowlinson authored
      KnmWorkspace was changed from a cdef class into a C struct to avoid any
      Python reference counting. This has reduced Python interaction in the
      various components.modal extension knm related functions to basically zero.
      
      Implemented proper handling of total reflection couplings at beam splitters,
      the initial knm matrix data for these couplings gets zeroed straight away and
      then never touched again for the rest of the simulation.
      
      Changed Knm_loss attributes of MirrorWorkspace, BeamsplitterWorkspace to
      1D memoryviews.
      6f12580d
    • Samuel Rowlinson's avatar
      Implemented update knm workspace functions · 045d5e0f
      Samuel Rowlinson authored
      This commit also re-implements support for changing misalignment angles
      (xbeta, ybeta) at surfaces via the is_alignment_changing flag of KnmWorkspace.
      
      KnmWorkspace instances get updated efficiently where only the misalignment
      parameters will get re-computed if only a misalignment is changing.
      045d5e0f
  13. 13 May, 2020 2 commits
    • Samuel Rowlinson's avatar
      Moving Space.set_gouy_phase to Cython, other modal simulation updates · fe1c1b0e
      Samuel Rowlinson authored
      Further optimisations to the modal update stack, removing nearly all
      Python interactions now. Still need to Cythonise laser power coeff
      gouy phase updating.
      
      Implementing flag_knm_workspace_changing functions to set the scattering
      matrices which should be re-computed during the simulation. Currently just
      setting all is_changing flags to false until determine_changing_beam_params
      is implemented properly.
      
      Removed seemingly unnecessary extra Model.built call in actions.XNaxis.do which
      was duplicating simulation initialisations.
      fe1c1b0e
    • Samuel Rowlinson's avatar
      Significant re-factoring of scattering matrix code (WIP) · 37d28645
      Samuel Rowlinson authored
      Moved all knm matrix related code to Cython with v. little Python interaction.
      
      Added a `trace` array to `BaseSimulation` which stores the beam parameters at nodes
      for fast C access.
      
      Still very much WIP so best not to try running any HOM models here yet.
      37d28645
  14. 12 May, 2020 1 commit
    • Samuel Rowlinson's avatar
      Re-factoring how ABCD matrices are stored · 1d6f8352
      Samuel Rowlinson authored
      The `Connector._abcd_matrices` dict now stores tuples of M_symbolic and M_numeric
      matrices as values. M_symbolic is created on construction of the component (or
      on connection in the case of Spaces) whilst M_numeric is computed from M_symbolic
      also as construction time as well as whenever a dependent parameter changes.
      
      Each of the relevant connector workspaces now store memoryviews on the numeric
      ABCD matrices - initialised in the `_get_workspace` method of each Connector.
      1d6f8352
  15. 11 May, 2020 1 commit