Shifting Ranges and Selections

Contents

Shifting Ranges and Selections#

While most mode matching problems only require a single shifting range and a minimal selection of lenses, more complicated setups may require more precise limits on which lenses can be placed where. This is implemented using the ShiftingRange class.

In addition to the required start (left) and end (right) positions along the optical axis, we can also specify the minimum and maximum number of elements, as well as a unique selection of lenses that may be placed within the range. If these parameters are not specified, the lenses will be drawn from the global selection and the number of lenses in the range will only be subject to the global minimum and maximum number of elements specified in the mode_match() call.

Example#

To demonstrate the use of these extra features, we will consider a setup where we already have a lens places on a linear stage that we must be used as part of the mode matching solution. Additionally, there are already some other optics downstream that limit potential lens placements to two other shifting ranges.

[1]:
from corset import Beam, ShiftingRange, ThinLens, mode_match

linear_stage_lens = ThinLens(focal_length=125e-3, name="f=125mm (stage)")
other_lenses = [ThinLens(f) for f in [75e-3, 100e-3, 120e-3, 150e-3]]
ranges = [
    # shifting range to represent linear stage
    ShiftingRange(left=0.1, right=0.3, min_elements=1, max_elements=1, selection=[linear_stage_lens]),
    # shifting range after linear stage
    ShiftingRange(left=0.35, right=0.55),
    # some optics prevent lense placement between 0.50 m and 0.55 m
    ShiftingRange(left=0.6, right=0.75),
]

initial_beam = Beam.from_gauss(focus=0, waist=300e-6, wavelength=1064e-9)
desired_beam = Beam.from_gauss(focus=0.8, waist=150e-6, wavelength=initial_beam.wavelength)

solutions = mode_match(initial_beam, desired_beam, ranges, other_lenses, max_elements=2)
print(f"Found {len(solutions)} solutions")
Found 2 solutions
[2]:
from IPython.display import display

display(*solutions)
../_images/gen_shifting_ranges_and_selections_3_0.png
../_images/gen_shifting_ranges_and_selections_3_1.png

With this configuration, the solver is forced to use the \(100\text{ mm}\) focal length lens, and it can choose whether it wants to place the additional lens in the second or third shifting range.