Nested Mach–Zehnder interferometer optical switch with phase generating couplers