How to Sum POP Beams Coherently


This article explains how to sum two physical optics propagation results using *.ZBF beamfile-related macro keywords.

Authored By: Nam-Hyong Kim

Introduction

Updated Oct 2010

Zemax has powerful physical optics capabilities, and also powerful capabilities for post-processing physical optics data.

The Physical Optics Propagation Analysis can save the result at any surface in the <data>/POP/BEAMFILES directory as a *.ZBF beam file (where the <data> folder is listed under the File...Preferences menu in Zemax). Zemax offers ZBFSUM ZPL macro keyword that can coherently or incoherently sum any two beam files. In addition to ZBFSUM, there are other ZBF related keywords. These are:

ZBFCLR
: Clears the complex amplitude data in a ZBF file.
ZBFMULT: Multiplies the complex amplitude data in a ZBF file by a complex factor.
ZBFPROPERTIES: Opens the specified ZBF file and places various data about the beam in a vector variable.
ZBFRESAMPLE: Resamples a ZBF file to a new width and point spacing.
ZBFSHOW: Displays a ZBF file in a viewer window.
ZBFSUM: Sums either coherently or incoherently the data in two ZBF files and places the resulting data in a third ZBF file.
ZBFTILT: Multiplies the data in a ZBF file by a complex phase factor to introduce phase tilt to the beam.

This example will shows you how to use some of these keywords to coherently sum two  beams.

Open the attached ZIP archive and place the ZBFSUM DEMO.ZPL file in the <data>/MACROS directory. Open the ZBFSUM demo.zmx lens file and execute the macro, and you should see the following animation:



The Beam File Viewer shows the coherent sum of two identical Gaussian beams with some phase tilt between the two.

Open the macro file with any ASCII text editor.



Using ZBF related keywords

Path$=$DATAPATH()+"\POP\BEAMFILES\"

file1$="ZBFSUM_demo1.ZBF"
file2$="ZBFSUM_demo2.ZBF"
file3$="ZBFSUM_demo_result.zbf"
file1_full_path$=path$ + file1$
file2_full_path$=path$ + file2$

! Run POP and save the beam file at surface 3 as
! ZBFSUM_demo1.zbf
POP file1$, 3

! Create a copy of ZBFSUM_demo1.zbf file named
! ZBFSUM_demo2.zbf
COPYFILE file1_full_path$, file2_full_path$

! Tilt the phase of the ZBFSUM_demo1.zbf
ZBFTILT file1$, 0,0, 0, 30

! Decenter the beams so that they are completly separated
! initially

! Decenter the ZBFSUM_demo2.zbf beam in -Y direction
ZBFRESAMPLE file2$, 128,128, 1.5040, 1.5040, 0, -0.36
! Decenter the ZBFSUM_demo1.zbf beam in +Y direction
ZBFRESAMPLE file1$, 128,128, 1.5040, 1.5040, 0, 0.36

FOR i, 0, 41, 1

! Incrementally move the ZBFSUM_demo2.zbf beam towards
! +Y direction
ZBFRESAMPLE file2$, 128,128, 1.5040, 1.5040, 0, 0.018
! Incrementally move the ZBFSUM_demo1.zbf beam towards
! -Y direction
ZBFRESAMPLE file1$, 128,128, 1.5040, 1.5040, 0, -0.018

 ! Coherently sum the two beam and save the result as
! ZBFSUM_demo_result.zbf
ZBFSUM 1 file1$ file2$ file3$
! Update the Beam File Viewer window
UPDATE 1      

! WAIT some time before decentering again
PAUSE TIME, 50

NEXT i

PRINT "done"
END

If the beam files are not located in the path specified in line #1 of the macro, this line should be modified accordingly.

Line #11 of the macro computes the POP beam at surface 3 (using the POP keyword) and saves the file in the BEAMFILES folder as ZBFSUM_demo1.zbf.

This is how the ZBFSUM_demo1.zbf files looks after line #11:



After line #18, there will be two beam files created by the macro in the BEAMFILE folder. The phase of the ZBFSUM_demo1.zbf beam will be tilted by some small amount with respect to the phase of the ZBFSUM_demo2.zbf beam (using the ZBFTILT keyword).

Lines #24 and #26 introduce the initial Y decenter to the each of the beams so that when the two beams are coherently added for the first time they are completely separated. The Y decenter is achieved by specifying the decenter amount when re-sampling (using the ZBFRESAMPLE keyword):

 
ZBFSUM_demo1.zbf

 
ZBFSUM_demo2.zbf


Inside the FOR loop, the beam files are coherently (line #39: ZBFSUM, flag 1) added after they are shifted incrementally toward opposite directions. The result is saved in the ZBFSUM_demo_results.zbf file.

The line #41 updates the opened Beam File Viewer window (window #1) showing the ZBFSUM_demo_result.zbf file.

Here is how the ZBFSUM_demo_results.zbf file looks like after the 20th iteration, out of the total 41, of the FOR loop.





The line #44 implements a pause (using the PAUSE keyword) before executing the next iteration in the FOR loop, because the macro executes so quickly that a delay is necessary to let the window update.



Summary and References
This article has demonstrated how to coherently add 2 physical optics beams. In summary:
  • The physical optics propagation results can be coherently or incoherently added using the ZBFSUM macro keyword
  • There are additional beam file related macro keywords that can tilt the phase, decenter the beam, multiply the beam by a complex amplitude and perform other operations on the beam file




Attachments





© All Rights Reserved.