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]:
solutions.display_all()
Element Summary
| element | shape | focal_length | position | clearance_left | clearance_right | dof | sensitivity | grad_focus | grad_waist | sensitivities | couplings | shifting_range | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | f=125mm (stage) | | | 125 mm | 280 mm | 180 mm | 20 mm | 0 | 0.75 %/cm² | 0.879 mm/mm | 1.540 μm/mm | [ 0.75, -0.43] %/cm² | [100., -67.] % | ShiftingRange(left=0.1, right=0.3, min_element... |
| 1 | f=100mm | | | 100 mm | 600 mm | 0 mm | 150 mm | 1 | 0.55 %/cm² | 0.364 mm/mm | -1.520 μm/mm | [-0.43, 0.55] %/cm² | [-67., 100.] % | ShiftingRange(left=0.6, right=0.75, min_elemen... |
Element Summary
| element | shape | focal_length | position | clearance_left | clearance_right | dof | sensitivity | grad_focus | grad_waist | sensitivities | couplings | shifting_range | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | f=125mm (stage) | | | 125 mm | 106 mm | 6 mm | 194 mm | 0 | 0.54 %/cm² | 0.878 mm/mm | 1.207 μm/mm | [ 0.54, -0.2 ] %/cm² | [100. , -55.9] % | ShiftingRange(left=0.1, right=0.3, min_element... |
| 1 | f=150mm | | | 150 mm | 505 mm | 155 mm | 45 mm | 1 | 0.23 %/cm² | 0.256 mm/mm | -0.970 μm/mm | [-0.2 , 0.23] %/cm² | [-55.9, 100. ] % | ShiftingRange(left=0.35, right=0.55, min_eleme... |
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.