ZEMAX Users' Knowledge Base - http://www.zemax.com/kb
How to Sum POP Beams Coherently
http://www.zemax.com/kb/articles/64/1/How-to-Sum-POP-Beams-Coherently/Page1.html
By Nam-Hyong Kim
Published on 14 October 2005
 

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

This article is also available in Japanese.


Introduction

This article is also available in Japanese.

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 {root}ZEMAX/POP/BEAMFILES directory as a *.ZBF beam file. 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 {root}ZEMAX/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. This macro assumes that you have installed ZEMAX in  C:Program Files/ZEMAX directory, if not, you need to modify the path specified in the macro.

Open the macro file with any ASCII text editor.


Using ZBF related keywords



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

Line #11 of the macro computes the POP beam at surface 3 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 #17, 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.

Lines #23 and #25 introduces 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.

 
ZBFSUM_demo1.zbf

 
ZBFSUM_demo2.zbf



Inside the FOR loop, the beam files are coherently (line #36 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 #38 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#42 and #43 implements a pause 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