MCFlowMace / CRESana

Analytic CRES signal modeling
2 stars 1 forks source link

Improve performance of MultiCoilField.evaluate_B #11

Open renereimann opened 10 months ago

renereimann commented 10 months ago

The evaluate_B of the MultiCoilField class as defined in here https://github.com/MCFlowMace/CRESana/blob/develop/cresana/bfield.py#L397 is implemented as a for loop over all individual coils. The coil class implements the general field solution for a single coil. Outside of CRESana, I implemented the same evaluation but using the numpy capabilities to calculate the fields of all coils in higher dimensional arrays. This speeds up the overall calculation of evaluate_B by a big factor. This makes the Coil class basically obsolate.

renereimann commented 8 months ago

I test implemented this but I did not get better performance.

renereimann commented 8 months ago

Here is the branch that implements this idea https://github.com/MCFlowMace/CRESana/tree/feature/fast_multicoil_field In my tests this implementation is slower then the original code. I do not understand why.