addition of vector_paraxial_mask_XY

Issue #19 new
Former user created an issue

Hello,

I am working with the .vector_paraxial_XY module, particularly with the generation of masks. I saw that diffractio allows to add, within the same space, different masks if those are scalar masks. However I would like to join 2 or more vectorial masks. For instance, to build an optical element that has a half waveplate on the 1st half of the object and a quarter-wave plate on the 2nd half.

I tried to sum the masks as:

x = np.linspace(-limit, limit, num_pix) 
y = np.linspace(-limit, limit, num_pix) 

X1=x[:num_pix] 
Y1=y[:num_pix//2] 
X2=x[:num_pix] 
Y2=y[num_pix//2:] 

mask1 = Vector_paraxial_mask_XY(X1, Y1, wavelength=wavelength)
mask1.half_waveplate(azimuth=3*np.pi/4)

mask2 = Vector_paraxial_mask_XY(X2, Y2, wavelength=wavelength)
mask2.half_waveplate(azimuth=0)

total = mask1 + mask2

But this is not working:

AttributeError: 'Vector_paraxial_mask_XY' object has no attribute 'Ex'

How can I add paraxial masks? Or this operation isn't allowed? Is there a way to convert paraxial masks into scalar, sum them, and return into vectorial mode?

Thank you in advance.

Comments (2)

  1. LUIS MIGUEL SANCHEZ BREA repo owner

    Hello.

    I did not implemented sum in vector masks as normally light passes through several masks squentially, that is, multiplication is used. You can see at: https://diffractio.readthedocs.io/en/latest/source/tutorial/vector_paraxial_XY/tutorial_vector_XY.html

    Do you need something like:

    @vector paraxial masks XY.m

    def add(self, other, kind='standard'):

    if other._type in ('Vector_paraxial_mask_XY'):

    m3 = Vector_paraxial_mask_XY(self.x, self.y, self.wavelength)

    m3.M00 = other.M00 + self.M00

    m3.M01 = other.M01 + self.M01

    m3.M10 = other.M10 + self.M10

    m3.M11 = other.M11 + self.M11

    ?

  2. Carla

    Hi Luis Miguel,

    more in particular, I would like to generate a kind of polarization converter, so that different waveplates are placed in different spatial locations of the beam. I already have the spatial separation. However, I can not join them back. Would that be possible? Is there a way to do so, maybe with py_pol or something?

    Thank u in advance.

  3. Log in to comment