LinearOpticalSetup
svetlanna.LinearOpticalSetup
LinearOpticalSetup(elements: Iterable[Element])
Bases: Module
Linear optical network composed of Element instances.
It works the same way as a torch.nn.Sequential module, but with some additional features.
Parameters:
-
elements(Iterable[Element]) –Optical elements that make up the setup. Elements are evaluated in the provided order.
Examples:
reverse
Reverse propagation through the setup.
All elements in the setup must have a reverse method. If any element
lacks this method, a TypeError is raised.
Parameters:
-
Ein(Tensor) –Input wavefront to reverse propagate.
Returns:
-
Tensor–Output wavefront after reverse propagation.
Raises:
-
TypeError–If reverse propagation is not supported by all elements in the setup.