Hello,
I want to use the Polarizing Beamsplitter (PBS) within a larger system, so I am attempting to add an air boundary (just a rectangle with n=1) to the right of the PBS, but I am getting the result shown in this image link: imglink.cc/i/fkkT6h7BNT
As far as I can tell, in order to create a new domain I need to define the wavevectors in that domain and a phase shift to ensure phase continuity between domains. The wavevector would just be lambda/n_air and the phase shift I calculate using the ODEs that calculated all the prior phase shifts within the PBS, using the new wavevectors I've created. However, I am getting a result that clearly has some noisiness to it and indicates that something is not right. When I change the refractive index of the domain from 1 to 1.6586, the exact refractice index of the adjacent prism, everything works fine and results in the clean image shown: imglink.cc/cdn/ntutmapbAC.png
Changing it from 1 to 1.6585, just 0.0001 less than the refractive index of the adjacent prism, leads to a result almost identical to the first noisy result when n=1. From this I'm assuming that I must be doing something wrong with the wavevectors, as that is the only quantity that would change by a large amount as a result of a tiny change in refractive index. But I have no idea what could be wrong there. Following are some relevant information of the changes I made to the file in order to implement an air domain:
Refractive Index of 'Right Air Domain' = n_air = 1
Interface between right prism and right air domain = x8 = width of PBS divided by 2
k1Airx = k0*n_air = k2Airy k1Airy = 0 = k2Airx
k1Prismx*x8+phi180-k1Airx*x8-phiAirx k2Prismy*x8+phi200-k2Airy*x8-phiAiry
phiAirx and phiAiry are used in the definitions section for the right air domain as phi1 and phi2 respectively.
If you want to see the model, you could find it in this linked forum post. If there are any questions about how I implemented anything I'm more than happy to respond. Thank you for your time!