Fix a critical bug in scuff-tmatrix (undesired VSWF scaling)#197
Fix a critical bug in scuff-tmatrix (undesired VSWF scaling)#197texnokrates wants to merge 8 commits intoHomerReid:masterfrom
Conversation
…ling. All scuff-tmatrix output created before this commit is WRONG (possibly except for unit sphere).
|
Thanks for taking the time to investigate this and especially for contributing a fix! That is a very meticulous and impressive piece of detective work. As you say, I had only ever computed T-matrix elements of spheres, so I would never have caught this. Actually I had not envisioned doing much testing of this feature in general, because I had mostly convinced myself that computing T-matrix elements for non-spherical bodies was not a particularly useful thing to do in SCUFF-EM and that this capability would not attract much interest among users---something I obviously got wrong! I have been totally overwhelmed by a separate project that has unfortunately forced a total hiatus of work on SCUFF-EM for the past several months, but finally the week after next I will be back to pick up where I had trailed off midstream on the tasks of implementing a full-featured python interface and modernizing the unit-test suite. I will write a test that exercises your bugfix and confirm that it fails/passes before/after I merge your PR. I will also be soliciting input from users on what they are doing or would like to be doing with SCUFF, and hope to hear about the goals of your T_matrix studies. Thanks again for devoting so much time and effort to identifying and fixing this issue. |
|
I'd be very keen to see this PR merged into the main branch; we've developed a superposition T-matrix code for multiple-scattering calculations and besides our built-in spheres and spheroids it'd be quite nice to be able to import T-matrices from arbitrary particle shapes as input. |
|
Note that I've merged this into my unofficial fork at https://github.com/NanoComp/scuff-em/ in NanoComp@cee20ad |
|
@stevengj Thanks! Incidentally, you may be aware of this recent initiative to standardise T-matrix storage for sharing and reuse ("T-matrix representation of optical scattering response: Suggestion for a data format" www.sciencedirect.com/science/article/pii/S0022407324004175). A follow-up paper is in the works comparing different methods on model systems. |
|
Yes, I've been chatting with Carsten Rockstuhl about their efforts. |
Hi Homer,
with scuff-tmatrix, I struggled with inconsistent results while rescaling particle dimensions, as I mentioned in #141. After some lengthy debugging and learning a lot about the internals, I found that the problem was apparently in a forgotten (and effectively swapped) argument in a GetVSWRadialFunctions() call from GetWaveMatrix(). This resulted into a crippled "reference" spherical wave (the one from the scalar product with the surface currents in eq. (52) of your scuffSpherical memo).
All scuff-tmatrix output before this fix is most likely wrong, unfortunately except for unit spheres, which is probably why you didn't notice the problem earlier, benchmarking only against unit sphere Mie-Lorentz solution.
Some little code cleansing and const hygiene done along the way is also included in the PR.
Best regards,
Marek