-
|
Hello, Thank you for sharing your code. It is very useful and I am going to cite it once I am done with my paper(s). I use your code to solve MMGNLSE for a birefringent fiber and I have a question. Namely, If I understand correctly, when considering birefringence and coupling between different spacial modes, your polarization code (sim.scalar=false) does not longer give correct results and cannot be used to calculate SK. For that reason, I run scalar simulations and provide a separate SK tensor for calSRSK.m file along with the SR tensor (this is since SK =/= SR). Further, for sanity check, I compare calculations done on GPU and CPU but I get different results. Since I save the SK/SR used in the computation, the clear difference between the GPU/CPU calculations is the number of SK/SR elements. I think it is linked to the summation S13 (from the supplementary materials). Is the summation S13 rigorous, or is it some sort of a physical approximation? As far as I understood, it is only used for the GPU computations, right? Thanks in advance and best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 30 replies
-
|
Hi, first thanks for using my code. There was a bug in multimode polarization computation, but I fixed it last year. If you run into this problem, please re-download the code. I'm afraid you're using the old version. It can run correctly now. I've checked very carefully the new code last year, so I think the current one should solve the polarization mode correctly. Could you please confirm with me that you're using the latest code? If you're using the latest code, then please send me the script. I can test it myself for you. About the old polarization bug, the problem lies in cuda's summation. I forgot to put int(midx & 1) in if-else statements, and the wrong "if (midx & 1)" makes no sense since "midx & 1" is a binary number. I added int(....) to fix it. Since the old bug lied in cuda, the CPU computation should always be the correct one. (It should be......I cannot check it now; everything is updated to the new correct one.) |
Beta Was this translation helpful? Give feedback.
-
|
I am thinking about your statement: My code should be able to solve multimode polarization cases, so I don't understand your statements. The calculation of SK values is independent of birefringence since they're overlap integrals, only related to functions of x and y. Due to your inconsistency between CPU and GPU results, as I mentioned previously, I kinda, or strongly, speculate that you might be using my old-version buggy code. |
Beta Was this translation helpful? Give feedback.
-
|
Hello, Thank you for your swift reply. Indeed, I have been using the old version of the code, which I downloaded just before the update. I am now running a couple of tests to check if the problem is gone. I will let you know asap. Best regards, |
Beta Was this translation helpful? Give feedback.
-
I understood the [mode1+ mode1_ mode 2+ mode2_...] arrangement. I was referring to which modes serve as the input when |
Beta Was this translation helpful? Give feedback.
I think you also need to modify my cuda to change the number of input arguments.
Not really; that's just the paper discussing what MPA is. You need our old-version code. See my introduction of this package in the first page of Github. If I were you who needs a huge change of cod…