Closed April-Hannah-Lena closed 1 year ago
boxgraph.jl
is now ready. I can push it, or wait to merge this PR first so that there are less changes all at once.
Awesome, works as expected for me! I vote on favor of the shorter code ... Yes, let's merge this first.
This PR brings a new version of the TransferOperator, based on the SparseMatrixCSC format. It is as fast as the previous version when calculating eigenvalues, and includes new features:
BoxFun
s via multiplicationThe docstring explains hopefully how the TransferOperator works internally:
----------
Discretization of the Perron-Frobenius operator, or transfer operator. Implemented as a sparse matrix with the same linear indices as
support
, e.g. iffor some
partition
andboxmap
, thenFields:
boxmap
:SampledBoxMap
map which relates to the transfers.support
:BoxSet
which contains keys for the already calculated transfers. Effectively, these are row/column pointers, i.e. the first column ofT.mat
contains transfer weights FROM box B_1, where B_1 is the first box ofsupport
.variant_set
:BoxSet
which contains keys for potential boxes lying outside ofsupport
, i.e. it could be thatsupport
is not an invariant set. In this case,variant_set
contains the boxes which were not insupport
, but whose preimage lies insupport
.mat
:SparseMatrixCSC
containing transfer weights. The indexT.mat[i,j]
represents the transfer weight FROM thej
'th box insupport
TO thei
'th box insupport
. Ifsupport
is not invariant, then the matrix will be tall. In this case the rows are counted insupport
and then invariant_set
.It is important to note that
TranferOperator
is only supported over the box setB
, but if one lets aTranferOperator
act on aBoxFun
, then the supportB
is extended "on the fly" to include the support of theBoxFun
.Methods Implemented:
Implementation detail:
The reader may have noticed that the matrix representation depends on the order of boxes in
support
. For this reason anOrderedSet
is used.BoxSet
s using regularSet
s will be copied and converted toOrderedSet
s.----------------
The one consideration to be made is the code complexity for multiplication:
Multiplying the first eigenmeasure of the Lorenz attractor takes ~6ms on average.
The code can be simplified, however:
This version adds roughly one ms to the run time, i.e. multiplication takes ~7ms.
!!! A note on the chain recurrent set: currently it is broken because I am setting up
boxgraph.jl
. The code is already there, I first wrote it months ago. But I'm currently adapting it to the new TransferOperator version. This shouldn't take nearly as long as the TransferOperator update, since I don't really have to come up with anything new for this one :)