Question about the "Fifteen Periodic Spheres in Slab" Exemple in Benchmarks

51 views
Skip to first unread message

Jialin HU

unread,
Dec 3, 2024, 9:14:46 AM12/3/24
to Smuthi
Dear all,
I have recently been working with the "Fifteen Periodic Spheres in Slab" example in Benchmarks. During my experiments, I modified the wavelength parameter to 350, 380, and 400 nm and ran the calculations. No other adjustments were made aside from changing the wavelength.

The results are shown in the attached image. For all three wavelengths, there are portions of the transmittance values exceeding 1.

Do you have any insights into what might be causing this issue?

I would greatly appreciate your guidance and look forward to your reply.

Best regards,

Jialin 

Figure exemple 400nm.png
Figure exemple 380nm.png
Figure exemple 350nm.png

Dominik Theobald

unread,
Dec 6, 2024, 8:20:46 AM12/6/24
to jiali...@gmail.com, smu...@googlegroups.com
Hey Jianlin, 

indeed such transmittance values above 1 indicate that something goes wrong here. 
Unfortunately, in the Ewald summation a few things can go wrong and it is a bit tricky to find out what it is in this case. 
 
But let me give you some hints how you can try to resolve it:
By lowering the wavelength you change the relative size between the wavelength of light and the periodicity. Hereby, two things happen.
  • First, the number of resonance increases that you can invoke by the initial field. These resonaces occure when the linear combination of the reciprocal lattice vector and excitation's in-plane wavevector coincide with the wavenumber. Hereby, you hit a sigularity in the Ewald lattice sum, which will cause very strong coupling in-between particles. But this should not lead to non-physical transmittance values.
  • Secondly, you get into the "high frequency regime" where the numerical implementation of the incomplete Gamma function can become unstable. I suspect that this is here the case. You can work around this by changing the "ewald_sum_separation_parameter" in Smuthi. Hereby, the rate at which the Ewald sum converges will be lower, but the numerical overflow in the incomplete Gamma function can be prevented. 
For a more precise desicption you can have a look into section 6.8 and 6.9 of my PhD thesis: https://publikationen.bibliothek.kit.edu/1000141626 
 
 
I have just tried your example of an excitation at 400nm and modified line 87 in the script with (section 6.9 in my thesis)
 
pb.default_Ewald_sum_separation = pb.set_ewald_sum_separation(a1, a2,
                                                                  initial_field=initial_field,
                                                                  particle_list=particle_list,
                                                                  layer_system=layer_system,
                                                                  magM=np.exp(1))
 
In the results I obtain, all unphysical quantites vanish. Unfortunately, I have no real guideline in which cases it is necessary to change this "ewald_sum_separation_parameter". For now this needs to be tested by the user. 
 
I hope this helps. 

Best
Dominik
 
 
Gesendet: Dienstag, 3. Dezember 2024 um 15:14
Von: "Jialin HU" <jiali...@gmail.com>
Betreff: [Smuthi] Question about the "Fifteen Periodic Spheres in Slab" Exemple in Benchmarks
--
Smuthi project repository: https://gitlab.com/AmosEgel/smuthi
Online documentation https://smuthi.readthedocs.io/en/latest/
---
You received this message because you are subscribed to the Google Groups "Smuthi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smuthi+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smuthi/fa33102f-a727-4773-bf1d-b61ac1d6a393n%40googlegroups.com.

Dominik Theobald

unread,
Dec 6, 2024, 8:20:58 AM12/6/24
to smu...@googlegroups.com



Gesendet: Dienstag, 3. Dezember 2024 um 17:40
Von: "Dominik Theobald" <dominik....@web.de>
Betreff: Aw: [Smuthi] Question about the "Fifteen Periodic Spheres in Slab" Exemple in Benchmarks
Hey Jianlin, 

indeed such transmittance values above 1 indicate that something goes wrong here. 
Unfortunately, in the Ewald summation a few things can go wrong and it is a bit tricky to find out what it is in this case. 
 
But let me give you some hints how you can try to resolve it:
By lowering the wavelength you change the relative size between the wavelength of light and the periodicity. Hereby, two things happen.
  • First, the number of resonance increases that you can invoke by the initial field. These resonaces occure when the linear combination of the reciprocal lattice vector and excitation's in-plane wavevector coincide with the wavenumber. Hereby, you hit a sigularity in the Ewald lattice sum, which will cause very strong coupling in-between particles. But this should not lead to non-physical transmittance values.
  • Secondly, you get into the "high frequency regime" where the numerical implementation of the incomplete Gamma function can become unstable. I suspect that this is here the case. You can work around this by changing the "ewald_sum_separation_parameter" in Smuthi. Hereby, the rate at which the Ewald sum converges will be lower, but the numerical overflow in the incomplete Gamma function can be prevented. 
For a more precise desicption you can have a look into section 6.8 and 6.9 of my PhD thesis: https://publikationen.bibliothek.kit.edu/1000141626 
 
 
I have just tried your example of an excitation at 400nm and modified line 87 in the script with (section 6.9 in my thesis)
 
pb.default_Ewald_sum_separation = pb.set_ewald_sum_separation(a1, a2,
                                                                  initial_field=initial_field,
                                                                  particle_list=particle_list,
                                                                  layer_system=layer_system,
                                                                  magM=np.exp(1))
 
In the results I obtain, all unphysical quantites vanish. Unfortunately, I have no real guideline in which cases it is necessary to change this "ewald_sum_separation_parameter". For now this needs to be tested by the user. 
 
I hope this helps. 

Best
Dominik
 
 
Gesendet: Dienstag, 3. Dezember 2024 um 15:14
Von: "Jialin HU" <jiali...@gmail.com>
Betreff: [Smuthi] Question about the "Fifteen Periodic Spheres in Slab" Exemple in Benchmarks
--

Tanay Paul

unread,
Dec 9, 2024, 3:20:36 PM12/9/24
to Smuthi
Hi!

I apologise for entering into this conversation, but I found this thread very helpful for me. I want to thank Jialin for asking the question in the community and Dominic for his detailed answer. I also came across a similar issue of getting spikes for Reflectance at certain high-frequency regions while simulating a particular system of interest. After implementing what Dominic suggested as a solution to the problem Jialin referred to, I got a spectrum with no spike or any unphysical value. I understand the reason for this is the numerical instability in calculating the improper Gamma function, as Dominic pointed out. Many thanks to both of you again. 

However, I still am having another issue while simulating the same system. For a certain wavelength range, the spectrum (as a function of wavelength with normal incidence) is full of noise, which I suspect is because of the first point Dominic mentioned. The solution to this could be obtained by fixing the periodicity-to-wavelength ratio, as suggested in Dominic's thesis and the paper "D. Theobald, D. Beutel, L. Borgmann et al., J. Quant. Spectrosc. Radiat. Transf. 272, 107802 (2021)". Please let me know if I need to vary the periodicity with wavelength by maintaining a constant ratio manually to implement this or if it is possible to do it directly by using any SMUTHI function. If I need to vary the periodicity manually, does that mean I need to take a few particles out (or add a few) for each wavelength in order to vary the box dimension, as essentially the whole particle box is the unit cell in this case?

Additionally, could you please provide me with the link to the online documentation for the periodic-boundary-enabled SMUTHI if it is available?

Best regards,
Tanay.

Dominik Theobald

unread,
Dec 10, 2024, 5:43:17 AM12/10/24
to tanayp...@gmail.com, smu...@googlegroups.com
Hey Tanay,

good to hear that my previous comment on the upper incomplete gamma function worked out for you. 
 
Regarding your questions on wavelength sweeps: 
  • Indeed if you excite a periodic particle arrangement by varying wavelengths, you will excite lattice resonances that affect the particle coupling. As a result you observe spikes in the transmission or reflection spectrum. By avergaing the simulation results over multiple particle arrangements, one will not get rid of such spikes, since the lattice resonances occure independent of the particle arrangement. 
    As described in the paper you mentioned, one can avoid lattice resonances by fixing the wavelength-period-ratio. In practise, this means that one has to alter the model from simulation to simulation, which is rather uncommon in a parameter sweep. Yet, I believe this is a good solution for disordered particle arrangements, where the acutal particle positions play a minor role.
  •  In Smuthi, no automatic function is available that alters the simulation domain for you. I think there is no objectively correct way how to do it. I decided to do it the following way: (1) generate the largest periodic ensemble of interest (for the largest wavelength you want to consider), (2) depending on the wavelength, select a fraction of this volume. Step 2 might change the particle filling fraction that you target. Therefore, (3) get rid or add some particles until the desired filling fraction is reached. I decided to remove particles at the boundry. If you do it this way, it is hard to avoid small variations in the particle filling fraction.
    If one is interested in disordered arrangements, an alternative could be to generate different particle arrangements for each simulation, as one has to average over multiple arrangements anyways. 
  • Besides comments in the source code, the paper you mentioned and my PhD thesis, there is no online documentation available for the periodic particle package. 
 
Best
Dominik
 
 
 
Gesendet: Montag, 9. Dezember 2024 um 21:20
Von: "Tanay Paul" <tanayp...@gmail.com>
Betreff: Re: Fw: Aw: [Smuthi] Question about the "Fifteen Periodic Spheres in Slab" Exemple in Benchmarks

Tanay Paul

unread,
Dec 10, 2024, 5:29:43 PM12/10/24
to Smuthi
Thanks, Dominic, for the detailed response.

Best regards,
Tanay.

Jialin HU

unread,
Dec 12, 2024, 10:19:42 AM12/12/24
to Smuthi
Hi Dominik,

First, I would like to apologize for my delayed response. After implementing your suggestions, I obtained a spectrum without any spikes or unphysical values. 
Thank you very much for taking the time to respond to my inquiry and for providing such helpful advice. Your insights have been incredibly valuable in helping me understand the results better and resolve the issue.
Best regards,
Jialin  

Reply all
Reply to author
Forward
0 new messages