Returns the evolution operator B of the fiber.
The diagonal of the evolution operator correspond to the propagation constants.
The off-diagonal terms account for the mode coupling.
The transmission matrix of the fiber reads exp(iBL) with L the propagation distance.
For a straight fiber, B is a diagonal matrix.
One can add the effect of curvature to a system solved for a straight fiber.
It returns then the evolution operator in the basis of the straight fiber modes.
The calculation is different from directly solving the system for a bent fiber [1][2].
Returns the matrix containing the mode profiles.
Note that while you can set two polarizations, the modes profiles are obtained under a scalar apporoximation.
Parameters:
npolaint
Number of polarizations considered. For npola = 2, the mode matrix will be a block diagonal matrix.
shiftlist or None
(slow) Value of a coordinate offset, allows to return the mode matrix for a fiber with the center shifted with regard
to the center of the observation window. Defaults to None.
anglefloat or None
(slow) Angle in radians, allows to rotate the mode matrix with an arbitrary angle.
Note that the rotation is applied BEFORE the transverse shift. Defaults to None.
Returns:
Mnumpy.ndarray
The matrix representing the basis of the propagating modes.
Generates a mask for near-degenerate modes based on a given tolerance value
in term of propagation constant expressed in 1/micrometer unit.
It first identifies groups of near-degenerate modes using the getNearDegenerate method.
Then, it creates a square matrix of size nmodes x nmodes, where nmodes is the number of modes.
The elements of the matrix are initialized to zero.
For each group of near-degenerate modes, the corresponding submatrix in the mask is set to one.
The resulting mask is returned as a complex-valued ndarray.
Returns the transmission matrix T for a given fiber length in the basis of the fiber modes.
Note that while you can set two polarizations, the modes profiles are obtained under a scalar apporoximation.
For a straight fiber, T is a diagonal matrix.
One can add the effect of curvature to a system solved for a straight fiber.
It returns then the evolution operator in the basis of the straight fiber modes.
The calculation is different from directly solving the system for a bent fiber [3].
If B is the evolution operator of the fiber,
the transmission matrix (in the mode basis) T for a fiber length l
is computed using::
T = np.exp(1j * B * l)
Parameters:
distancefloat
Size of the fiber segment (in microns).
npolaint
Number of polarizations considered. For npola = 2, the mode matrix will be a block diagonal matrix.
Sorts the modes based on the provided function fn.
If none provided, sort by the values of self.betas in descending order.
Rearranges the elements of self.betas and other associated lists
(such as self.u, self.w, self.m, self.l, self.profiles, self.modesList, and self.data)
based on the sorted order of self.betas in descending order.
Data is sorted in place.
Parameters:
fnfunction or None, optional
The function used to sort the modes. Default is None.
Returns:
idx: list
The indices of the sorted modes, in case the user wants to keep track of the sorting order.
Examples
>>> # sort the modes based on the imaginary part of the propagation constant>>> modes.sort()
>>> # sort the modes by inscreasing order of m, and for the same m, by increasing order of l>>> idx=modes.sort(lambdax:x.m+np.sign(x.m)*1e-2*x.l)