LASER WITH ELECTRICALLY-CONTROLLED GRATING REFLECTOR

Abstract: One or more lasers are combined with optical energy transfer devices and energy guiding devices which use an electric field for control. The optical energy transfer devices may form grating, mirrors, lenses, and the like using a class of poled structures in solid material (1460). The poled structures may be combined with waveguide structures (1476). Electric fields applied to the poled structures control routing, reflection and refraction of optical energy. Adjustable tunability is obtained by a poled structure (1478, 1480) which produces a spatial gradient in a variable index of refraction along an axis (1489) in the presence of a variable electric field.

Description: LASER WITH EI^CTRICALLY-CONTROLLED GRAΗNG REFLECTOR BACKGROUND OF THE INVENTION This invention relates to lasers in connection with optical devices for controlling optical beams using electric field control. In particular, the invention relates to lasers in connection with devices constructed with poled structures, including periodically poled structures, and electrodes which permit controlled propagation of optical energy in the presence of controlled electric fields applied between electrodes. The invention is especially applicable to the fields of laser control, communications, flat panel displays, scanning devices and recording and reproduction devices. Interactions with energy beams such as optical or acoustic beams can be controlled by means of applied electric fields in electro-optic (EO) or piezoelectric materials. An electrically controlled spatial pattern of beam interaction is desired in a whole class of switched or modulated devices. Patterned responses can be achieved in uniform substrates using the electro-optic or piezoelectric effect by patterning the electric field. However, Maxwell's equations for the electric field prevent sharp field variations from extending over a large range. Some materials can be poled, which means their electro-optical and/or piezoelectric response can be oriented in response to some outside influence. In these materials, is possible to create sharp spatial variations in EO coefficient over potentially large ranges. By combining slowly varying electric fields with sharply varying (poled) material, new types of patterned structures can be fabricated and used.. Polable EO materials have an additional degree of freedom which must be controlled, as compared to fixed EO crystals. Usually, the substrate must be poled into a uniformly aligned state before any macroscopic EO response can be observed. Uniformly poled substrates have been fabricated both from base materials where the molecules initially have no order, and from base materials where the molecules spontaneously align with each other locally, but only within randomly oriented microscopic domains. An example of the first type of material is the nonlinear polymer. Examples of the second type of material are sintered piezoelectric materials such as lead zirconate titanate (PZT), liquid crystals, and crystalline ferroelectric materials such as lithium niobate (LiNb0 3 ). Nonlinear polymer poling is described in ♦ E.Van Tomme, P.P. Van Daele, R.G. Baets, P.E. Lagasse, "Integrated optic devices based on nonlinear optical polymers", IEEE JQE 22 778, 1991. PZT poling is described for example in ♦ U.S. Patent 4,410,823, 10/1983, Miller et al, "Surface acoustic wave device employing reflectors". (Liquid crystal poling is described in standard references, such as S. Chandrasekhar, Liquid Crystals, Second Edition (1992), Cambridge University Press, Cambridge.) Ferroelectric crystal poling is described in ♦ U.S. Patent 5,036,22007/1991, Byer et al., "Nonlinear optical radiation generator and method of controlling regions of ferroelectric polarization domains in solid state bodies". Examples of poled EO devices include: ♦ the beam diffractor in a polymer layer with interdigitated electrodes of S. Ura, R. Ohyama, T. Suhara, and H. Nishihara, "Electro-optic functional waveguide using new polymer p-NAn-PVA for integrated photonic devices," Jpn. J. Appl. Phys., 31, 1378 (1992) [UOS92]; ♦ the beam modulator in a polymer layer with planar electrodes of U.S. Patent 5,157,541 10/1992, Schildkraut et al. "Optical article for reflection modulation"; ♦ the total internal reflection beam reflector in a lithium niobate waveguide with an electrode pair of H. Naitoh, K. Muto, T. Nakayama, "Mirror-type optical branch and switch", Appl. Opt. 12, 101-104 (1978); ♦ the 2x2 waveguide switch in lithium niobate with two electrodes of M. Papuchon, Am. Roy, "Electrically active optical bifurcation: BOA", Appl. Phys. Lett. 3JL, 266-267 (1977); and ♦ the wye junction beam router in a lithium niobate waveguide with three electrodes of H. Sasaki and I. Anderson, "Theoretical and experimental studies on active y-junctions in optical waveguides", IEEE Jo rn. Quant. Elect. , OE14. 883-892 (1978). These devices use uniformly poled material with varied electrode and optical structures. Many of the advantages of patterned poled devices have not been recognized. For example, in the book by ♦ H. Nishihara, M. Hanina, T. Suhara, Optical Integrated Circuits, McGraw-Hill, New York (1989) [NHS89], many electro-optical devices activated by various electrode patterns are described, but all of these devices are fabricated on a uniformly poled substrate. The same is true of another review article, ♦ T. Suhara and H. Nishihara, "Integrated optics components and devices using periodic structures," IEEE J. Quantum Electron. , QE-22, 845, (1986) [TH86], which describes the general characteristics of grating coupled devices without recognizing the advantages of a poled grating as opposed to an electrode grating. In selected instances in the literature, certain advantages of patterned poled substrates have been pointed out. ♦ A surface acoustic wave reflector with an array of domain reversals in a piezoelectric ceramic (but no electrodes) is described in U.S. Patent 4,410,823, Miller et al.; ♦ A beam steerer with triangular domain reversed regions in LiTa0 3 is described in Q. Chen, Y. Chiu, D.N. Lambeth, T.E. Schlesinger, D. D. Stancil, "Thin film electro-optic beam deflector using domain reversal in LiTaO,*, CTuN63, CLEO'93 Conference Proceedings, pp 196 et. seq., Optical Society of America. ♦ A Mach-Zehnder modulator with domain reversals to compensate phase differences between microwave and optical beams is described in U.S. Patent 5,278,924, 01/1994, Schaffher, "Periodic domain reversal electro-optic modulator". ♦ A Mach-Zehnder electric field sensor with one domain reversed region in an electro-optic substrate is described in U.S. Patent 5,267,336, 11/1993, Sriram et al., "Electro-optical sensor for detecting electric fields". Use of patterned poled structures offers efficiency advantages in beam control (including generation, modulation, redirection, focussing, filtration, conversion, analysis, detection, and isolation) with applications in laser control; communications; data storage; and display. What is needed in these areas are adjustable methods for beam control with high efficiency. Due to the sharp domain transitions, higher efficiency devices can generally be obtained using pattern poled substrates to create the high frequency variations; the electrodes are needed to excite the patterned poled substrate, not to create the high frequency variations. The poling process in polymers is quite different from that of crystals, and results in poorly defined domain boundaries. In crystals, there are a discrete number of (usually two) poling directions which are stable, and poling a local region consists of flipping atoms between these alternative states. Poled regions are fully aligned, and sharp boundaries exist between oppositely aligned domains. In poled polymers, any molecule can be oriented in any direction regardless of the poling direction. The poling process produces only an average component of alignment within a random distribution of individual molecules. In polymers, the poling (and the related EO coefficients) therefore have a continuous variation in strength and orientation. The sharp domain boundaries obtained in crystals are absent. This has a profound influence on the efficiency of certain types of poled device in polymers. Since the poling strength and direction in polymers follows the strength and direction of the local applied electric field, it is not possible to obtain poling features with spatial dimensions any sharper than permitted by Maxwell's equations. In polymers, there is very little advantage to be obtained from spatially patterning the poled regions instead of the electrodes. In devices based on optical polymers, poling is required to create an electro-optical response. The poling is done by applying a voltage to electrodes fabricated on the device (in the presence of heat). The entire polymer film may be poled with a uniform electrode, after which the electrodes are spatially patterned for the desired functionality. The EO performance of the device will not change much if the poling is accomplished with the patterned electrodes, since the active region within reach of the electric field is still poled almost as well. The choice of whether to pole the whole layer or just the region under the electrodes is mainly by convenience in fabrication. Examples of polymer EO devices where the poling is spatially patterned outside the active region of the device are ♦ the switched waveguides of U.S. Patent 4,867,516, 09/1989, Baken et al., "Electro-optically induced optical waveguide, and active devices comprising such a waveguide", and ♦ U.S. Patent 5,103,492, 04/1992, Ticknor et al., "Electro-optic channel switch". None of these devices have the electrodes traverse multiple boundaries of a patterned poled structure. The poling process also changes the index of refraction ellipsoid in polymers. This fact has some desirable consequences, such as making possible waveguides fabricated by poling a stripe of polable polymer as described in ♦ J. I. Thackara, G. F. Lipscomb, M. A. Stiller, A. J. Ticknor, and R. Lytel, "Poled electro-optic waveguide formation in thin-film organic media," Appl. Phys. Lett. , 52, 1031 (1988) [TLS88] and in ♦ U.S. Patents 5,006,285, 04/1991, and 5,007,696. 04/1991, Thackara et al. "Electro-optic channel waveguide". However, it leaves a problem in that poled polymer boundaries are lossy in their unexcited state (they scatter, diffract and refract). Devices in which a light beam crosses poled polymer boundaries have the problem that although transparency may be achieved, the poled polymer must be activated electrically to produce a uniform index of refraction. Poled crystalline devices do not have this problem because poling does not change their index of refraction. A solution to the problem of lack of transverse spatial definition in poled polymers was proposed in ♦ U.S. Patent 5,016,959 05/1991, Diemeer, "Electro-optical component and method for making the same", who describe a total internal reflection (TIR) waveguide switch in which the entire polymer film is poled, but the electro-optic coefficient of selected regions is destroyed by irradiation, creating unpoled regions with sharp spatial boundaries. While the underlying molecules in these unpoled irradiated regions remain aligned, they no longer have any electro-optic response. This approach is useful in creating sharp poled-unpoled domain boundaries in polymer films. It has the disadvantage that it cannot produce reverse poled domains so its efficiency is considerably reduced compared to the equivalent crystal poling technique. In nonlinear frequency conversion devices, domains of different polarity are typically periodically poled into a nonlinear optic material, but not excited by an electric field. The poled structure periodically changes along the axis of the beam to allow net energy conversion despite a phase difference that accumulates between the two beams. This process is known as quasi-phasematching, and has been demonstrated in ferroelectrics [U.S. Patent 5,036,220, Byer et al.] such as lithium niobate, KTP, and lithium tantalate, as well as in polymers, as described in ♦ U.S. Patent 4,865,406 09/1989, Khanarian et al, "Frequency doubling polymeric waveguide". Electrodes are not typically used in these devices, since the phasematching occurs in the absence of an electric field. Generalized frequency conversion in polymers is described in ♦ U.S. Patent 5,061,028 10/1991, Khanarian et al, "Polymeric waveguides with bidirectional poling for radiation phase matching", as well as TE-TM modulation. Khanarian et al. used patterned electrodes in both patents to pole the polymer film; the attendant loss in sharpness of the spatial pattern becomes a severe problem where more complex electrode structures are needed such as in the latter patent. Devices are known employing periodic structures which use electric fields to control gratings in order to control propagating fields. A diffraction grating modulator is shown in ♦ U.S. Patent 4,006,963, 02/1977, Baues et al. "Controllable, electro-optical grating coupler". This structure is fabricated by removing material periodically in an electro-optic substrate to form a permanent grating. By exciting the substrate electro-optically, the fixed index grating has a greater or lesser effect, producing some tuning. This structure does not contain poled regions. The drawbacks of the Baues structure are the same as for the polymer film: the grating cannot be made transparent without the application of a very strong field. The current technology for an EO switchable grating is shown in FIG. 1 (Prior Art). In this structure, periodically patterned electrodes serve as the elements that define the grating. The underlying material does not have a patterned poled structure, as hereinafter explained. An input beam 12 is coupled into a electro-optically active material 2 which contains an electrically controllable grating 6. When the voltage source 10 to the grating electrodes is off, the input beam continues to propagate through the material to form the output beam 16. When the grating-controlling voltage source is switched on, an index modulation grating is produced in the material, and a portion of the input beam is coupled into a reflected output beam 14. The material has an electro-optically active poled region 4 with a single domain, with the same polarity throughout the poled structure. A first electrode 6 is interdigitated with a second electrode 7 on a common surface 18 of the substrate. When a voltage is applied between the electrodes, the vertical component of electric field along the path of the beam 12 alternately has opposite sign, creating alternate positive and negative index changes to form a grating. The strength of the grating is controlled by the voltage source connected between the two electrodes by two conductors 8. A second general problem with the existing art of EO and piezoelectric devices using uniform substrates and patterned electrodes is that the pattern of the excited electric field decays rapidly with distance away from the electrodes. The pattern is essentially washed out at a distance from the electrodes equal to the pattern feature size. This problem is aggravated in the case of a grating because of the very small feature size. Prior art gratings formed by interdigitated electrodes produce a modulated effect only in a shallow surface layer. EO structures interact weakly with waveguides whose dimension is larger than the feature size. While longer grating periods may be used in higher order interaction devices, the lack of sha definition described above again seriously limits efficiency. The minimum grating period for efficient interaction with current technology is about 10 microns. What is needed is a way to maintain the efficiency of EO devices based on small structures, despite a high aspect ratio (i.e. the ratio of the width of the optical beam to the feature size). Switchable patterned structures are needed which persist throughout the width of waveguides and even large unguided beams. In bulk material, gratings may be formed by holographic exposure and acoustic excitation. Holographic exposure is very difficult, and storage materials such as SBN are not yet developed to a commercial state. Acoustic excitation is very expensive to implement and to power, and requires additional components such as soft mounts and impedance matched damping structures. Other methods form surface gratings, including deposition techniques, material removal techniques and material modification techniques (such as indiffusion, outdiffusion, and ion exchange). What is needed is an approach capable of a large enough aspect ratio to produce bulk interaction structures, preferably with feature control at an accessible surface. While the EO material can in principle be any electro-optically active material, liquid crystals are a special case and have limited applicability. A light modulator based on diffraction from an adjustable pattern of aligned liquid crystal domains is described in ♦ U.S. Patent 5,182,665, 01/1993, O'Callaghan et al., "Dirrractive light modulator". A light modulator based on total internal reflection modulated by liquid crystal domain formation is described in ♦ U.S. Patent 4,813,771 03/1989, Handschy et al., "Electro-optic switching devices using ferroelectric liquid crystals". In all of these devices, the domains must physically appear or disappear to produce the desired effect. The orientation of the molecules in the liquid crystal device changes in response to an applied field, producing a patterned structure which interacts with light. However, liquid crystals have important drawbacks. They are of course liquid and more difficult to package, and they have a limited temperature range and more complex fabrication process than solid state devices. High aspect ratio structures cannot be made because of the decay of the exciting field pattern with distance. The molecular orientation relaxes as soon as the field is turned off, and re-establishing the pattern takes a long time, so fast switching is not possible. The structures which switch light from waveguide to waveguide in the prior art have a high insertion loss or large channel spacing which render them unsuitable for large routing structures. A large switching structure must have switching elements with insertion loss low enough to permit light to propagate through the structure. If a waveguide has 100 switches, for example, the switches must have less than about .03 dB insertion loss. In the prior art this is not possible. R.A. Becker and W.S.C. Chang, "Electro-optical switching in thin film waveguides for a computer communications bus", Appl. Opt. IS, 3296 (1979), demonstrate a multimode crossing waveguide array structure coupled via interdigitated electro-optic grating switches. This switch has an inherently high insertion loss (0.4 dB) and poor switching efficiency (= 10%). U.S. Patent 5,040,864, 8/1991, J.H. Hong, "Optical Crosspoint Switch Module", discloses a planar waveguide structure which may in principle have a low insertion loss, but which requires very large crossing junctions for efficient switching, and is therefore incapable of producing a high density switching array In summary, the prior art has shortcomings in several areas: 1) large aspect ratios of controllable patterns are needed for efficient interaction with bulk waves or small patterns; 2) sharp domain transitions are needed for efficiency in higher order interactions; 3) transparency of domain structures is needed at zero applied field for proper unpowered operation; and 4) low insertion loss is required for arrays of switches. Poled structures contained in the above and other structures have not been fully utilized heretofore to realize practical devices. SUMMARY OF THE INVENTION According to the invention, one or more lasers are combined with optical energy transfer devices and energy guiding devices which use an electric field for control. The optical energy transfer devices may form gratings, mirrors, lenses and the like using a class of poled structures in solid material. The poled structures may be combined with waveguide structures. Electric fields applied to the poled structures control routing, reflection and refraction of optical energy. Adjustable tunability is obtained by a poled structure which produces a spatial gradient in a variable index of refraction along an axis in the presence of a variable electric field. In one embodiment, the present invention is a switchable grating which consists of a poled πtaterial with an alternating domain structure of specific period. When an electric field is applied across the periodic structure, a Bragg grating is formed by the electro-optic effect, reflecting optical radiation with a certain bandwidth around a center wavelength. The grating may be used by itself, or in combination with other gratings to form integrated structures in a ferroelectric crystal. Specifically of interest is an integrated structure in which one or more optical waveguides interact with one or more periodic structures to form a wavelength selective integrated optic modulator, switch, or feedback element. The invention will be better understood upon reference to the following detailed description in connection with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a modulator with interdigitated electrodes, according to the prior art. FIG. 2 is a generalized embodiment of the switched grating for interacting with bulk optical beams, according to the invention. FIG. 3 is an emrxκhment of a waveguide retroreflector using the switched grating. FIG. 4 is an embodiment of an electrode configuration for the retroreflecting device with three electrodes disposed on the same face of the crystal. FIG. 5 is an embodiment of an electrode configuration for the same device, in which two electrodes are disposed on the same face of the crystal. FIG. 6 is an embodiment of an electrode configuration for the device, in which three electrodes with tapered separation are disposed on the same face of the crystal. FIG. 7 is a tee embodiment of a poled crossing waveguide coupler. FIG. 8 is an x embodiment of a poled crossing waveguide coupler. FIG. 9 is an embodiment of a poled waveguide output coupler, with output out of the plane of the waveguide. FIG. 10 is an embodiment of a parallel waveguide poled directional coupler. FIG. 11 is a top view schematic diagram of the an x crossing waveguide coupler with illustrations of alternative input and output mode profiles. FIG. 12 is an embodiment of an x crossing waveguide coupler with tapered coupling region geometry excited with a tapered electrode gap. FIG. 13 is an embodiment of an x crossing waveguide coupler with generalized coupling region geometry and electrode pattern. FIG. 14 is a bulk optics embodiment of a tunable-frequency poled electro-optic retroreflector. FIG. 15 is a waveguide embodiment of a tunable-frequency poled electro-optic retroreflector. FIG. 16 is a bulk optics embodiment of a tunable-frequency electro-optic retroreflector with electro-optic cladding and independent excitation of poled grating and cladding. FIG. 17 is a waveguide embodiment of a multiple frequency poled electro-optic retroreflector. FIG. 18 is an illustration of a phase shifted poled grating. FIG. 19 is an embodiment of a multiple period grating reflector. FIG. 20 is an illustration of the frequency response curves of two devices with multiple periodicity and different free spectral range. FIG. 21 is an embodiment of a twin grating tunable reflector. FIG. 22 is a schematic illustration of an integrated etalon consisting of twin gratings with adjustable optical path length. FIG. 23 is an embodiment of a dual grating switchable wye junction with phase shifter. FIG. 24 is an embodiment of a poled waveguide mode converter. FIG. 25 is an embodiment of a waveguide router using the waveguide mode converter. FIG. 26 is an embodiment of a switchable parallel waveguide resonator. FIG. 27 is an embodiment of a three-arm waveguide etalon. FIG. 28 is an embodiment of a ring waveguide etalon. FIG. 29A is an embodiment of a modulator/attenuator with controllable poled mid- structure. FIG. 29B is an embodiment of an adjustable lens structure. FIG. 30 is an embodiment of a poled total internal reflecting (TIR) waveguide switch with switched poled waveguide stub. FIG. 31 is an embodiment of a dual TIR waveguide switch. FIG. 32 is an embodiment of a ΗR electrically switched beam director with switched unpoled waveguide stub. FIG. 33 is an embodiment of a two position poled waveguide router without TIR. FIG. 34 is an embodiment of an array of poled ΗR switches with a 50% switch packing density. FIG. 35 is an embodiment of an array of poled ΗR switches with a 100% switch density. FIG. 36 is an embodiment of a dual waveguide structure for high density packing architectures with permanent turning mirror and asymmetric loss crossing region. FIG. 37 is an embodiment of a switched waveguide array with TIR switches. FIG. 38 is an embodiment of a switched waveguide array with grating switches. FIG. 39A is an embodiment of an m x m communications switch array with system control lines. FIG. 39B is an embodiment of a 3 x 3 switch array with WDM capability. FIG. 40 is an embodiment of a two dimensional switching array with pixel elements. FIG. 41 is an embodiment of a one dimensional switching array with pixel elements coupled to data tracks. FIG. 42 is an embodiment of a switchable spectrum analyzer using selectable grating reflector sections and a detector array. FIG. 43 is an illustration of a poled acoustic multilayer interferometric structure. FIG. 44 is an illustration of a poled acoustic transducer. FIG. 45 is an embodiment of a tuned coherent detector of multi-frequency light waves. FIG. 46 is an embodiment of a low loss switchable waveguide splitter using a single poled region. FIG. 47 is an embodiment of a low loss switchable waveguide splitter using multiple poled regions. FIG. 48 is an illustration of the key design elements for a 1 x 3 waveguide splitter. FIG. 49 is a multiple layer stack of active waveguide devices shown as an adjustable phased array modulator. FIG. 50 is an embodiment of an adjustable waveguide attenuator of the prior art. FIG. 51 is an embodiment of a multiple poled segment adjustable waveguide attenuator. FIG. 52 is an embodiment of a structure with widened bandwidth using an angle- broadened poled grating. FIG. 53 is an embodiment of a structure with widened bandwidth using a curved waveguide. FIG. 54 is an embodiment of an electrically controllable poled lens. FIG. 55 is an embodiment of a laser feedback device using a periodically poled reflector. FIG. 56 is an embodiment of a laser feedback device using a periodically poled waveguide reflector. FIG. 57 an embodiment of a laser feedback device using multiple switched feedback gratings. FIG. 58 is an embodiment of a wavelength-tuned adjustable focussing system. DESCRIPTION OF SPECIFIC EMBODIMENTS Figures 55-58 are particularly relevant to the claims of this application. STructures and methods employed in connection with the claim invention are explained in the reamainder of the specification. Referring to FIG. 2, there is shown a generalized embodiment of a device 11 used in the present invention, which is a patterned poled dielectric device. Essentially, this device is an electrically- controllable stacked dielectric optical energy redirector, or more succinctly, an electrically-switchable mirror. In a preferred embodiment, the invention is a bulk optical reflector in a ferroelectric crystal 20 of lithium niobate. The electrically-controlled switching element is a poled grating 22, which consists of alternating poled domains of two types 36 and 38. A domain, which may be of any shape or size, is a physical region within which certain material properties are approximately constant. A poled domain is a region in a material in which the molecular groups have a directionality and these groups are substantially aligned (or are partially aligned) in, or near, a direction called the poling direction. There are many types of domains including domains of aligned atomic structures in different directions, domains of aligned molecules or atomic structures with various modified parameters such as the nonlinear activity or the electro-optic coefficient, domains of atomic structures with no preferred direction, domains defined by regions activated by different electrodes, poled regions in which the poling direction varies systematically across the region such as occurs in the case of polymers and fused silica poled with localized electrodes, domains of randomly oriented molecules, and by extension, a random domain structure: domains of sub-domains which are randomly poled within the domain. A poled structure is a set of individual domains. A patterned poled region is a region in a material in which the domains within the region have been poled according to a spatial pattern, with more than one domain type. There may be a systematic offset between the poled pattern and the imposed pattern used during the poling process, depending on the nature of this process. The boundaries of the pattern may also be somewhat irregular and not follow the imposed pattern perfectly, particularly if the poling process is not under complete control. The device is described as a patterned poled dielectric because an electric field is applied in controlling the device, so the material must be a dielectric in order to withstand the required field without damage. Typically, the poling process is also accomplished using an electric field, which the material must also withstand. In general, we mean by dielectric the capability of the material to withstand the minimum electric fields needed for the application. In operation, an optical input beam 40 is incident on and through the crystal, along an optical axis. The optical axis is normal to the phase front of the beam and is defined by the mean location of the propagating beam across its intensity profile at the phase front. The optical axis is straight in a uniform material, but may bend in several situations including curved waveguides, nonuniform media, and in reflective or diffractive structures. The input beam 40 preferably has a sufficiently small spot size 21 throughout the crystal length so that it is not apertured by the crystal, causing undesirable power loss and mode conversion. In a bulk-interaction device such as is shown in FIG. 2, the domains 36 and 38 must penetrate a sufficient distance through the substrate 20 so that they overlap at least a portion of the input beam 40. The grating 22 lies transverse of the input beam 40. This means the planes 34 of the grating 22 are transverse of the axis of the input beam 40. For two lines (or a line and a plane, or two planes) to be transverse of each other we mean that they are not parallel. Since the grating is transverse of the beam 40, the beam passes through at least a portion of the structure of the grating 22. The optical beam 40 is derived from an optical frequency source (not shown) and has a wavelength such that the beam is not substantially absorbed in the crystal, and such that the photorefractive effect does not distort the beam significantly. The optical frequency source means may include one or more optical exciters capable of supplying sufficient brightness within the wavelength acceptance of the grating reflector 22 to produce a useful switched output beam 44. The output beam may be coupled to other elements on the same substrate, or it may be coupled to external devices, in which case the output surface through which beam 44 emerges is preferably antireflection coated. The antireflection coating may be a multilayer dielectric coating, a single quarter wave layer of a material with almost the appropriate index of refraction, or a sol-gel coating. The exciter may be any light source including a laser, a light emitting diode, an arc lamp, a discharge, or even a filament, provided that the desired spectral brightness is achieved. The desired spectral brightness may be supplied directly from one .or more exciters, indirectly from one or more frequency converted (doubled, mixed, or parametrically amplified) exciters, or in combination with several of the above alternatives. Absorption effects will limit the wavelength to the range from about 400 to 4000 nm. The effect of the photorefractive phenomenon varies with the configuration, the wavelength, dopants, and the poling structure, and we assume here that it has been brought under control so that any beam distortion remains within acceptable limits. The grating 22 is formed or defined by the boundaries 34 between alternating domains of two different types. The first type of domain 36 has a different electro-optic (E-O) coefficient than the second type of domain 38, so that a uniform electric field applied between the electrodes 24 and 26 results in different changes in the index of refraction in the two types of domains. Because the index of refraction changes the phase velocity of the wave, there is an impedance mismatch between die regions of different index or phase velocity. It is advantageous to accomplish such an index change with material in which the regions 36 have a reverse sense relative to the poling direction of the other domain type 38 and the original wafer 20, as shown by the poling sense arrows 39, 41. By reverse sense we mean the poling direction is opposite to some reference direction. (An alternative realization of the field controllable grating is in an irradiated masked polymer film which has its E-O coefficient destroyed inside or outside die regions 36.) A uniform electric field applied to the structure 22 produces a modulated index of refraction. The pattern of index modulation adds to the pre-existing index of refraction distribution; the simplest configuration has no index modulation in die absence of the applied electric field, and develops an index grating linearly in response to the applied field. A period 48 for the grating 22 is the distance between two domain boundaries entirely including a region corresponding to each domain type. An alternative realization of the index of refraction grating is obtained by applying a strain field to the poled regions. The photoelastic response of the material produces different index of refraction changes in die different poled regions. The strain field may be applied permanently by, for example, laying down a film on top of the substrate at a high temperature and then cooling to room temperature. A concentration of strain may be achieved by etching away a stripe of the film, for example. The poled elements 36 and 38 alternate across the grating 22 with no space between them. If additional domain types are available, more complicated patterns of alternation are possible with domains separated by variable distances of the different domain types. For some applications, the grating 22 is a uniformly periodic grating as shown in FIG. 2 so that the domain types contained in one period along the length of the grating 22 are reproduced in the other periods. For other applications, it is advantageous to modify die period to obtain advantages such as multiple spectral peaks or a broader spectral bandwidth. By grating we mean an array of distinguishable structures, including all possible variations of geometry and periodicity. A periodic index grating is capable of supplying virtual photons in an interaction between optical beams. This means die grating structure is capable of supplying momentum, but not energy, to the interaction. For an interaction to proceed, both energy and momentum must be conserved, and the grating is useful when a momentum increment is required to simultaneously satisfy the two conservation relations. The grating periodicity defines the momentum which is available to die interaction. The grating strength determines the "intensity" of the virtual photon beam. The number of periods in the section of the' grating traversed by die optical beam determines the bandwidth of die virtual photon momenta which are available. Because of the bandwidth limitation, die interaction can only proceed within a specific range (or ranges) of optical frequencies. Grating devices are therefore inherently frequency selective, and typically operate around a nominal wavelength. For example, in a simple reflection process at an angle, as illustrated in FIG. 2, die photons of the input beam 40 have the same optical frequency as die photons of die output beams 44 and 42, so energy conservation is observed. However, the momentum of the photons in input beam 40 and diverted output beam 44 are not the same; for the reflection process to occur, the change in momentum must be supplied by die grating 22 as illustrated by the vector diagram 43 associated with FIG. 2. The grating 22 supplies a virtual (with momentum but no energy) photon to die interaction to enable the conservation of momentum. The momentum vector associated with die i* mode, k , = 2 ra i /λ i , is equal to the product of 2τ times die effective index n, for that mode divided by die wavelength λ, for that wave, and it points in the direction of propagation. The magnitude of the momentum vector is also called die propagation constant. In the case of a single period grating, die momentum vector k. = 2τ/Λ points perpendicular to uie grating surfaces, and it can have any wavelength value Λ which is present in die Fourier transform of the grating. The optical spacing (the width of the grating lines and spaces) associated with die propagation constant k, of a 50% duty cycle grating is therefore Λ/2. The frequency of interaction may also be tuned by adjusting for example die index of refraction of die optical beams, or die grating period by thermal expansion or other means. Depending on how a given device is implemented, an index structure may have a spectrum of wavelengths and vector directions which can be contributed to die interaction. Also, multiple virtual photons may be contributed to an interaction in a so-called "higher order" grating interaction. A "higher order" grating is one which has a period which is related to die required period for momentum conservation by division by an integer. The required momentum virtual photon is obtained from die harmonics of me "higher order" grating. The condition that momentum be conserved by the process is commonly called die Bragg condition, so the gratings of this invention are Bragg gratings, and die incidence angle on the gratings is die Bragg angle for e in-band or resonant frequency component. This dual conservation of energy and momentum is required for any energy beam interaction, whether die energy beam is optical, microwave, acoustic, or any other wavelike energy form consisting of a time-variable energy field. Only the implementation of the grating may change, to produce an impedance modulation for die different forms of energy so that the pattern of the structure can couple with the wavelike energy form. In FIG. 2, the index grating functions as a frequency-selective optical energy router or reflector. A beam of a characteristic frequency within the interaction bandwidth (capable of interacting with one or more of the virtual photons) is known as an in-band beam, while energy beams of other frequencies are known as out-of-band beams. The grating 22 has a frequency bandwidth which corresponds to die full width at half maximum of the reflection efficiency of the grating as a function of optical frequency. When the index grating is present (the grating is "on"), a beam having an optical frequency within die bandwidth of the grating is reflected from the grating at the angle 46 around a normal 47 to the grating structure. An out-of-band beam transmits through the crystal along the same optical axis and in the same direction as the input beam, forming part of the transmitted output beam 42. An electric field applied in the region including die grating controls the strength of die index modulation (which can also be thought of as the intensity of die virtual photons), adjusting die ratio of die power in die transmitted output beam 42 to that in die reflected output beam 44. For a weak retro reflecting grating (which does not substantially deplete the input beam), the full width half maximum bandwidth Δλ is given by λ 2 Δλ = (i) 2.24nl where λ = vacuum wavelength of the input beam, n = index of refraction of the beam, and L = length of the grating. For highly reflecting gratings, the effective length is smaller than the total length of the grating, increasing the bandwidth. The two types of domains may exhibit an index difference before an electric field is applied. In this case, a permanent index grating accompanies the poled switchable index grating. As the electric field is applied, die net modulation in the index of refraction (the grating strength) may be increased or decreased, depending on die polarity. The "grating off" situation (index grating value near zero) is then achieved at a specific value of applied field. The grating can then be turned "on" by applying any other field strength. If the polarity of die applied field is reversed, for example, an index grating is produced with twice die strength of die original permanent grating. The poled grating structure of our invention has two major advantages over die prior art. First, the poled domain structures can have very sharp boundaries, providing a strong Fourier coefficient at virtual photon momenta which are multiples of die momentum corresponding to the basic grating period. This is very useful in cases where it is impractical to perform lithography with die required small feature size. Second, strong index modulation gratings can be made even if die optical mode dimension is large compared to die grating period. This is not possible in a uniformly poled substrate excited by patterned electrodes, because the electric field modulation decays exponentially with distance away from the plane of the electrode array, losing most of die modulation within a distance equal to die grating period. The poling process can create poled features with an extremely high aspect ratio, or the ratio of depth of the domain to its width. Using an electric field poling technique, aspect ratios in excess of 250: 1 have been fabricated. Because we use essentially uniform electrodes, we get good electrostatic penetration; with deep domain walls, good modulation is available across die entire beam. The grating may also be a two dimensional array of index changes, in which case the grating has periodicities in two dimensions. The virtual photon contributed by the grating can then contribute momentum in two dimensions. This might be useful, for example, in an application with several output beams from a single grating. In the preferred embodiment, die ferroelectric crystal is a commercially-available, z-cut, lithium niobate single-crystal wafer. Other cuts, including x- ( y-, and angle-cuts can also be used, depending on the poling method and the desired orientation of the poled domains. The fabrication steps include primarily poling and electrode fabrication. Prior to processing, die crystal is cleaned (for example by oxygen plasma ashing) to remove all hydrocarbons and other contaminants rernaining from the polishing and handling processes. To control the poling, a mask and processing electrodes are used to create a pattern of applied electric field at the surface of and through die wafer, as described in U.S. Patent Appl. No. 08/239,799 filed May 9, 1994. The poling pattern is adjusted to produce the poled domain inversion in regions 36 during the application of the poling field. In brief, a silica layer several microns thick is deposited on the +z surface 23 of die wafer 20. This film is dunned or removed over die regions 36 where domain inversion is desired, a liquid electrode or deposited metal film is used to make a good equipotential surface over die patterned silica, and an electric field exceeding approximately 24 kV/mm is applied with the +z surface 23 at a higher potential than die - z surface 25. Using this technique, ferroelectric crystals of lithium niobate have been poled to create patterns of two domain types which are of reverse polarity (domain inversion). The magnitude of the electro-optic coefficient for the two types of domains is identical, although with a reverse polarity. In addition to die preferred technique, domain inversion has been achieved in ferroelectrics using in-diffusion, ion-exchange, and alternate electric field poling techniques. Domain formation by thermally-enhanced in-diffusion has been demonstrated in lithium niobate, using titanium. The triangular shape of die inverted region limits the interaction efficiency for small domain size, however, and is useful mainly in waveguide devices with long periods. Patterned poling via ion exchange has been demonstrated in KTP in a salt bath containing rubidium and barium ions, in which die potassium ions in the crystal were exchanged for the rubidium ions. Electric field poling using alternate techniques to the preferred one have also been demonstrated in both lithium niobate and lithium tantalate. Potentially, all solid ferroelectric materials, including KTP and barium titanate, can be poled by electric field domain- inversion techniques. (Solid means holding its structure for a certain period of time, such as cooled fluids, glasses, crosslinked polymers, etc.) Gratings with different characteristics are generated by die different techniques. Electric field poling aligns die domains in die crystal without producing an intrinsic change in die index of refraction, while die ion-exchange and diffusion techniques do create a index change in the poled regions. A permanent index grating accompanies die switchable poled grating when these latter methods are used. In general, there are two types of differing domains, at least die first type of which is poled. Although only two types of domains are required, more complex switchable grating structures can be fabricated with additional types of domains. The second domain type may be reverse poled, unpoled, or poled at another angle, and it may be distinguished by possessing a distinct electrical activity coefficient, (e.g. the electro-optic or die piezo-optic coefficient). For example, it may in some applications be cost effective to fabricate the device from unpoled lithium niobate wafers, in which case die substrate wafer is comprised of multiple randomly oriented domains. The poled domains will have a uniform orientation while the orientation in the other domains will be random. The performance of the device will be affected by die details of the random pattern, depending on the type of device. As another example, the second domains may be oriented perpendicular to the first or at another angle, and the difference in the electrical response can still produce a useful electronically controlled structure. The poled domains may also be formed in a material which was previously unpoled and randomly oriented on a molecular scale, such as in fused silica or polymers. The poling process orients the structure of the material to form the first domain type, while the second domain type consists of die unpoled or randomly oriented regions in die material. In an alternate technique, the poled structure can be formed by selectively changing or destroying the electrical activity coefficient in regions corresponding to the second domain type. The orientation of the atomic structures in these regions does not need to be altered: if the electrical activity is changed in the second domain region, the domains are different. For example in nonlinear polymers, the electro-optic coefficient may be disabled by irradiation, producing regions of electrical activity where the irradiation is masked off. A similar effect has been demonstrated in lithium niobate, where proton exchange destroys die nonlinear coefficient. Modification of die electro-optic coefficient can also be achieved by optical radiation, electron bombardment, and/or ion bombardment in many other materials, including most nonlinear materials such as KTP and lithium tantalate. In lithium niobate, an applied field E 3 along die z axis of the crystal induces a change in the extraordinary index of refraction δn. which is given by W 3 on = r 33 l 3 ng (2) 2 where r jj is die appropriate electro-optic nonlinear optical coefficient. Because r u is the largest nonlinear constant in lithium niobate, it is best to use die change in the extraordinary index in practical devices. (The nonlinear constant r l3 which produces a change in die ordinary index of refraction due to an applied E } , is a factor of 3.6 smaller than r M .) To use the change in me extraordinary index, the light waves must be polarized along the z axis of die material. In a z-cut crystal, this polarization is called TM. (In TE polarization, die electric vector lies in the plane of die crystal surface. The only other significant nonlinear coefficient is r, J( which couples TE and TM waves upon die application of an electric field E, or E,.) Because the index change induced in die poled structures is quite small (witii an applied field of 10 V/μm along die z axis of a lithium niobate substrate, die index change δn. is only 1.6x10°), the grating reflector of FIG. 2 has a strong angular dependence. The Brewster angle for a weak index change is 45°, so die gratings will totally transmit any TE polarized wave when die planes of die grating are disposed at and angle of 45° with respect to the phase front of die light beam. The device may therefore be used as a polarizer. The reflected beam will always be essentially polarized at 45° incidence. If the reflection coefficient for die TM wave is high, which can be arranged with enough grating periods and a high applied field, die extinction ratio of die polarizer can also be very high in die forward direction. At normal incidence, of course, tiiere is no difference in reflection between die two polarizations due to this effect (although there are differences due to other effects such as die different electro-optic coefficients described above). A total internal reflection device operating at grazing incidence is far from Brewster's angle and has little difference in reflection due to this effect. The wafer material can be any polable solid dielectric material, including ferroelectrics, polymer films, and some amorphous materials such as fused silica which can also be poled for producing many useful devices according to die invention. The poled material may also be a tiύn film deposited on a substrate of a second material. Many of die polable thin films, such as fused silica, lithium niobate, potassium niobate, barium titanate, zinc oxide, II- VI materials, and various polymers, have been successfully deposited on a substrate. A wide variety of substrates have been used, including MgO, silicon, gallium arsenide, lithium niobate, and various glasses, including quartz and fused silica. For die domains to be electronically switchable, they must consist of electro-optic materials, which are materials having an index change induced by an applied electric field. After the poling step, die liquid electrode material and silica masking film are preferably removed. Referring again to FIG. 2, a first electrode 24 and a second electrode 26 confront the dielectric material in order to provide a means to create die electric field which controls die grating. (Confronting a material means placed close to the material but not necessarily touching, approximately aligned to the surface of die material but not necessarily with a constant gap dimension, and includes situations with additional material of varying dimensions placed on top of the material.) The electrodes 24 and 26, consisting of an electrically-conductive material, are preferably laid out on opposing surfaces of die crystal in a spatially delimited manner using standard deposition techniques. These electrodes are referred to as being on opposing planes even though the surfaces may be curved and/or non-parallel as part of a larger geometry. The electrodes may be formed by any material that provides sufficient transport of electrical charge to achieve an adequate field strength to activate die poled grating in a time consistent with die application. For example, the electrodes could alternatively consist of metals such as aluminum, gold, titanium, chromium, etc., conductive paint, epoxy, semiconducting material, or optically transparent materials such as oxides of indium and tin, and liquid conductors such as salt solutions. They may also confront die surfaces 23 and 25 with a gap filled with air, an optically transparent buffer layer, and/or other material. Only one electrode is required since a potential voltage difference can be created between that electrode and any potential reference such as an exterior ground plane, a second electrode, or multiple electrodes. The electrodes are the electric field creating means because the application of a voltage to an electrode establishes an electric field pattern which is determined by the electrode. A voltage and current supply is of course also needed. The electrodes are placed so tiiat die control electric field is applied through the active volume of die invention, which may consist of a pattern poled region or a grating. In die case of metallic electrodes, it may be best to incorporate a coating deposited below die electrode, to reduce the optical loss which occurs when a portion of the guided wave mode extends to the metallic electrode. The coating should be thin enough to maintain high electric field at die surface in the case of multiple electrodes mounted on die same surface, but thick enough to reduce die optical loss. Another coating is also useful above the electrodes to reduce die probability of breakdown. A voltage control source 32 (or potential source) provides die electrical potential to drive the electrodes through connections 30 to activate die grating. The activated electrodes are polarized relative to each otiier according to die polarity of the applied voltage. The voltage of die source produces a large enough electric field through die poled regions to switch a significant amount of light into the switched output beam 44. The voltage of die source is variable to provide a means to control die ratio of power in the two output beams. Substantially all of die input beam may be reflected with a long grating if the electric field is sufficiendy high, forming an electrically activated mirror. For lower electric fields, the grating forms a partial reflector. The voltage control source may be a battery, an electrical transformer, a gas powered generator, or any odier type of controllable source of electrical current and potential. The control means 32 may also incorporate a controller which generates a time dependent voltage, and which supplies the current to change die voltage on the electrodes 24 and 26 at die frequencies required by the application. The control means 32 may also have multiple outputs capable of controlling multiple devices, and which might be sequenced temporally according to some pattern. The source 32 may have control inputs for manual or electronic control of its function by computer or by another instrument. In order to avoid unnecessary repetition, it should be understood that die variations described in reference to FIG. 2 apply to the embodiments described below, and that the variations described in reference to the figures below also apply to FIG. 2. Referring now to FIG. 3, a guided-wave embodiment of die present invention is shown. Specifically, this embodiment is an electrically-controlled, frequency-selective waveguide retroreflector. All of die optical beams in this device are confined in two dimensions by an optical waveguide 64, which traverses one surface of die polable dielectric material that forms die substrate 60 of die device 61. A waveguide is any structure which permits the propagation of a wave throughout its length despite diffractive effects, and possibly curvature of die guide structure. An optical waveguide is defined by an extended region of increased index of refraction relative to die surrounding medium. The strength of die guiding, or the confinement, of die wave depends on die wavelength, die index difference and the guide width. Stronger confinement leads generally to narrower modes. A waveguide may support multiple optical modes or only a single mode, depending on die strength of die confinement. In general, an optical mode is distinguished by its electromagnetic field geometry in two dimensions, by its polarization state, and by its wavelength. The polarization state of a wave guided in a birefringent material or an asymmetric waveguide is typically linear polarized. However, die general polarization state may contain a component of nonparallel polarization as well as elliptical and unpolarized components, particularly if the wave has a large bandwidth. If die index of refraction difference is small enough (e.g. Δn— .003) and die dimension of die guide is narrow enough (e.g. W=4 μm), the guide will only confine a single transverse mode (the lowest order mode) over a range of wavelengths. If die waveguide is implemented on the surface of a substrate so that there is an asymmetry in the index of refraction above and below the waveguide, there is a cutoff value in index difference or waveguide width below which no mode is confined. A waveguide may be implemented in a substrate (e.g. by indiffusion), on a substrate (e.g. by etching away die surrounding regions, or by applying a coating and etching away all but a strip to define the waveguide), inside a substrate (e.g. by contacting or bonding several processed substrate layers together). In all cases, we speak of die waveguide as traversing die substrate. The optical mode which propagates in the waveguide has a transverse dimension which is related to all of die confinement parameters, not just die waveguide width. The substrate is preferably a single crystal of lithium niobate, forming a chip which has two opposing faces 63 and 65 which are separated by die thickness of die wafer. The opposing faces need not be parallel or even flat. The waveguide is preferably formed by a well-established technique such as annealed proton exchange (APE) on face 63. Alternatively, ions otiier than protons may also be indiffused or ion exchanged into die substrate material. The APE waveguide increases die crystal extnordinary refractive index, forming a waveguide for light polarized along the z-axis. For a z-cut crystal, tiύs corresponds to a TM polarized mode. Waveguides formed by alternate techniques, such as titanium in¬ diffusion in lithium niobate, may support both die TM and TE polarizations. Preferably, die waveguide is designed to support only a single lowest order transverse mode, eliminating die complexities associated widi higher order modes. The higher order transverse modes have different propagation constants than the lowest order mode, and higher scattering loss, which can be problems in some applications. However, multimode waveguides might be preferred for some applications, such as for high power propagation. One alternative configuration is to excite the grating by applying pressure rather than by directly applying an electric field. The effect of an applied pressure is indirectly the same: by die piezoelectric effect, die applied stress produces an electric field, which in turn changes the index of refraction of the domains. However, no sustaining energy need be applied to maintain die stress if the structure is compressed mechanically, for example. This alternative, like the others mentioned herein, apply also to the other similar realizations of the invention described below. Once the waveguide dimensions are determined, a photomask for the waveguide is generated and the pattern is transferred to a masking material on the substrate, by one of many well known lithographic processes. The mask material may be Si0 2 , tantalum or other metals, or otiier acid resisting materials. To fabricate an APE waveguide, die masked substrate material is immersed in molten benzoic acid to exchange protons from the acid for lithium ions in the crystal. The resulting step index waveguide may then be annealed for several hours at around 300°C to diffuse die protons deeper into die crystal and create a low-loss waveguide with high electrical activity coefficients. In addition to in-diffusion and ion exchange two-dimensional waveguides, planar and two άirnensional ridge or strip-loaded waveguides can be formed. Planar waveguides may be formed by depositing die electrically active material on a substrate of lower index. Deposition techniques for waveguide fabrication are well-known and include liquid phase epitaxy (LPE), molecular beam epitaxy (MBE), flame hydrolysis, spinning, and sputtering. Ridge waveguides can be formed from tiiese planar guides by using processes such as lift-off, wet etch, or dry etch such as reactive ion etching (BSE). Planar guides can also be used in the present invention, particularly in devices using a variable angle of diffraction off die grating. The grating 62 in this embodiment is disposed normal to die optical waveguide 64 which traverses die substrate. The grating is composed of a first type 66 and second type 68 of domain, which do not necessarily extend through the substrate. For example, when die active material is poled using in- diffusion or ion exchange, the inverted domains 66 typically extend to a finite depth in die material. The partial domains may also be formed when the poling is achieved by destroying the electrical activity of the material (or reducing die electro-optic activity) by a technique such as ion bombardment or UV irradiation. The optical input beam 80 is incident on and is coupled into die waveguide. Coupling refers to die process of transferring power from one region into another across some kind of generalized boundary such as across an interface, or between two parallel or angled waveguides, or between a planar guide and a stripe guide, or between single mode and multimode waveguides, etc. When the grating is on, a portion of the input beam is coupled back into a retroreflected output beam 82. While the retroreflection of the grating need not be perfect, i.e. die grating may reflect die light to within a few degrees of the reverse direction, the waveguide captures most of this light and forms a perfecdy retroreflected beam. The imperfection of die retroreflection results in a coupling loss of die retroreflected beam into the waveguide 64. When die grating is off (when die controlling electrical field is adjusted to die "off position in which die index grating has a minimum value near zero, typically at zero field), die input beam continues to propagate in the same direction through die waveguide to form a transmitted output beam 84. As in die bulk device, die strength of die grating can be varied with die voltage source 76 to control die ratio of die power in die two output beams. A first electrode 70 and second 72 electrode confront opposing faces of the dielectric material 60. The substrate is a dielectric because it is capable of withstanding an applied electric field without damage, but it need not be a perfect insulator as long as die current flow does not adversely affect the performance of die device. The electrodes may be formed of any electrically conducting material. There must also be a means for creating an electric field through die dielectric material using die first electrode structure. The electrodes bridge at least two of die elements of die first type of poled structure that forms die grating. This means die electric field produced by die electrodes penetrates into at least the two elements. Thus, these elements can be activated by the field. Two wires 74 preferably connect the voltage control source 76 to die two electrodes to provide an electric field in die region formed by die intersection of die waveguide 64 and die poled structure 62. The wires may be formed from any material and in any geometry with sufficient conductivity at die operating frequency to allow charging die electrodes as desired for die application. The wires may be round, flat, coaxial cables, or integrated lead pattern conductors, and they may be resistors, capacitors, semiconductors, or leaky insulators. Alternately, die electrodes can be arranged in any manner that allows an electric field to be applied across die electrically active material. For example, die electrodes may be interspersed in different layers on a substrate, with the active material between the electrodes. This configuration enables high electric fields to be produced with low voltages, and is particularly useful for amorphous active materials, such as silica and some polymers, which can be deposited over die electrode material. The poled structure 62 is preferably deeper than die waveguide so that die intersection between the waveguide 64 and die poled structure 62 has the transverse dimensions of die mode in the waveguide and die longitudinal dimensions of die grating. FIGS. 4, 5 and 6 show alternate electrode configurations in which the electrodes are disposed on a common face of the dielectric material 189. These configurations are especially useful for eαwodiments of die present invention that use a waveguide 180 to guide an optical beam, since die same- surface electrode configurations permit high electric fields at low voltage. These electrode structures are of particular interest for low voltage control of the grating 182 because of the proximity of die electrodes to die section of die waveguide which traverses die grating, the electrode configuration 186 depicted in FIG. 4, the first electrode 170 and second electrode 172 confront die dielectric material on the same surface. These electrodes are referred to as being on a common plane even though the surface may be curved as part of a larger geometry. The first electrode is placed above a portion of the waveguide that contains several grating elements, each of which consists of alternate regions of a first type of domain 184 and a second type of domain 185. The second electrode is positioned around die first electrode. The distance between the electrodes along the waveguide is approximately constant along die axis of die waveguide for cases where a uniform field along the axis of die waveguide is desired. The electrode spacing may also be varied to taper die field strength, as shown schematically in die device 188 of FIG. 6. A voltage source 174 connected between die two electrodes disposed as shown in FIG. 4, is capable of generating electric fields between die electrodes. The electric field vectors 176 have dieir largest component perpendicular to the surface of die material, in the region of die electrically-active waveguide. For a z-cut ferroelectric crystal such as lithium niobate, this electric field structure activates die largest electro-optic coefficient r n , creating a change in index for a TM polarized optical beam. For an applied electric field of 10 V/μm and an optical beam with a wavelength of 1.5 μm in lithium niobate, the strength of a first order grating is 40 cm' 1 . A means 178 for contacting die electrodes to a voltage source is required for each of the electrode configurations. To form this means, an electrically conducting material, such as a wire, is electrically contacted between the electrodes on die device and die terminals of the potential source. In all electrode configurations, each electrode typically has a section, or pad, or contact, to which die wire is contacted. The pads are preferably of large enough size to reduce placement tolerances on the electrical contact means for easier bonding. The wire can then be contacted to die pads using a technique such as wire bonding by ultrasonic waves, heating, or conductive epoxy. Alternately, a spring-loaded conductor plate can be placed in direct contact with die electrode to make die required electrical connection to die voltage source. In die figures, die electrodes are typically large enough and function as the contact pads by emselves. Another realization 187 of die same-surface electrode structure is shown in FIG. 5, wherein die first electrode 171 and second electrode 173 are placed on either side of the optical waveguide. When an electric potential is applied across die two electrodes positioned in this manner, die electric field vectors 177 have tiieir largest component parallel to die substrate surface. For a z-cut ferroelectric crystal, die electro-optic coefficient that creates a change in index for a TM polarized optical wave and the applied electric field is r, 3 . For an applied electric field of 10 V/μm and an optical beam with a wavelengdi of 1.5 μm in lithium niobate, die first order grating coupling constant is 12 cm' 1 . Alternately, for TE waveguides die active electro-optic coefficients are switched for die two configurations. For an electric field vector perpendicular to die surface of the chip, die appropriate coefficient is r, 3 , while for an electric field vector parallel to die surface of the chip, die electro-optic coefficient used is r^. Similar situations apply for x- or y-cut crystals, or intermediate cuts. As a further variation of die configuration of FIG. 5, the electrodes are asymmetrically arranged so that one electrode approximately covers the waveguide 180 and die other electrode is displaced somewhat to the side. In this configuration, die strong vertical field induced under die edges of die adjacent electrodes is made to pass predominandy through die waveguide region under one of the electrodes. In FIG. 6, the electrodes 175 and 179 have a separation from the center electrode 181 which is tapered. When a voltage is applied across these electrodes, this configuration produces a tapered field strength, with die strong field towards die right and die weaker field towards the left. By "tapered" we mean that any parameter has a generalized spatial variation from one value to another without specifying whether die variation is linear or even monotonic; die parameter may be a gap, a width, a density, an index, a thickness, a duty cycle, etc. The index changes induced in die poled domains towards die left of die waveguide 180 are tiierefore weaker than die index changes induced towards the right. This might be useful, for example, to obtain a very narrow bandwidth total reflector where it is needed to extend die length of die interaction region. In non-normal incidence angle devices, such as shown in FIG. 7 and FIG. 8, the taper might be useful to optimize die coupling of a specific input mode into a specific output mode. In all electrode configurations, die voltage applied can range from a constant value to a rapidly varying or pulsed signal, and can be applied with either polarity applied between die electrodes. The value of the voltage is chosen to avoid catastrophic damage to die electrically-active material and surrounding materials in a given application. When a constant electric field is applied across materials such as lithium niobate, charge accumulation at the electrodes can cause DC drift of the electric field strength with time. The charges can be dispersed by occasionally alternating die polarity of the voltage source, so that die electric field strength returns to its full value. If die time averaged electric field is close to zero, the net charge drift will also be close to zero. For applications sensitive to such drift, care should be taken to minimize die photorefractive sensitivity of the material, such as by in-diffusion of MgO, and operation is preferably arranged without a DC field. Surface layers are useful for preventing electric field breakdown and lossy optical contact with the electrodes. Losses are particularly important for waveguide devices, since die beam travels at or near the surface, while breakdown is most critical when electrodes of opposite polarity are placed on die same surface. This concern applies to the poling of die active material as well as to die electro-optic switching. The largest vector component of die electric field between two same-surface electrodes is parallel to die surface of die material. Both die breakdown problem and die optical loss problem can be considerably reduced by depositing a layer of optically transparent material with a high dielectric strength between die guiding region and die electrodes. Silicon dioxide is one good example of such a material. Since there is also a potential for breakdown in die air above and along die surfaces between the electrodes, a similar layer of die high-dielectric-strength material can be deposited on top of die electrodes. FIG. 7 and FIG. 8 show two embodiments of a electrically-controlled frequency-selective waveguide coupler. In FIG. 7, a pair of two-dimensional waveguides traverse one face of a dielectric material, and intersect at an angle 118 to make a tee, forming a three-port device. A grating 100, consisting of a first type 104 and second type 102 of domains, is disposed at an angle to die two guides in die intersection region between them (die volume jointly occupied by die optical modes in die two waveguides). The peak index change in die intersection region is preferably equal to die peak index change in the waveguides. This is done if die fabrication of die tee structure is accomplished in one step (be it by indiffusion, ion exchange, etching, etc.). In die alternative approach of laying down two waveguides in subsequent steps, which is most convenient in die crossing waveguide geometry of FIG. 8, die peak index change in the intersection region is twice die index change in die waveguides, which is not needed. As always, the periodicity and angle of die grating is chosen such that die reflection process is phase matched by die momentum of a virtual photon within the bandwidth of the grating. For optimal coupling between an in-band input beam in die first waveguide and an output beam 114 in the second waveguide 108, die angle of incidence of the input beam is equal to die angle of diffraction off die grating. In this case, die bisector of the angle between die two guides is normal to die domain boundaries of die grating in die plane of the waveguide. An input beam 112 is incident on and is coupled into die first waveguide 106. A first electrode 120 and second electrode 122 are laid out on die same face of die dielectric material so that an electric field is created in die intersection region between die waveguides, when a voltage source 124 connected to die two electrodes by conductors 126 is turned on. The electric field controls the strength of the grating in the intersection region via die electro-optic effect, coupling die in-band beam from die first waveguide into the second waveguide to form a reflected output beam 114. With die grating turned off, the input beam continues to propagate predominantly down the first waveguide segment to form a transmitted output beam 116 with very little loss. Alternately, counter-propagating beams can be used in the waveguide so tiiat the input beam enters though die second waveguide 108, and is switched into die output waveguide 106 by interacting with die grating. In single mode systems, die grating strength is preferably spatially distributed in a nonunifoπn manner so that a lowest order Gaussian mode entering waveguide 106 is coupled into the lowest order Gaussian mode of waveguide 108. The grating strength can be modulated by adjusting the geometry of the electrode, by adjusting die gaps between the electrodes, and by adjusting die duty cycle of the grating. The bandwidth of die grating may also be enhanced by one of a number of well known techniques such as chirping, phase shifting, and die use of multiple period structures. The size of the coupling region is limited, in die geometry of FIGS. 7 and 8 by die size of the intersection region between die guides where their modes overlap. To obtain a high net interaction strength for a given electric field strength, it is desirable to increase die size of die waveguides to produce a larger intersection. However, large waveguides are multimode, which may not be desirable for some applications. If adiabatic expansions and contractions are used, die advantages of both a large intersection region and single mode waveguides can be obtained simultaneously. The input waveguide 106 begins as a narrow waveguide and is increased in width adiabatically as die intersection region is approached. The output waveguide 108 has a large width at die intersection to capture most of die reflected light, and it is tapered down in width adiabatically to a narrow waveguide. The idea of adiabatic tapering of an input and/or an output waveguide can be applied to many of die interactions described herein, Referring to FIG. 8, the two waveguides 136 and 138 intersect at an angle 158 to make an x intersection, forming a four-port device. This device is a particularly versatile waveguide switch, since two switching operations occur simultaneously (beam 142 into beams 146 and 148, and beam 144 into beams 148 and 146). The grating 130, consisting of a first type 134 and second type 132 of domains, is disposed at an angle to die two guides in the intersection region between diem. The angle of die grating is preferably chosen such that die bisector of die angle between die two guides is normal to die domain boundaries of die grating, in the plane of die waveguide. A first input beam 142 is incident on and is coupled into die first waveguide 136 and a second input beam 144 is coupled into die second waveguide 138. A first electrode 150 and second electrode 152 are laid out on die dielectric material so that an electric field is created in die intersection region between the waveguides, when a voltage source 154 connected between die two electrodes is turned on. The electric field controls the strength of the index grating in the intersection region through the electro-optic effect. When die grating is on, a portion of die in-band component of die first input beam is coupled from die first waveguide to die second waveguide to form a first output beam 146. At the same time, a portion of die in-band component of die second input beam from die second waveguide is coupled into the first waveguide to form die second output beam 148. In addition, the out-of-band components of the two beams, and any unswitched components of the in-band beams, continue to propagate down their respective waveguides to form additional portions of die appropriate output beams. Thus, for two beams witii multiple optical frequency components, a single frequency component in die two input beams can be switched between die two output beams. The waveguide may only be a segment, in which case it is connected to other optical components located either off die substrate, or integrated onto die same substrate. For example, die waveguide segment could be connected to pump lasers, optical fibers, crossing waveguides, otiier switchable gratings, mirror devices, and odier elements. An array of crossing waveguide switches would comprise an optical switching network. In FIG. 9, a further embodiment of die waveguide coupling switch is shown. The domain walls of die grating are now disposed at a non-normal angle to the surface 157 of the crystal 158, so that die input beam 159 in waveguide 160 is reflected out of the plane of die crystal to form a reflected output beam 161. As before, an unreflected beam continues to propagate through the waveguide to form a transmitted output beam 162. An optically transparent first electrode 163, which can consist of indium tin oxide, is disposed on one face of the dielectric material 158, over a portion of the grating that crosses the waveguide. A second electrode structure 164, which may be optically absorbing, is disposed on the material. As in all cases described in this disclosure, die second electrode may be arranged in one of many alternate configurations: surrounding die first electrode as in FIG. 7, on opposite sides of the material 158 as on FIG. 2, tapered similar to die configuration shown in FIG. 6. The electrodes are connected with two wires 156 to a voltage source 154, which controls die power splitting ratio of the in- band beam between the transmitted beam 162 and die reflected beam 161. Alternately, the electrode configuration could be as shown in FIG. 5 , in which case both electrodes may be opaque. Referring again to FIG. 9, the domain walls are preferably formed by electric field poling of a ferroelectric crystal which is cut at an angle to me z-axis 165. Since die electric field poled domains travel preferentially down die z axis, poling an angle-cut crystal by this technique results in domain boundaries parallel to die z axis, at die same angle to die surface. The angle 166 of the cut of die crystal is preferably 45° so that light propagating in die plane of die crystal may be reflected out of die substrate normal to the surface of die material (any angle may be used). The domains shown in FIG. 9 are planar, but can also be configured in more general configurations. A planar grating will produce a flat output phase front from a flat input phase front. If die device shown is used as a bulk reflector without the waveguide, a collimated input beam will produce a collimated output beam. The device is useful as a bulk reflector for example if a beam is incident from outside die device, or if die waveguide is brought to an end within die device with some distance between die end of die waveguide and die poled reflector. In some cases, however, it may be desirable to produce a curved output phase front from a collimated beam, as in the case of some applications requiring focussing, such as reading data from a disk. By patterning a set of curved domains on die upper surface of die substrate illustrated in FIG. 9, a set of curved domains may be poled into die bulk of die material since the domain inversion propagates preferentially along the z axis. A concave (or convex) set of domains may therefore be formed which create a cylindrical lens when excited by a field. Wedges and more complicated volume structures oriented at an angle to the surface may be formed by die same process. In an alternate method, a z-cut crystal can be used as die substrate if the poling technique causes die domain boundaries to propagate at an angle to the z-axis. For example, titanium (Ti) in- diffusion in a z-cut crystal of lithium niobate produces triangular domains that would be appropriate for reflecting die beam out of the surface of the crystal. The angle of die domains formed by in-diffusion with respect to die surface is typically about 30", so that an input beam incident on die grating will be reflected out of the surface at an angle of about 60° to the surface of the crystal. The output beam may then be extracted with a prism, or from the rear surface (which may be polished at an angle) after a total internal reflection from the top surface. The electrode structure shown excites both an E 3 component, and either an E, or an E ? component. A TM polarized input wave 159 experiences an index change which is a combination of die extraordinary and die ordinary index changes. In FIG. 10 there is shown an embodiment of a switchable waveguide directional coupler. A first waveguide 204 is substantially parallel to a second waveguide 206, over a certain length. While die beams propagate adjacent each other and in a similar direction, their central axes are displaced. The central axes are never brought coaxial so that die waveguides do not intersect. However, die waveguide segments are in close proximity in a location defined by die length of die coupler, so that die transverse profiles of the optical modes of the two waveguides overlap to a large or small extent. The propagation of the two modes is then at least evanescently coupled (which means die exponential tails overlap). The evanescent portion of the mode field is the exponentially decaying portion outside the high index region of the waveguide. The propagation constant associated with a mode of each of the two waveguides is determined by k = 2 m (fl λ in the direction of propagation. The effective index n, ff is the ratio of the speed of light in a vacuum to die group velocity of propagation, which varies according to the mode in the waveguide. The value of n^, is determined by die overlap of die mode profile with the guided wave Structure. Preferably, the width of die two waveguides, and thus the propagation constants of the modes in die two waveguides, are different, so that coupling between die modes is not phasematched when the grating is off. (The index of refraction profiles of die two waveguides may also be adjusted to create different propagation constants.) With die grating off, any input beam 210 in the first waveguide will continue to propagate in that waveguide to form a transmitted output beam 214 exiting die first waveguide 204. When die grating is on, die grating makes up die difference in die propagation constants of the two waveguides so that coupling between die two modes is phasematched, and an in-band output beam 212 exits the second waveguide 206. To optimize die coupling, die grating period Λ is chosen so tiiat the mngm""*'' of the difference of die propagation constants in die two waveguides is equal to die grating constant (widύn an error tolerance). The propagation constants of die two waveguides may alternately be chosen to be equal, so that coupling between die two waveguides occurs when die grating is off. In tiiis case, turning the grating on reduces the coupling between die two guides. The strengdi of the grating determines a coupling constant, which defines die level of coupling between die two waveguides. Along die length of die interaction region of die two waveguides, the power transfers sinusoidally back and forth between the guides, so that coupling initially occurs from die first waveguide to the second, and then back to die first waveguide. The distance between two locations where die power is maximized in a given waveguide mode is. known as the beat length of the coupled waveguides. The beat length depends on die strengdi of the grating. A first electrode 220 and second electrode 222 are positioned on die material surface to create an electric field across the grating region 202 when a voltage is applied between the two electrodes. A voltage source 226 is connected to die two electrodes with an electrically conductive material 224. The strengdi of die grating, and thus die beat length between the two waveguides, is controlled by (he voltage applied across die grating. The propagation constants of the two guides are strongly dependent on wavelengdi. Since the momentum of die virtual photon is essentially or dominandy fixed (i.e. determined by parameters which are not varied in an application), power is transferred to the second waveguide only in die vicinity of a single frequency with a frequency bandwidth depending on die length of die coupling region. Depending on the grating strengdi, an adjustable portion of die in-band input beam exits the second waveguide as the coupled output beam 212, while the out-of-band portion of die input beam exits the first waveguide as die transmitted output beam 214 along with die remainder of die in-band beam. The coupling between the two modes can be controlled electro-optically by several means, including changing die strengdi of die coupling between the modes, increasing the overlap of the modes, or changing the effective index of one of the waveguides. Electro-optically controlled coupling, described above, is the preferable method. In order to couple efficiently between die modes in the two waveguides, the input beam is forward-scattered, which requires die smallest grating period. The coupling grating can alternatively be implemented as a combination of permanent and switched gratings as described above in conjunction with FIG. 2. Here we give a detailed example of how this can be done. After forming die desired periodic domains, die substrate can be chemically etched to form a relief grating with exactly die same period as die poled structure. For die preferred material of lithium niobate, die etch can be accomplished without any further masking steps, since die different types of domains etch at different rates. For example, hydrofluoric acid (HF) causes die -z domains of lithium niobate to etch significantly (> lOOx) faster than the +z domains. Thus by immersing die z-cut crystals in a 50% HF solution, die regions consisting of the first type of domain are etched while die regions consisting of die second type of domain essentially remain unetched. This procedure produces a permanent coupling grating which can be used on its own to produce coupling between die two waveguides. After die electrodes are applied, die poled grating can be excited to produce an additive index of refraction grating which is superimposed on that of the etched substrate. The etch depth may be controlled so that the effective index change induced by die permanent etched grating can be partially or wholly compensated by the electro-optically induced grating when die electrodes are excited at one polarity, while the index grating is doubled at the other excitation polarity. A push-pull grating is thereby produced whereby the grating can be switched between an inactive state and a strongly active state. An etched grating is also useful when die etched region is filled with an electro-optical material, such as a polymer or an optically transparent liquid crystal, with a high electro-optic coefficient and an index close to that of die substrate. Preferably, the filled etched region extends down into the optical beam. When a voltage is applied across die filled etched region, die index of die filler material is also varied around tiiat of die rest of die waveguide. Alternately, die overlap of the modes in die two waveguides can be electro-optically modified. For example, the region between die two waveguides could have its refractive index raised. This reduces die confinement of die waveguides, and spreads the spatial extent of die individual modes towards each other, increasing die overlap. To implement this approach, the region between the two waveguides may be reverse poled with respect to die polarity of the substrate traversed by die waveguides. If die electrode extends across both die waveguides and die intermediate region, an applied voltage will increase die index of die area between die waveguides while decreasing die index witiiin die two waveguides. The resulting reduction in mode confinement thus increases die overlap and die coupling between die two modes. Care must be taken not to induce undesirable reflections or mode coupling loss in die waveguides, which might occur at the edge of die poled region. These losses can be minimized, for example, by tapering die geometry of die poled regions or of die electrodes so tiiat any mode change occurs adiabatically along die waveguide, minimising reflections. An adiabatic change means a very slow change compared to an equilibrium maintaining process which occurs at a definite rate. In this case, it means the change is slow compared to die rate of energy redistribution which occurs due to diffraction within the waveguide and which maintains die light in die mode characteristic to the waveguide. A tiiird means to change the coupling between die two waveguides is to change die effective index of one of die waveguides relative to die other. Thus, die propagation constant of the guide is changed, which in turn alters the phasematching condition. This effect may be maximized by poling one of the waveguides so tiiat its electro-optic coefficient has the opposite sign from that of die other waveguide. In uiis case, die coupling grating may be a permanent or a switched grating. A first electrode covers both waveguides and the region between them, while a second electrode may be disposed on both sides of the first electrode. An electric field applied between die two electrodes causes die propagation constant of one waveguide to increase, and that of die other waveguide to decrease, thus maximizing the difference in propagation constants. The grating coupling process is maximally efficient only at a particular difference in propagation constants. By tuning die applied voltage, die phasernatching may be adjusted as desired. This effect can be used to create a wavelengdi tunable filter. The parallel waveguides shown in FIG. 10 may be nonparallel, and die waveguides may not even be straight. If it is desired, for instance, to spatially modify die interaction strengdi between die waveguides, this end can be accomplished by spatially adjusting die separation between the guides. These modifications may also, of course, be applied to die subsequent embodiments of parallel waveguide couplers described herein. Referring to FIGS. 12 and 13 there are shown alternate embodiments of die crossing waveguide coupler for controlling die profile of die reflected beam. In each embodiment, the area covered by the grating does not extend entirely across die intersection region of die two waveguides. The motivation for these grating structures is best understood with reference to FIG. 11. Depending on how it is configured, the power coupling structure 282 may distort the spatial profile of die mode 284 it couples into die output waveguide. A power coupler which is uniform in space and which uniformly covers the entire intersection region 280 between two waveguides disposed at a large angle to each other such as 90° will produce an output beam profile such as assymmetric profile 286. The power in die input beam decreases as it passes through die power coupling structure or grating. In die case of a right angle intersection, the near field profile of die reflected beam matches die monotonically decreasing power in the input beam. The disadvantage with die nonsymmetric profile 286 lies in single mode structures where only a fraction of the coupled power will remain in the waveguide. Much of die power will be lost from the guide. For single mode devices, a structure is needed which couples power into die Gaussian-like spatial configuration 288 of the lowest order mode of die output waveguide. To accomplish this goal, die region 282 must be extended out into die evanescent tails of die guided modes, and die net interaction must be modulated, either geometrically or by spatially adjusting die local strengdi of die power coupling grating. FIGS. 12 and 13 show ways to accomplish this end with geometrical arrangements of gratings. It is also possible to accomplish this end by spatially modulating die "duty cycle" of the grating within die power coupling region 282, by changing die order of die grating in selected regions, and in die case of electrically controlled coupling, by tapering die strengdi of die applied electric fields (by adjusting electrode spacing as illustrated in FIG. 6, or by adjusting die electrode duty cycle in die case of grating electrode structures). The duty cycle of a grating means die fraction of each period which is occupied by a given domain type; die duty cycle may vary with position. hi FIG. 12, a device 300 with a modified grating structure is shown, in which the grating area 310 covers part, but not all of die rectangular intersection region of die two normal guides 316 and 318. Witii the grating unactivated, die input beam 302 passes through guide 316 undeflected to exit as output beam 308. The dimensions of die intersection region match die widths 304 and 305 of die two waveguides. The presence of a small region of power coupling structure at any point in the intersection region will result in local coupling between a given transverse segment of die beam profile in an input waveguide into a given transverse segment of die beam profile in an output waveguide. The reflected beam profile is constructed from the propagated sum of these phased-coupled contributions. The grating region 310 depicted is triangular in shape, with die points of die triangle 311, 312, and 313. The shape of the grating region can be modified from die triangular, and the local grating strength can be modulated. The exact shape of die grating region which optimizes single mode coupling characteristic between the waveguides can be calculated with an established waveguide propagation technique, such as the beam propagation method. A further embodiment of a single-mode coupling grating device 340 is shown in FIG. 13. The grating region 350 is a double convex shape, with one point at corner 351 common with waveguides 346 and 348 and beams 330 and 342, and the other point on opposite corner 352, common with both waveguides and beams 342 and 332. This structure has die advantage of reflecting most of the power in die middle of die beam, where the optical intensity is die highest, and thus better couples the power between die lowest order modes in die two waveguides 346 and 348. The optimal shape of the grating region again depends on die coupling constant of die grating. Referring to FIGS. 12 and 13, a first electrode 320 is disposed on the same surface of die substrate as die waveguide, over die grating region, and a second electrode 322 is disposed on die same surface around the first electrode. The distance between die two electrodes may be constant as illustrated in FIG. 13, or it may be tapered as illustrated in one dimension in FIG. 12. A voltage control source 324 is connected with two wires 326 to die two electrodes. An electric field can thus be applied through the grating region to activate one of die electro-optic coefficients and change die coupling between the input beam and the output beam. For purposes of illustration, FIG. 12 also shows a tapered input waveguide segment 287 and a tapered output segment 289. An input beam 285 expands adiabatically through the tapered segment 287 to increase die intersection area and thereby increase die total reflection from grating 310. The grating is capable of reflecting die now-expanded beam 285 toward the output beam 308. If desired, the output waveguide may also contain a tapered segment 289 to reduce die witdth of the output beam. (Alternatively, die output beam may be kept wide if desired for later beam switching interactions.) The grating may extend beyond the intersection region of the two waveguides. A grating extended along die input waveguide enables residual transmitted light after the intersection region to be removed from the waveguide, typically into radiation modes. The extended grating minimizes crosstalk between optical channels in switching arrays, in which an individual waveguide may have more than one signal channel propagating along its length. Specifically contemplated by die invention is a means for tuning die grating. Several embodiments in which tuning is achieved are shown in FIGS. 14-17. Referring to FIG. 14, there is a bulk optical device 400 in which die strengdi and center wavelengdi of a normal incidence reflection grating are controlled by a single voltage source 426. This device consists of a patterned poled grating region 410, which is electro-optically activated by two electrodes 420 and 422 on opposing surfaces of die material and connected to 426 by conductors 424. The strengdi and die center frequency of the grating are tuned simultaneously by applying a single voltage between die two electrodes of die device. The average refractive index of die grating changes with die applied electric field, causing a change in die center wavelengdi of die grating that is proportional to die electric field. The average index is calculated over a single period of die grating in a periodic grating, by summing die weighted index changes in die various types of domains. The weighting factor is die physical length 416 and 418 of each domain type, along die optical path of die input beam 404. The condition for frequency tuning is that die weighted sum must not equal zero so that die average index changes as a result of the electric field. The product of die index of refraction and die physical distance traversed by an optical beam is known as die optical distance. (The index of refraction is replaced by die effective index of refraction for waveguide devices.) A 50% duty cycle is obtained in a grating with two types of domain if the average optical distance across die two types of domains is substantially equal (approximately equal within die error range determined by the needs of die application). The average is taken over many subsequent domains to allow for die possiblity of a chirped, nonperiodic, or other more general type of grating. In general die domains may have different indices of refraction as well as different electro-optic coefficients. The general condition for tuning is expressed in terms of the physical distance travelled in die different types of domains. For each domain, the total optical phase advance is given by die optical' distance travelled (times 2τ/λ). However, die change in die phase advance is given by die product of die applied electric field, die appropriate electro-optic coefficient, and die physical distance (times 2τ/λ). The average change in index of refraction experienced by die wave is equal to sum of the changes in phase advance in all domains traversed by die optical wave within a section of the material of length I (times λ/2τf ). This change in average index determines die change in die peak interaction wavelengdi according to δλ/λ »■ δn/n. The grating strength is changed simultaneously with die wavelengdi in this structure, but such simultaneous change may be undesirable. The structure may be designed so that the operating point about which tuning is accomplished maintains a sufficiently high grating strength for die application across the entire wavelengdi tuning range. Or, a separate tuning structure may be used as is described below in reference to FIGS. 16 and 17. The change in die average refractive index can be achieved by many different means. One alternative is that of randomly non-electro-optically active domains 414 alternating with electro- optically active domains 412. The electro-optically active regions are poled domains, while the non- electro-optically active domains may be randomly poled or unpoled or radiation-disabled. Thus, the electric field causes an average increase in die index Δn,,. across die grating. In die poled-random configuration of FIG. 14, An 1Ui is equal to die product of die index change in die active domains 412 times the duty cycle. The duty cycle is equal to die length 418 divided by die sum of die lengths 418 and 416. The taxability tiiat can be achieved using this technique is XΔn.^/n in a poled-random structure, where λ is die optical wavelengdi, and n is die original (effective) index of die material. Assuming a wavelengdi of 1.55 μm and a 10 V/μm electric field in litiuum niobate, die tuning range for a 50% duty cycle structure is 1.1 tun. When die input beam 404 is wiuϋn die bandwidth of die grating, die grating couples the beam into a retroreflecting output beam 402; otherwise the input beam forms a transmitted output beam 406. Contrast this behavior with that of a 50% duty cycle grating where die two domain types have the same electro-optic coefficients but opposite polarity, as in die case of domain inversion. In this latter case, tiiere is no change in die average index of refraction since die change in index of the first domain type cancels with die change in index of die other domain type. A 50% duty cycle domain reversal grating does not tune its center frequency. An alternate means to achieve an average effective index change in domain reversed gratings is to use a non-50 % duty cycle for die poled domain area with unequal lengths 416 ≠ 418. The tunability diat can be obtained using this technique is (2D-l)Δnλ/n, where D is the duty cycle of the largest domain type (D > 0.5). For example, with a 75 % duty cycle, a wavelengdi λ of 1.55 μm, and a 10 V/μm electric field in lithium niobate, die tuning range is 0.54 nm. The domain reversed grating is also stronger than a grating in which the second domain type is not electro-optically active. In FIG. 15, a waveguide device 440 using the same average index effect is shown. a ύϋs case, the average effective index of die waveguide 442 in die grating region 450 changes with the applied electric field, causing a change in die center wavelength of die grating. A voltage control source 466 is used to apply an electric field between a first electrode 460 and second electrode 462, which are preferably placed on the same surface of the material. The average effective index can be achieved by a variety of geometries, including non-electro-optically active domains or a domain reversal grating with a non-50 % duty cycle. When die input beam 445 is within die bandwidth of die grating, die grating couples the beam into a retroreflecting output beam 444; otherwise the input beam forms a transmitted output beam 446. A means to enhance the tunability of a grating in a waveguide device 480 is to overlay a second electro-optic material 482 on die waveguide to form a cladding, as shown in FIG. 16. The cladding should be transparent to the wave propagating in the waveguide and it should be electric field-sensitive to enable adjustable modification of its index of refraction. The average effective index is determined partly by die index of refraction of the cladding. The second material may have a higher electro-optic coefficient than die substrate. Liquid crystals and polymers are good examples of materials which can be used as cladding. The index of the cladding is preferably close to tiiat of die guiding region so that a large portion of the guided beam propagates in die cladding. For this embodiment, a first electrode 502 is surrounded by a second electrode 504 on die substrate, for applying an electric field across die poled grating 490. Preferably, die electrodes are placed below the cladding, directly on die substrate. If die first electrode 502 is positioned directly above die waveguide 484 as shown in FIG. 16, it must be made of an optically transparent material. The electrodes may also be disposed to either side of die waveguide 484, in which case they need not be transparent. A third electrode 506 is positioned on top of die cladding, above die waveguide and die first electrode. For this embodiment, die center wavelengdi and strengdi of the grating are separately controllable. The grating strength is controlled by a first voltage source 510, connected by two wires 513,514 to die first and second electrodes, while die center wavelengdi of die grating is controlled by a second voltage source 512, connected between die first and third electrodes with two wires 514 and 515. In an alternate electrode configuration, only two electrodes are used, both of which are preferably positioned on top of the cladding material so tiiat their induced field penetrates both die cladding material above the grating, and the grating structure itself. A single voltage source then controls both die center wavelengdi and die grating strengdi, but not independently. The amount of tunability that can be achieved with an electro-optically active cladding depends on what portion of the guided beam propagates in the cladding. If die two indices are relatively close so tiiat 10% of the beam propagates in the cladding, then die average change in die effective index of die guided mode is equal to 10% of die change in index of die cladding. For a cladding index change of 0.1, die tunability is on die order of 7 run. FIG. 17 shows an embodiment of a discretely tunable grating device 520, which consists of several individually controllable gratings 530, 532, 534. The gratings in series, with all gratings in the path of die input beam 522, and forward 523 and reflected 524 beams. Each individual grating in the structure may also be continuously tunable over a small range. Each grating in FIG. 17 has a first electrode 542 and a second electrode 544, which are connected to a voltage controlling network 552 witii wires. The gratings can be switched on one at a time, so mat only one wavelengdi in a small passband will be reflected at a time, or multiple gratings can be switched on simultaneously to create a programmable optical filter, with a center wavelength and bandwidth which are separately controlled. The gratings themselves may be implemented with die variations described above, including die possibility of multiple periods in each grating. The structure can be realized either in die bulk or as a waveguide device. In die latter case, an optical waveguide 528 is fabricated on die substrate so that die waveguide intersects die poled gratings. The poled domains 536 may extend only through die waveguide and do not necessarily extend all the way through the material. Both electrodes are preferably (for higher field strength) deposited on the same face of the substrate as the waveguide. The second electrodes of all die gratings may be connected as shown to minimize the number of electrical connections. Alternately, die individually-addressable grating structure can be a bulk device, in which case the waveguide 528 is omitted, and the poled regions 530, 532 and 534 are optimally fabricated witii sufficient depth to overlap with die propagating optical mode. The two electrodes for controlling each grating are then optimally positioned on opposing faces of die material to optimize die field penetration, as shown for example in FIG. 2 for a single grating. Cross excitation between adjacent gratings caused by fringing of the electric fields between die electrodes can be minimized by separating die grating-electrode groups by an amount comparable to the substrate thickness, or by adding interspersed fixed-potential electrodes. An alternate means for tuning die grating is to vary die temperature of die active material. The tuning occurs because of two effects: thermal expansion and die thermo-optic effect. For different materials, eitiier one of these two effects may dominate thermally induced tuning. In lithium niobate, die larger effect is thermal expansion, for which the largest (a-axis) expansion coefficient ΔL/L is 4- 14 x 10 β C\ while die thermo-optic coefficient for the ordinary axis ΔnJn is +5.6 x 10"* °C'. For a temperature range of 100 °C, die combination of these two effects gives a total wavelength tuning range of 2.6 mo. For many purposes, it is desirable to create poled gratings with a generalized frequency content. Multiple interaction peaks may be desired for example, or simply a broadened bandwidth of interaction. To accomplish this end, some way is needed to determine the pattern of poled region boundaries which corresponds to a given mathematical function containing die desired frequencies. FIG. 18 illustrates the results of the process in the case of a single frequency containing arbitrary phase shifts. Referring now to FIG. 18, optical phase shifts 564 and 565 can be incorporated at one or more positions along a sinusoidal function 560 to modify its wavelengdi structure. The mean level of the function is given by die straight line 561. Also shown is the corresponding squared wave function 562 with identical phase shifts, as can be achieved by a typical poling process. To achieve die translation of the continuous function into the square wave function, die regions 570 where the curve 560 exceed die average 561 sine wave corresponds to one type of domain, while die regions 572 where die curve 560 falls below 561 corresponds to a second type of domain. The Fourier transform of die square wave curve 562 will have the same frequency components as die transform of the sinusoidal function 560 in die low frequency range below die harmonics of the sine wave frequency. This approach works for any type of generalized frequency distribution as long as the bandwidth does not exceed a small fraction of die carrier frequency. A phase shifted grating may be implemented in any of the devices described herein such as in FIG. 2 for example, where die location of die domain walls 34 in die grating 22 can be determined by the pattern 562 of FIG. 18 rather than a periodic function. The phase shifted pattern can be controlled widi a poling mask incorporating die desired pattern. Arbitrary multiple period gratings can be specified using a similar technique. Each period present in die grating is represented in a Fourier series (or integral) by a corresponding sign wave of the desired amplitude. All waves are added together to form a resultant wave. The positive portion of the resultant wave corresponds to one type of domain, while die negative portion corresponds to the second type of domain. The number of superimposed gratings can in principle be scaled up to any number, limited in practice by die minimum attainable feature size. FIG. 19 shows an alternate way of fabricating a superimposed multiple-period grating device 580. A two grating waveguide structure is depicted, with a switchable single period poled grating 582, and a permanent relief grating 584 interacting with a single beam in a waveguide. A coating 588 is shown deposited on top of the relief grating to reduce die loss which occurs when die evanescent tail of die guided wave mode overlaps with the metallic electrode. This coating is an important design optimization element for all of the elements described herein, and should be applied between each electrode structure and adjacent optical waveguides. A coating is also useful above the electrodes in all of die elements described herein to reduce die probability of breakdown. The electrically controllable gratings in the superperiod structure are switched by a single pair of electrodes 602 and 604, connected by wires 606 to a voltage control source 608. The first electrode 602 is preferably centered over die waveguide, while die second electrode 604 runs parallel to the first, on either side of die waveguide. The device depicted is a waveguide device, with a waveguide 586 confining die input beam 590, as well as die transmitted output beam 592 and the reflected output beam 594. The multiple period grating structure can be configured in many ways. For example multiple independent peaks in die frequency spectrum can be useful as a multiple frequency feedback mirror. Two operations (e.g.., phasematching and reflection) can be achieved in a single grating which incorporates the proper two periods for enabling die processes. As a final example, die grating can be fabricated witii die phase and amplitude of its components adjusted for equal effect on die two polarization modes, making a polarization insensitive component. Anodier useful modification of a periodic structure is a chirped period. Along the length of the grating structure, die period can be gradually increased or decreased, so that die center wavelengdi varies from one end of the grating to the other. Thus, die wavelengdi bandwidth of the grating is broadened over that of a constant period grating. The chirping across the grating is not necessarily linear: many different wavelengdi reflection profiles in frequency space (e.g.., square wave, Lorentzian) can be achieved, depending on the variation in the chirp rate. As described above, die duty cycle and or the strengdi of die exciting electric field can also be spatially adjusted to modify die strengdi of different portions of die chirped grating. The duty cycle of the grating can be controlled by die mask as desired. The electric field strengdi can be controlled by adjusting die separation of die electrodes as shown for instance in FIG. 6. A wide spectrum tunable device can be realized in a structure containing two separate gratings which have a multiple peak structure, as shown in FIGS. 21 and 22. FIG. 20 demonstrates the basic principle of these devices and depicts die multipeak comb transmission (or reflection) profiles 620 and 622 as a function of die optical frequency for two such gratings. The first grating profile 620 has transmission peaks separated by a first period 626, while die second grating profile 622 has peaks separated by a second period 624 tiiat is slighdy different from die first. The key idea is for die device to operate only at a frequency determined by die overlap of peaks from both curves (frequency c,). Tuning is achieved by tuning die comb of transmission peaks of die gratings with respect to each other. Different transmission peaks in die two combs will overlap each otiier in various ranges of die relative frequency shift, so that the net transmission of die combined gratings jumps discretely over a much wider wavelengdi range than can be achieved with only tiieπnal or electro-optic tuning. In die example of FIG. 20 where die peak separations differ by 10%, if the frequency of die first grating is increased by 10% of die frequency separation 626, the next higher frequency peaks will superimpose, resulting in an effective frequency shift ten times larger titan die tuning amount. In FIG. 21, a guided wave embodiment of die device is shown, in which two gratings 650 and 652 are placed over a single waveguide 642. An input beam 644 is partially reflected into beam 643 and transmitted as beam 645. A first electrode 666 and second electrode 668 are positioned around die first grating 650 so that a first voltage source 662 connected to die electrodes activates that grating. A third electrode 664 is positioned, along with die second electrode, around die second grating 652. The second grating is controlled by a second voltage source 660 connected to die second and third electrodes. In the preferred embodiment, each grating is a multiple peak structure as described in FIG. 20, and the device forms a frequency-hop-tuned reflector. According to die curves of FIG. 20, the gratings are configured as broadband reflectors, reflecting essentially all die incident radiation frequencies except a comb of equally spaced frequencies where die transmission is high. The cascaded gratings will therefore reflect all frequencies in the frequency range illustrated in FIG. 20, except where die two transmission peaks overlap at r,. Provided that the reflections of the two gratings are arranged to add in phase in the reflected beam 643, the transmitted spectrum will be essentially equal to die product of die two transmission curves 620 and 622. When die center frequency of one of die gratings is tuned, the single transmission peak at c, will hop to die next adjacent peak, and then die next, and so on. Such a structure is particularly useful as an electrically tuned receiver in, for example, a wavelength-division-multiplexed (WDM) communication system. The receiver can be configured to detect only incoming light in a specific band, while being insensitive to light at other frequencies. As seen above, a grating structure can be shifted by about 0.5 nm, assuming a 10 V/μm field in a domain inverted grating with duty cycle of 75 % . This continuous tuning range can be used to produce discontinuous dining in the structure 640 across perhaps 100 bands in a 50 nm range, if the width of the individual frequency peaks 628 are narrower than about 1/lOOth of die frequency separation. Note tiiat if die frequency of die input light is known to lie only within die tamsmission bands of curve 620 in FIG. 20, for example, die device can be realized with only a single grating structure with the transmission spectrum of curve 622, using essentially die Moire effect. By tuning die center frequency of the spectrum 622, any one of die desired bands can be selected while reflecting die rest. The tee structure of FIG. 7 is then particularly interesting in this context: die input beam 112 containing multiple frequency components is then split by die grating structure 100 (configured for tuning as described herein) into a single transmitted beam 116 which can be detected or otherwise processed, and a reflected beam 114 which contains all die otiier frequency components. The power contained in beam 114 is not lost, but can be routed to otiier nodes in a communications network, for example. Other variations can be formed of this basic structure, wherein, for example, the spectra of FIG. 20 are the reflection curves of the individual gratings instead of die transmission curves. In this case, the structure acts as an etalon when die frequencies of die reflection peaks align witii each other, with reflectivity according to the relative phase of the reflected waves. Otherwise, die net reflection of the compound structure is essentially the sum of die reflection curves of die two individual structures. It may be important to optimize die relative phase of the two reflections by adjusting the optical path length 653 between the two gratings. The relative phase can be controlled by using an dectro- optic structure (as shown for example in FIG. 22) between the two grating entrances 654 and 655 to adjust the optical path length 653. For a lithium niobate crystal and an input wavelengdi of 1.5 μm, an activated distance between the gratings of at least 250 μm is required to adjust the relative phase between the two beam of up to ±x, (using a z-axis applied field of 10 V/μm). The strengdi of one of the gratings (but not its frequency) may optionally be controlled via a field applied at its electrode if die grating is not designed for taming (its average index of refraction is configured to be independent of the applied voltage). If botii gratings are tuned together, narrow range continuous tuning results. As an alternative or supplement to dectronic excitation, the phase of the two reflections and die peak wavelengths of the gratings can all be varied together through tiiermal or mechanical control of die chip. FIG. 22 shows schematically two grating reflectors 633 and 634 separated by a phase shifter section 635 and forming an integrated etalon 640 having a characteristic free spectral range (FSR). (The structure 630 is essentially die same as that of FIG. 21, with the addition of die phase shifter section, which consists of electrodes capable of actuating a region of electro-optic material traversed by the waveguide 636.) For simplicity, we consider die case of uniform single-period gratings, but die individual gratings may generally be more complex structures. The gratings may be fixed or electronically actuatable. The reflections off die two gratings can be made to add in phase for a beam at a reference frequency by adjusting the voltage applied to die phase shifter section 635. A beam at a second frequency will also add in phase if die frequencies of the two beams are separated by a multiple of die FSR. Since the FSR is inversely proportional to die optical path lengtii between the two gratings, choice of me path length determines die density of the reflection peak structure of die etalon device. As an example, two short high reflecting gratings separated by 220 μm in lithium niobate can have grating reflection peaks separated by a multiple of 1 nm. The multiple peak structures 620 or 622 described in FIG. 20 can each be implemented as an integrated etalon. A dual grating wye junction embodiment is shown in FIG. 23, in which die two gratings 690 and 692 extend across two separate waveguides 682 and 684. In general a wye junction has an input and multiple output waveguides which may lie in a plane or in a volume. The two waveguides are connected to the first waveguide 686 with a wye junction 688. The power in die optical input beam 691 is split between the second waveguide 682 and third waveguide 684 so that approximately 50% of the input beam 691 is incident on each of die gratings. The two gratings may have a simple reflection structure, or they may have a series of high reflection peaks. The gratings may be permanent, or tiiey may be dectronically adjustable, in which case electrodes 694 and 696 are provided for exciting die gratings. A common dectrode 698 is then provided across die wafer (or alternately on die same surface as die waveguides, adjacent to die otiier electrodes similarly to FIG. 21). The relative optical path lengtii of the two branches of die waveguide can be adjusted by the dectrode 689 which is disposed on one waveguide over a region of electro-optic activity. By adjusting the voltage on the phase adjusting dectrode 689, die two reverse-propagating reflected beams may be adjusted to have the same phase when mey meet at die wye junction. The reflected modes superpose and form a wave front profile which may have a phase discontinuity in the center, depending on the relative phase of the two waves. As die combined wave propagated, die spatial concentration of die optical mode in die region of the guide is strongly affected by die phase shift. If they have the same phase, die profile forms a symmetric mode which couples efficiently into die lowest order mode of die input waveguide to form the retroreflected output beam 693. Two reflected beams which add out-of-phase at die wye junction will have very low coupling into any symmetric mode (such as die lowest order mode) of waveguide 686. If die waveguide 686 is single mode, this reflected energy will be rejected from the waveguide. Thus, by adjusting the opticd path length of one of the arms of the wye witii die electrode 689, die reflection can be rapidly adjusted from almost 100% to a vdue very close to zero. Furthermore, if the gratings are implemented as electronically tunable reflectors in one of die tunable configurations described herein, die modulated reflection property can be shifted into different regions of the spectrum. Referring to FIG. 24, there is shown a switchable waveguide mode converter 720 using a poled grating 722. The waveguide 730 preferably supports both an input mode and an output mode, which may be two transverse modes or two modes of polarization (e.g. TE and TM). The two modes in the waveguide typically have different propagation constants, which are determined by the effective indices of die modes. The grating 722 is excited electrically by electrodes 740 and 742, coupled to the source of electrical potential 744 by the connections 746. The grating period Λ (724) is chosen so that the m*gm lA » of the difference of die propagation constants in the two waveguides is equal to die grating constant 2τn/Λ. When the grating is on, the grating makes up the difference in the propagation constants of the two waveguides so tiiat coupling between die two modes is phasematched. The grating strengdi and the device interaction lengtii in the grating should be set to optimize die flow of power from die input mode into the output mode. The net rate of power conversion from one mode into die other is determined by the strength of the electro-optic coefficient (r 31 in lithium niobate) and by die strengdi of the electric field. For two transverse modes, die coupling depends on die spatial overlap of the two modes in die presence of die grating structure, and on die strengdi of die grating. The two modes may be orthogonal by symmetry, so tiiat even if die modes are phasematched, there will be no conversion in a symmetric structure. In this case, die phasematching structure itself can be made asymmetric to eliminate the problem. In the preferred embodiment of FIG. 24, die asymmetry can be introduced via die electric fields which excite the poled structure. The vertical component of die electric field reverses sign midway between the two electrodes 740 and 742. It is best to center die electrodes on the waveguide to optimize mode conversion between transverse modes of different symmetry. The reverse is true when coupling transverse modes of the same symmetry: now the phasematching structure should be made symmetric to optimize the conversion. Several alternative approaches can also be used. A three electrode structure has a symmetric vertical component of the electric field and an asymmetric horizontal field. The horizontal field can be used in conjunction witii one of die horizontally-coupled electro-optic coefficients to couple modes of different symmetry. Or, the poled structure may have a phase reversal plane that essentially bisects the waveguide, in which case a symmetric component of the electric field can be used to couple modes of different symmetry (vertical field in die case of three electrodes, horizontal field in die case of two). Since the propagation constants of die two modes are strongly dependent on wavelengdi, the beat length of their interaction also depends on die wavelengdi. Thus, for a given lengtii of the coupling region between the two modes, die power coupled into the second mode is frequency-sensitive. The coupling has a frequency bandwidtii associated witii it. For a given grating strength, a portion of die in-band input beam is coupled into the output mode which exits as die coupled output beam, while die remainder of the input beam exits the first waveguide as die transmitted output beam. The structure shown in FIG. 24 can also be used to couple between TE and TM polarized modes. The electro-optic coefficient r 5I enables coupling between the two orthogonal polarizations in a lithium niobate crystal, for example. As before, the period of die grating is chosen so that the grating constant is equal to die difference in propagation constants between the two modes. The interaction length is chosen to optimize die power transfer. A waveguide, such as a titanium-indiffused waveguide which supports botii TE and TM modes, is used in applications where both polarizations can enter or leave the converter. A waveguide such as a proton exchanged waveguide which supports only one polarization (TM in z-cut lithium niobate substrates or TE in x- or y-cut) can be useful in applications where only a single polarization is desired. Such a one-polarization waveguide can act as a very effective filter for the other polarization. The wrong polarization component will rapidly disperse away from die waveguide due to diffraction, leaving only the guided polarization in the waveguide. For example, the proton exchanged output waveguide 731 may act to guide only die input polarization or only die output polarization, as desired. This device can be used as an opticd modulator witii excellent transmission and extinction if the grating coupling is strong, and the interaction length and electric field are selected correctly. A modulator configured witii a proton exchanged waveguide will transmit essentially all of die correctly polarized input light, and produce very low transmission of light which is coupled into the perpendicular polarized mode. Alternately, the input waveguide may be titanium-inώ ' ffused to accept either polarization at die input. The index profiles that form the waveguides for die two beams are preferably similar so that die profiles of die TE and TM modes overlap well, and die coupling efficiency is maximized. To activate the r sι coefficient, an electric field is applied dong the Y or the X axis of the crystal. The electrode configuration that will achieve die appropriate field direction depends on the cut of the crystal. For a z-cut crystal with a waveguide oriented dong die x axis, die first dectrode and second dectrode can be placed on either side of die waveguide. Alternately, for a y-cut crystal with a waveguide oriented dong the x axis, the first dectrode can be placed directly over die waveguide, witii the second dectrode on dther side of the waveguide, parallel to die first electrode. Since the poled domains in die grating 722 can be made to extend tiirough a bulk substrate (such as 0.5 mm thick or more), die structure of FIG. 24 is also useful for a controllable bulk polarization converter. In this case die waveguide 730 is unnecessary, and die electrodes are optimally configured on dther side of a thin bulk slab of poled material. Referring to FIG. 25, tiiere is shown a switched beam director 700 incorporating a wye power splitter 702 and a transverse mode converter 704. The mode converter works in a similar way to the transverse mode converter described above in relation to FIG. 24. The grating structure 706 phase match** energy conversion from the lowest order (symmetric) mode incident in waveguide 708 into die next higher order (antisymmetric) mode of die waveguide. The length and strengdi of die interaction region where die waveguide and die grating structure overlap are chosen to convert approximately half of die input single symmetric mode power into a higher order antisymmetric mode. Furthermore, die opticd path length between the grating mode converter section 704 and die wye splitter 702 is chosen so that the phase of die two modes adds constructively at one of the branches 712 of the wye and destructively at the other branch 713. The result is that die power is routed primarily into the waveguide 712 with the constructive interference, witii very little power leakage into die otiier waveguide 713. In this condition, any reverse propagating power in die guide 713 is essentially excluded from coupling into a reverse propagating mode in die guide 708 after die mode coupler 704. The device forms an efficient power router in the forward direction and an isolating structure in the reverse direction. By adjusting the opticd path length between die grating mode converter section 704 and die wye splitter 702, it is possible to switch the output power from guide 712 to guide 713. This is done by adjusting die relative opticd path length for die lowest order mode and die higher order mode so that the two modes slip phase by τ relative to each other, now producing constructive interference in die guide 713 and destructive interference in die guide 712. The relative path lengtii adjustment can be achieved in the path lengtii adjustment section 705 by exciting the electrode pair 711 and 709 with die voltage source 714, changing die index of refraction under the electrode 711 via die electro-optic effect in the substrate 703, which is preferably lithium niobate (but may be any electro-optic material with transparency for die waves such as lithium tantalate, KTP, GaAs, InP, AgGaS 2 , crystalline quartz, etc.). The propagation distance of the waveguide 708 under die electrode 711 is selected, dong with die excitation voltage, to enable changing die relative phase of the two modes by at least the desired amount. The grating 706 may be a permanent grating fabricated by any of the techniques known in the art. However, to optimize the functioning of die device, it is desirable to have dmost exactly equd power in die symmetric and the antisymmetric modes. It is difficult to achieve sufficient control in existing fabrication techniques to achieve this god, and it is therefore desirable to have some adjustment in die grating strengdi. This adjustability can be achieved witii the use of at least some poled grating sections, excited by the electrodes 709 and 710, which are driven by the power supply 715, and which can be used by themselves to accomplish die desired mode conversion, or to adjust the strengdi of a combined poled- permanent grating. The input waveguide 708 is best implemented as a single mode waveguide incorporating a (preferably adiabatic) taper 701 to permit guiding of die two modes between the transverse mode coupler 704 and the wye splitter 702. The waveguides 712 and 713 are botii preferably single mode. While any order modes may be used in die device as long as their symmetry is opposite, it is most desirable for mterconnection purposes to work with die lowest order mode at die input and output legs. The intermediate excited mode is less critical, and could be, for instance, a higher order antisymmetric mode. FIG. 26 shows a parallel waveguide switchable resonator 750 in which an input waveguide 752 is coupled to a parallel waveguide 754 dong an interaction region 753. Grating reflectors 755 and 756 are disposed across die waveguide 754 in such a way as to retroreflect light propagating in die guide. The pair of separated reflectors and die waveguide 754 form an integrated etalon coupled to the input waveguide 752. The lengtii of the coupling region 753 and die separation of the parallel waveguides in die coupling region are chosen so tiiat a certain desired fraction T of the input beam 757 is coupled into the waveguide 754. The light coupled into the etalon structure 754, 755, and 756 resonates between the reflectors 755 and 756, and couples out into two prinicipal output channels: die forward propagating wave 759 and the reverse propagating wave 758 in waveguide 752. The same fraction T of die power circulating in die etalon couples into each of die two output channels 758 and 759. As for any etalon, die integrated etalon has a frequency acceptance structure comprised of multiple peaks in frequency space witii width dependent on the loss of die resonator, and separation equal to die free spectral range. If the opticd frequency of die input beam 757 matches one of these resonant frequencies, the power circulating in die etdon will build up to a value P^ determined by P, . = where P.. is die incident power 757 in die waveguide 752, T is the loss of the etdon not including die output coupling into die forward propagating wave 759 and die reverse propagating wave 758 in waveguide 752, and we have assumed weak coupling and low loss. The output coupled wave from die etalon which propagates in die reverse direction in waveguide 752 forms the reflected wave 758. The reflected power in beam 758 is equal to P., <- P^Al +I72T) 2 on die peak of the resonance. When T ► 172, essentially all of die incident power is reflected. The output coupled wave from die etdon which propagates in the forward direction in waveguide 752 is out of phase (on a cavity resonance) witii the uncoupled portion of die input wave 757, and die two beams destructively interfere, producing a low amplitude output beam 759. Because the two beams have unequal amplitude, the residual power P a .. = P hβ (1 +2T/T) 2 in the output beam 759 is not quite zero, but it can be very close. If the coupling T is made very large compared to die loss T of die etdon, die transmission of die device is greatly suppressed (by 26 dB if T = lOJT). This structure then acts as a very low loss reflector at a comb of frequencies separated by die FSR. The device can be switched by changing the opticd patii lengtii between die two reflectors 755 and 756. Electrodes 761 and 762 are disposed to produce an electric field through due waveguide 754 between the mirrors 755 and 756. The electrodes are excited with a voltage source 763, changing the effective index of the substrate under die dectrode 761 via the electro-optic effect, thereby changing the opticd path length between die mirrors and shifting die resonances of die integrated etdon. If the resonances are shifted by more than either the width of die resonances or die frequency bandwidth of the incident beam, the reflection will drop to zero, and the transmission will rise to essentially 100% as die circulating power within the etdon is suppressed to approximately P f a.T/4. The gratings 755 and 756 may be permanent gratings, or they may be poled gratings excited by dectrodes as shown in previous diagrams and discussed above. If the grating 756 is a poled grating, the device may also be switched by switching it off. With grating 756 off, i.e. not reflecting, the loss to the incident wave 757 is equal to die coupling constant T, but now die comb structure is eliminated instead of just being frequency shifted as by die electrode 761. The difference in switching function between these two modes of operation may be significant with for example a broadband input signal where it is necessary to switch off the reflection rather titan just change its frequency. For a single frequency input beam, the reflection can be switched equally well by changing the path lengtii witii electrode 761 or by spoiling die Q of die resonator by switching off die mirror 756. However, if die reflectivity of the mirror 756 is retained and only die frequency spectrum of the etdon is shifted witii die dectrode 761, other frequency components of a broadband input wave would be reflected, and this might be highly undesirable in some applications. The power P . which builds up in the et on can be quite large if T and T are small, and can be useful in applications such as second harmonic generation, for example. In this application, a quasi- phasematched (QPM) periodic poled structure in a section of the lithium niobate substrate is incorporated into die resonator between, say, the mirror 756 and die interaction region 753, or possibly within the interaction region itself. One of die resonant frequencies of die etdon is then tuned to coincide with the phasematching frequency for me QPM frequency doubler. The power buildup which occurs nh nce the frequency conversion efficiency of die device as die square of die buildup factor P tfa JP tao . The high reflection which occurs at this frequency can dso be used to injection lock the pump laser to the desired frequency if die FSR is large enough tiiat the other resonant modes are not injection locked simultaneously. The linear integrated etdon geometry described above in reference to FIGS. 21 and 22 can also be used to accomplish die same purposes. To optimize die power building up in die etdon between die reflectors 755 and 756, die losses in the resonator must be minimized. The coupling of FIG. 26 cannot be "impedance matched", in analogy to the process known in die art of bulk buildup cavities, where the input coupling into the resonator is adjusted to cancel by destructive interference the portion of die incident beam which is not coupled into die cavity. This is die condition of die etdon transmission interference peak. As described above, what happens in the integrated structure is tiiat die transmitted beam can be nearly cancelled while the power builds up in the coupled resonator, but a strong reflected wave emerges. The reflected wave may be eliminated in a ring waveguide structure, as is illustrated in FIGS. 27 and 28. An output 751 proportional to die power circulating within die et on may be taken through the grating 756, if desired, or alternately through die grating 755. In FIG. 27, a three-arm etdon 760 is shown witii an input waveguide 752, a parallel waveguide coupling region 753, a ring resonator formed by three waveguide segments 764, 765, and 766, three grating reflectors 767, 768, and 769. The opticd path lengtii adjustment section formed between the dectrodes 761 and 762 is optional. The grating reflector 767 is disposed to optimally reflect the power arriving from waveguide 764 into die waveguide 765. In a single mode system, the spatid configuration of the grating (and its dectrodes if any) is designed to couple from die lowest order mode of waveguide 764 into the lowest order mode of 765. The gratings 768 and 769 are similarly configured to optimize the power flow from waveguide 765 into waveguide 766, and then into waveguide 764 again, forming a Fabry- Perot resonator with a determinate opticd path lengtii, FSR, opticd loss coefficient, and coupling T with die input waveguide 752. Now, impedance matching is possible, and is accomplished when the coupling coefficient T equals die totd round-trip loss coefficient of the resonator less the output coupling loss, principally in die coupling region 753. If a phase matched frequency doubler is disposed within die resonator, die converted power out of die fundamental frequency beam circulating in the resonator does count as one of die losses in die total round-trip loss. If an input beam 757 is incident on the device with a frequency equal to one of die resonances of die three-arm etdon, power will couple across die parallel waveguide interaction region into the etdon and build up to a circulating power of P*. = P kM T/(T+r) 2 - Because of the ring structure, the power will circulate primarily in one direction, from waveguide 764 to waveguides 765, 766, and back to 764. There is now only a single output coupled wave from the etdon onto the waveguide 752, and it propagates in die forward direction. The output coupled wave interferes destructively with die remainder of die input wave 757, forming a weak transmitted wave 759. The transmitted power P. in die output beam 759 is given by P,,. « / (1 +I7T) 2 , and can be brought to zero if T - T, which is die impedance matched condition. In this case, dl die incident power flows into die resonator. In the impedance mat hff«i condition, die two beams have equal amplitude, and die transmitted power drops to zero. There is essentially no reflected power in beam 758 except for reflections from discontinuities in die waveguide 752, which can be minimized by good design. The grating 767 or any of die otiier gratings may be configured as a switchable grating, in which case die quality Q of the etdon may be spoiled by turning off die grating, eliminating die comb structure entirely but leaving some opticd loss due to power coupled into the waveguide 764. An output beam 751 may be taken in transmission through the grating 768, and/or through the gratings 767 or 769. FIG. 28 shows a ring waveguide etdon 770. As before, die input waveguide 752 is coupled to a waveguide 772 in a parallel interaction region 753. The interaction region 753 includes a grating in FIG. 28 (dthough it is not required) to emphasize tiiat grating coupling is a useful option in die etdon geometry of FIGS. 26, 27, and 28. The waveguide 772 follows a curved closed path (with any geometry including potentially multiple loops with crossings), feeding a portion of die power emerging from section 753 back into die interaction region 753. As before, electrodes 761 and 773 are supplied to allow die opticd path lengtii, and hence die FSR to be adjusted, although in this case they are shown disposed on die same face of die substrate. A straight section 771 is provided where certain critical fimctiond components may be fabricated, according to die application of the etdon structure. If the etdon device 770 is used for frequency doubling, it would be advantageous to insert die frequency doubling structure into a straight section such as 771 of die ring, but provision must be made to couple die frequency converted light out of die ring waveguide. The functioning of the device 770 is otherwise similar to that of die device 760. While the device 760 may consume less surface area on a substrate, the device 770 may have lower opticd loss in die etdon, particularly if die diameter is one cm or larger. The devices 760 and 770 can function as buildup cavities for frequency doubling in which the feedback into die opticd source is minimal. They can also switch the transmission of a given frequency without retroreflection, which is useful in applications including opticd communications. In WDM communications, many communications channels separated by their opticd wavelength may be carried on the same opticd fiber. To detect a channel, die light in die desired wavelength region must first be separated from die remaining channels which are routed to other destinations. This separation function is performed by a channel dropping filter. A channd dropping filter is a communications device which is used in a wavelength division multiplexed (WDM) environment. It is desired to multiplex several channels across a single transmission fiber by carrying die channels on different wavelengths. A critical component in such a system is a channel dropping filter which allows the extraction of a single channd for routing or detection purposes. The ided filter will extract essentially all of the light in a channel with good extinction ratio, so tiiat the same wavelength may be used later in die network without undesirable crosstalk. It must have very low insertion losses for die out-of-band components because multiple channel dropping filters may be installed on any given line. Preferably, it should be switchable so tiiat a channel may be dropped at a destination location, and after the communication is finished, die channel may continue past that location to another destination. The inverse of the channel dropping filter is the channel adding filter which adds a channel to a fiber widiout significantiy affecting die power propagating in the otiier channels. Transmission and reflection filters have been andyzed in detail [HL91, KH087]. Several of die above structures may be used for channd dropping filters, including die devices described in reference to FIGS. 7, 10, 26, 27 and 28. The grating coupled waveguide tee of FIG. 7 is a channel dropping filter with low loss for die out-of-band components. Witii prior art gratings, this configuration has difficulty witii crosstalk, since achieving 99.9% outcoupling for the in-band component requires a very long grating. The coupling strength of our periodic poled gratings is significantly increased over die prior art, due to die ability to use higher order gratings with sharp interfaces which extend entirely across die waveguide. Whereas die prior art is limited to shdlow waveguides to optimize die overlap between die necessarily shallow grating and die waveguide, we are able to use the lower loss waveguide configuration with essentially equal depth and width because our grating structure extends entirely across die depth of die waveguide. This structure can also be used as a channel adding filter. The device of FIG. 10, if die grating is configured as described in Haus et d. "Narrow band opticd channel dropping filters" J. Lightwave Technol. JO, 57-62 (1992), is dso a channd dropping filter. Our contribution in this case is only die poled grating coupling technique, which enables strong coupling between die waveguides in a short distance, and which relieves fabrication difficulties in permitting efficient higher order gratings to be produced. The devices 750, 760 and 770 can be used as channel dropping filters by tuning a resonance of the etdon to the frequency of die channel to be extracted from die input waveguide 752. If die integrated etdon is nearly impedance matched, essentially all the power at die resonant frequency is transferred into die etdon. In die ring geometries of FIGS. 27 and 28, die transmitted and reflected powers in die waveguide 752 can be reduced to any desired level, minimizing crosstalk. The light corresponding to die desired channel is completely extracted (dropped) from die input waveguide, leaving neither reflections or transmissions. In the linear geometry of FIG. 26, some light is lost to reflection, which does not significantly reduce die detection efficiency, but which may cause crosstalk problems in a communications network. The signal carried by die light can be detected by placing a detector over a waveguide segment of die etdon and coupled to die light in die waveguide. Or, die detector can be coupled to one of die output waveguides such as 754 in FIG. 26, 764, 765, or 766 in FIG. 27, and 794 in FIG. 28. In die case of die device 760, die outcoupling can be accomplished by adjusting die reflection of one of the resonator grating reflectors 767, 768 or 769 so that a small portion of the circulating power is coupled out into the continuation segments of the waveguides as shown for output beam 751. Those continuation waveguide segments may dso be connected to ports of other devices, which may be dther discrete devices or integrated on the same substrate. In the case of die device 770, a parallel waveguide output coupler (witii or without grating) may be placed in die straight section 771 of die ring. Although only a fraction of the circulating power may be outcoupled at these ports, the totd outcoupled power may be very close to 100% of die channel power entering the waveguide 752 due to die buildup which occurs in die etalon. Output coupling is shown with an adjacent waveguide 794, producing die output beam 751. The ring geometries excel in terms of extinction ratio (which is high when the light separation efficiency is high) and low crosstalk because they can be adjusted to have almost totd transfer of power into die etdon. All of die etdon devices can be designed with very low insertion loss for die out-of- band beams. All of die devices of FIGS. 26-28 are switchable by means of die phase shifting electrodes 761, and 762 (and 763 in FIG. 28). As described before, die opticd path length may be adjusted using electrode 761 to shift die frequency of die integrated et on resonances. The desired channel may be selected this way directly. Or, multiple channels may be selected by this technique using the approach described above in reference to FIGS. 20, 21, and 22; if die FSR of die etdon is selected to be slightly different from die channd separation, die Moire effect is used to select widely spaced channels with a minimum of continuous tuning. (A good choice is to make die FSR equal to die channel spacing plus a few times the frequency width obtained when convolving die channel bandwidth with die etdon resonance bandwidth). As a variation on the structures 750, 760, and 770, die coupling region 753 may be implemented as a grating-assisted coupler as described above in reference to FIG. 10. This has the advantage, in the poled-grating implementation, that the coupling fraction T can be adjusted. Particularly for the ring resonator designs 760 and 770, an adjustable coupling is useful to achieve impedance matching. As a further variation, die electrodes may be implemented on die same face of die substrate, as described above to obtain lower voltage excitation. The structures of FIGS. 27 and 28 may dso be used as efficient channel adding filters if the signd to be added to die output beam 759 is brought in on the waveguide 766, for example, or if it is coupled into die straight section 771 via the waveguide 794. These input interactions will preferably be impedance matched. Referring now to FIG. 29 A, there is shown a waveguide modulator/attenuator 800 using a poled segment 806. The function of the poled segment 806 is to (switchably) collect the light emitted from an input waveguide segment 802 and launch it into an output waveguide segment 804 when switched on. ' In this device, an input light beam 820 is coupled into die input waveguide 802. A poled segment 806 is positioned between die input segment and the output waveguide segment 804. The input and output waveguide segments are preferably permanent waveguides which may be fabricated by any of the standard techniques including indiffusion and ion exchange. The segment 806 is preferably a reverse poled region within a uniformly poled substrate so that there is essentially no difference in index of refraction and hence no waveguiding effect when die electric fidd is off. The segment 806 is a waveguide segment as shown in FIG. 29 A. (It may dtematively be configured in several geometrically different ways such as a positive lens structure, a negative lens structure, or a compound structure for relaying light between many such elements: see FIG. 29B.) The segment 806 is turned on by applying an electric field through the segment. The electric field changes the index of refraction of die poled segment and surrounding regions. Because die segment 806 is poled differently (preferably reverse poled) from die substrate materid, the index of die segment can be raised relative to die surrounding materid by applying die correct field polarity, forming a waveguide. The index inside the boundary of die waveguide may be increased, or die index at and outside the boundary may be depressed. When die poled segment is on, a continuous waveguide is formed, joining the input and output segments. This is achieved by butting the waveguides together, aligning diem to the same axis, and adjusting die width of die poled segment so that its transverse mode profile optimally matches the mode profile of die input and output waveguides 802 and 804. Witii the poled segment off, die input beam is not confined in die poled region, so that die beam expands substantially by diffraction before it gets to die output waveguide segment. If the separation of the input and output waveguide segments is much greater than the Rayleigh range of the unguided beam, so that the beam expands to a dimension much larger than that of the output waveguide, only a small portion of the input beam will be coupled into die output waveguide segment to form the output beam 822. By adjusting the length of the segment 806 relative to the Rayleigh range, die amount of power transmitted in the off condition can be reduced to the desired degree. The location of die ends of the poled segment 806 are adjusted relative to die locations of the ends of the input and output waveguides to minimize die loss caused by die discontinuity. Because the permanent waveguides have a diffuse boundary, the poled waveguide has a discrete boundary, and the index change in die switched segment adds to die pre-existing index, it is desirable to leave a small gap on the order of hdf the diffusion lengtii between die lithographically defined boundary of die waveguides 802 and 804, and the ends of the poled segment 806. To further reduce die reflection and other loss at die junction between waveguides 802 and 806, it is dso advantageous to taper the onset of the index change in the segment 806 by dther malting die exciting electrode 810 slightly shorter than die segment 806 or by tapering the dectrode width near its end, in both cases taking advantage of the reduction of the dectric fidd by the fringing effect One dtømguishing aspect of tiiis configuration is that die reflected power can be «M«ιimi»H m both die on and the off conditions. With die switch off, die reflection is dominated by the residual reflection at d e end 803 of die waveguide 802. This reflection may be minimized by tapering die reduction of die index difference dong die lengtii of die waveguide. The reflection from die end 805 of ' the waveguide 804 is suppressed by die square of die "off" transmission. In die "on" condition, die reflection is min i r n ' w< by dso tapering the index difference of the structure 806 dong the direction of propagation, creating a smootii boundary rather than a sharp interface. The boundaries of die excited poled region confine the beam laterally when they are activated because of die increase in die index of refraction within the boundaries. If die deptii of die poled region equals die depth of die waveguides 802 and 804, die beam is dso confined in die verticd direction by the poled segment boundaries. However, it is difficult to control die deptii of the poling in a z-cut lithium niobate wafer. It is easiest to pole a deep domain, and take one of several alternative measures to obtain confinement in the verticd dimension. The preferred approach is to arrange die dectrodes so that the amplitude of die electric field falls off in die verticd dimension. This is achieved by die same-side dectrode configuration shown in FIG. 29 A, but not with electrodes placed on opposite sides of the substrate. The penetration deptii of die electric fields can be reduced by narrowing the gap between the two electrodes and by reducing die width of the overall electrode structure. In addition or as an alternative, a weak permanent waveguide can be fabricated in the volume between die input and output waveguides, which is insufficient to convey much energy by itsdf, but which in combination with die index elevation produced in die poled segment 806 can optimally confine the light in two dimensions to convey essentially all the light into the output waveguide 804. This can be done, for example, by adjusting die permanent index change (relative to the substrate) within the segment to about 0.6 of the index change in the waveguides 802 and 804. If die "on" index change in the segment 806 is adjusted to about 0.5 of die same vdue, die combined index change is sufficient to achieve reasonable guiding while die permanent index change is insufficient. In the "on" condition, die mode is confined in both transverse dimensions even though the switched index change produced in die poled region may be considerably deeper than the desired waveguide dimension: the effective depth of die "on" waveguide is mainly, determined by die permanent index change. The weak waveguide may be fabricated in a second masking step, or it may be fabricated in die same masking step with a narrower mask segment defining die weaker waveguide segment. As a related dternative, the region between the input and output waveguides may be a planar waveguide, in which case die propagating mode can at minimum diffract in one dimension. Switching on a poled section will in this case add die needed transverse confinement despite having a deeper index change than die planar waveguide. Since in both cases die confinement of die waveguide in die two dimensions is achieved by two independent techniques, switchable waveguides of essentially any aspect ratio (die ratio of the waveguide width to deptii) can be formed. Both die planar and channd waveguides can be fabricated by die same technique, which is preferably die annealed proton exchange process. Separate proton exchange steps may be used to define the planar guide and channel waveguide. The waveguide fabrication process is completed by annealing, during which the index changes are diffused down to die desired deptii, and die opticd activity of die materid is restored. Preferably, die two sets of guides are anneded for die same lengtii of time, although one set can be made deeper by partially annealing before die second proton exchange step is performed. An important dternative is to use a full, uniform permanent waveguide traversing die poled segment 806, and to use die electrically excited segment to turn off die guiding. In this case, the polarity of die field is chosen to depress die index in die poled region, and die depth of die poled region can be very large (in fact tins has some advantage in terms of mode dispersal). This type of switched waveguide is normally on (i.e. transmitting), and requires die application of an electric fidd to switch it off. There are advantages to both noπnally-on and normally-off switch configurations in terms of their behavior during a power failure, so it is important tiiat this invention is capable of providing both modes. To switch the waveguiding off in the segment 806, an index change is desired which is approximately equd and opposite to the index change induced in die permanent waveguide. The effect of die variation with depth of the electric field on die "off" state is quite smdl because it is sufficient to suppress the majority of the waveguide in order to strongly disperse die light. Confinement can be achieved in both dimensions without die need of a planar waveguide, by a finite-depth poling technique. Several poling techniques (such as for example titamum-indiffusion in lithium niobate and lithium tantalate and ion exchange in KTP), produce poling to a finite depth, which can potentially be optimized to form a poled channel waveguide with a particular deptii. These techniques, however, produce an index change dong with die poling, forming somewhat of a permanent waveguide depending on die processing parameters. Depending on the strengdi of this index change, die poled waveguide segment may be fabricated in either die "normally on" or the "normally off configuration. Preferably, the electric field is created in the poled region by applying a voltage across two electrodes, which are ldd out on the same face of die crystal as die polled waveguide segment. A first electrode 810 is ldd out over the poled region, while the second electrode 812 is placed in proximity to one or more sides of die first electrode. For a z-cut crystal, this configuration activates the d M electro-optic coefficient of the substrate. A voltage source 816 is electrically connected via two wires 814 to the dectrodes to provide die driving voltage for die device. This device can be used as a digital or nonlinear analog modulator. A full-on voltage is defined to be die voltage at which die loss across die poled region is die lowest. The off voltage is defined as that voltage which reduces the coupling to die output waveguide segment to die desired extent. By continuously varying the voltage between the on and die off voltages, the device can be used as either an analog modulator or a variable attenuator. In an dternative structure, die structure 806 forms a switched curved waveguide, which again aligns with the input 802 and output 804 waveguides.- The mode of such a structure is called a "whispering gallery" mode in die extreme case where die curvature is small and die mode confinement on the inmde edge becomes independent of die inside waveguide edge. For larger curvatures, the mode is a modified whispering gallery mode where some confinement is provided by the inside edge of the waveguide. The poled structure provides an advantage in addition to die switchability, namely tiiat the sharp index of refraction transition on its outside wall greatly improves the confinement of the modified whispering gallery mode which propagates in the curved waveguide. The input and output waveguides need not be coaxial or parallel in this case, potentially increasing the forward isolation in the switched-off condition. If the input and output waveguides are arranged dong axes at an angle to each other, die O 96/08059 PCMJS95/12031 48 structure 806 may be a curved waveguide segment with a single radius of curvature or a tapered radius of curvature, used to optimally couple power between them when the curved waveguide structure 806 is turned on. FIG. 29B shows an dternative structure 801 which is a switched lens modulator/attenuator in which die prismatic structure of segment 806 is modified into a lenslike structure in which die product of the local opticd path lengtii and die local (signed) index change is reduced quadraticdly with transverse distance away from the axis of die guides 802 and 804. The lenslike structure is placed such tiiat it concentrates or refocuses die beam 821 emerging from the end 803 of die input waveguide 802 into die end 805 of die output waveguide 804. The opticd wave is dlowed to diffract away from die end 803, and passes through die lenslike structure 807. Note tiiat in this structure, multiple elements may be placed adjacent each otiier, increasing the net focussing effect. The index of refraction within the regions 807 is increased to obtain a focussing effect. If die surrounding region is poled in a reverse direction to the regions 807, or if die electro-optic coefficient of the surrounding region is otherwise opposite to that of die regions 807, die spaces between die lenses dso act as focussing regions. (The negative lens shape formed by die regions between die lenses 807, excited to a lower index vdue, acts as a converging lens structure.) The electrode 810 is placed over the structure 806 with electrodes 812 being placed outside die structure but adjacent die electrode 810 with a gap as desired. When die electrodes are not actuated, the beam continues to diverge, and very little power is refocussed into die waveguide end 805. When die switch is on, die beam is refocussed, and a fraction of the power continues through the guide 804. Verticd confinement is needed for efficient power collection in the on state, while it is undesirable in die off state. Verticd confinement may be provided as needed by, for example, providing a uniform planar waveguide 835 across the entire surface on which the structures are patterned. Verticd confinement may dso be provided by die lenslike structure 806 if it is poled deep into die substrate, and die electric field reduction as a function of deptii is tailored to collect and refocus the energy back to die waveguide end 805. The structure of FIG. 29B may of course dso be used in otiier contexts which may not have one or both waveguides 802 and 804. Referring to FIG. 30, mere is shown a poled tot internal reflecting (TTR) opticd energy redirector 830 using a poled waveguide segment. This figure illustrates both a poled TTR reflector for high switched reflection combined with a poled waveguide segment for low insertion loss. An input waveguide 832 extends entirely across the device. A poled region 836 extends across die waveguide at an angle 848, forming a TTR interface for the beam propagating in the guide when the poled region is electro-optically activated. A portion of the poled region dso forms a poled waveguide segment 837 that is connected to an output waveguide segment 834. The poled waveguide segment and die output waveguide segment are both bid out at twice the angle 848 witii respect to die input waveguide. A voltage source 846 provides die electrical activation for the switch, and is connected to it through two wires 844. The poled region 836 is defined by six verticd faces according to the diagram, with one face traversing the waveguide 832 at a shdlow angle 848 equd to die TTR angle and less tiian die criticd angle for totd internal reflection for a desired electrode excitation. This face is the TTR reflecting interface. The next three consecutive verticd faces of the poled region enclose a projection outside of the waveguide 832. The projection is a switchable waveguide segment. The placement of the next two verticd faces is not criticd, and may follow die waveguide boundaries and cross it at 90°. The domains (836 and die region of die substrate outside 836) are characterized by a quiescent index of refraction distribution, which is die spatid distribution of the index in die absence of applied electric field. When an exciting electric field distribution is applied through die doniains, they will have an excited index of refraction distribution which is different from die respective quiescent distribution. The excited distribution will dso have a range according to the accessible range of die applied dectric field. The advantage of juxtaposing two domain types near one another is that die electric response may be opposite in die two domains, producing a transition with double the change in index across the region of juxtaposition. In the case of index or refraction changes, the transition forms a reflection boundary with larger reflection than would be attained witii a single domain type. When the switch is on, an input beam 851 tiiat is coupled into die waveguide reflects off die TTR interface, propagates down the poled waveguide segment, and passes into the output waveguide. segment 834 to form a deflected output beam 854. When the switch is off, the input beam propagates through the poled interface and continues through the input waveguide to form an undeflected output beam 852. Because the index change at die ΗR interface is low, the reflection in the off state is very low. Because the permanent waveguide segment 834 is separated by several mode exponential decay lengths from the guide 832, die power lost due to scatter as the beam passes by the switching region is also extremely low. An "off" switch is essentially invisible to the waveguide, producing extremely low loss in the input guide. The additional loss of die switched region in the off state compared to an equd length of unperturbed waveguide is cdled die insertion loss. Low insertion loss is especially desirable when the input waveguide is a bus witii many poled switches. The angle θ (848) of die poled interface with respect to the input waveguide must be less than die maximum or criticd TTR angle $ c , as derived from Snell's law: where 9 ■= TTR angle (between die waveguide and die poling interface), n — index of refraction of waveguiding region, and Δn = electro-optic change in index on each side of poling boundary Since die index change occurs on each side of die poling boundary with opposite sign, the effective index change is 2Δn. This expression assumes dowly varying (adiabatic) changes in die index away from the boundary. Due to the doubling in the effective index change, die maximum switching angle that can be achieved with a poled TIR switch is increased by -J2 over d e prior art switches with a pair of electrodes and no poled interface. This is a very significant increase since it increases the maximum packing density of switch arrays which can be achieved using a ΗR switch. The criticd angle θ c depends on die polarization of the input beam because the index change Δn depends on die polarization. In z-cut lithium niobate, for example, with a verticd field E j , the TM wave is sensitive to die change in die extraordinary index of refraction through the r^ and die TE wave to ttie change in die ordinary index through r 13 . Since r 33 ► r, 3 , it is far easier to switch TM waves. Use of anneded proton exchanged waveguides is very convenient because they guide only waves polarized in the z-direction. In x-cut y-propagating (or y-cut x-propagating) lithium niobate, on die other hand, the TE wave has die higher change in index. Note that in this case, die electrode configuration must be changed to produce a field component in the z direction in the plane of die substrate, instead of in the verticd direction. The design angle for actual ΗR switches must be chosen after optimizing several factors. The mode to be switched includes two angular distributions (in the waveguide fabrication plane and out of the plane) which can be different if the widths of the waveguide in die two planes are different. The angular content 6φ of the mode in a given plane covers approximately δφ = ± λ/τw 0 where w„ is the 1/e 2 mode wdst in that plane. We wish most of the light to be reflected at the TIR interface, so the angle of incidence must be less than the criticd angle θ c by approximately the angular content bφ in the plane of the switched waveguides. The angular content bφ is inversely related to the waist size, but so is die packing density which we wish to optimize. The angular content of the mode in die direction out of die plane of the waveguides dso must be taken into account because it also contributes to die effective incidence angle, dthough in a geometricdly more complex way. An dternative way of producing a ΗR switch is witii a strain field instead of or in addition to the electric field. The strain field is most conveniently implemented in a permanent fashion; die electric field is most useful for producing changes in die reflection. An oriented strain field applied at a domain boundary produces different changes in the index of refraction, via the photoelastic effect, in the two domains, resulting in an index of refraction interface. As mentioned above in reference to FIG. 2, die strain fidd may be produced by heating the sample to a high temperature, depositing a film with a different coefficient of thermal expansion, and cooling to room temperature. A pattern applied to die film by etching away regions such as strips will produce a strain field about die gap in die film. This strain field can then be used to actuate an index of refraction difference at domain boundaries. If die applied film is a dielectric an electric field may be applied through it to the poled regions provided that die deposition of electrodes does not undesirably change the strain field. The film is preferably a film with low opticd absorption so that it can be contacted directly to die substrate instead of being spaced by a buffer layer. The poled region includes a portion of the input waveguide and has an interface noπnd to the propagation axis of the waveguide. The portion of die input waveguide that contains the TTR interface crossing defines the lengtii of the switch: where θ is previously defined, L = Wcot ) - — (4) L = lengtii of die switch measured dong die input waveguide, and W = width of die waveguide Thus, in order to minimize die size of die switch, the width of the waveguide must be made as small as possible. For space-criticd applications, it is preferable that the waveguide segments be single mode. As a numericd example, if the width of the single-mode waveguide is 4 μm, the maximum index change Δn is 0.0015, and die index of refraction is 2.16, then die ΗR angle θ is 3° and die lengtii of die switch L is 76 μm. The poled waveguide segment forms an angle with respect to the input guide equd to IB, which is the deflection angle of the ΗR interface. In order to efficiently modematch die beam reflecting off the TTR interface into the poled waveguide segment, the poled segment should have nearly the same transverse mode profile as the input waveguide. Efficient mode matching can be achieved by selecting the proper combination of width and index difference of the poled waveguide. The poled waveguide segment intersects the input waveguide dong die latter half of the side of die waveguide occupied by the switch interface. The exact dimensions and placement of the waveguide are determined to optimally match the near field mode profile emerging from the total internal reflection process to the mode of die waveguide in terms of direction of propagation and transverse profile. The same is true of die match between die poled waveguide segment and die permanent waveguide segment 834, similarly to what was described above in reference to FIG. 29A. The permanent waveguide segment is essentially a continuation of the poled waveguide segment. The length of die poled segment depends on optimizing losses in the input waveguide and die switched waveguide. In order to avoid scattering interaction between the undeflected beam in die input waveguide when die switch is off, die permanent waveguide segment must be separated by some distance (at least an opticd wavelengdi) from die input guide. For a bus waveguide witii many switches, die loss in the input guide must be reduced to a vdue related to die inverse of die number of switches. The modal profile of a beam in die input guide extends a certain distance beyond die indiffused edge of the guide, where it decays exponentially. If the permanent segment is separated from die input guide by several of tiiese exponential decay constants, die loss can be reduced to an acceptable level for a bus waveguide. The lengtii of the poled segment affects the loss in the reflected beam as well. The poled waveguide segment may have higher losses per unit length than an indiffused waveguide, due to higher wall roughness. In addition, there are die above mentioned mode conversion losses at each end of die waveguide, which are minimized by optimally matching the mode profiles. If die poled segment is short (on the order of die Rayleigh range of die beam), die transmitting beam does not substantially convert into the mode of the poled segment, thus reducing the coupling losses. The optimd length of die poled segment depends on die relative loss that is tolerable in beams in the input waveguide and die switched waveguide. O 96/08059 PCMJS95/12031 52 As in the case of the waveguide segment modulator/ attenuator shown in FIG. 29A, there is a need for verticd confinement of the mode in the switched waveguide segment 837. The same options described there can be implemented here. Shown in FIG. 30 is a planar waveguide 835 which confines the beam in a plane parallel to the surface of die substrate. Since the planar waveguide is uniform, its presence does not affect die loss of die waveguide switch junction in its off state. In place of the planar waveguide, or in some combination, the otiier dternatives may dso be implemented, including tailoring die deptii of die electric fields to obtain verticd confinement, using short depth poling, using a partial waveguide which is augmented by die field induced index change, and using a full permanent waveguide which is turned off by a field activated poled region. The latter two alternatives have the disadvantage tiiat the loss to the beam through waveguide 832 is higher due to the adjacent index discontinuities. Horizontal confinement is dso an issue in optimizing the switching region. If high switched efficiency is desired, it is preferable to have a large TTR reflection angle. The left hdf of the input wave 851 reflects first off the interface 838, forming the right hdf of the reflected wave. However, after reflection, the right hdf of the reflected wave is unconfined in the transverse dimension until it arrives into the waveguide segment 837. During its unconfined passage, it will expand by diffraction, reducing the fraction of die beam power which couples into the output waveguide 834. This effect degrades the efficiency of the switch in its on position. However, the mean unguided distance is limited to approximately the waveguide width divided by four times die sine of die angle 848. The right hdf of the input wave remains confined after it passes the waveguide segment 837 until its reflection off the interface 838 because of die permanent index change due to die right hand side of the waveguide 832. It then matches well into the output waveguide 834. Both portions of die input beam 851 suffer an undesired reflection from the side of die waveguide 832 after reflecting from the TTR surface 838. Since tins surface is at die same angle to die axis of propagation of the beam as the surface 838 was, but with only a fraction of the index difference, there only be a partid, not a totd, reflection from this surface which also adds to the loss of the switch. The electrode design is a criticd aspect of this switch, in order to optimize die efficiency of die reflector and minimize die loss of the waveguide. Preferably, two electrodes are used to activate die switch. A first electrode 840 is placed over die ΗR interface 838, while a second electrode 842 is placed dongside die first electrode, adjacent to that interface. The main parameters for optimization are the separation of the two electrodes and die distance between the edge of die first electrode and die poling boundary, which may or may not overlap. The spacing between die two electrodes influences the voltage required to activate die device, as well as die widtii of the electric field pattern which penetrates die substrate and produces die index change profile. Electrodes that are spaced further apart require higher voltages, but create an electric field that extends deeper into the substrate than closely spaced dectrodes. The electric field penetration deptii is criticd to obtaining a large net reflection. Because the fields get weaker die farther they are away from die electrodes, die induced index change at the poling boundary also drops witii depth, as does die TTR angle. At a certain deptii called die effective deptii, die index change becomes insufficient to maintain totd reflection for the central ray of the opticd beam at the angle of die switch structure. Since the reflection drops rapidly with index change at vdues below the minimum TTR vdue, the TTR mirror essentidly stops functioning at this depth. For high net reflection into the guides 837 and 834, the device design should be adjusted to create an effective deptii below the majority of the field profile in the guide 832. The second important operating parameter influenced by die electrode design is the penetration of die evanescent fields of the reflecting wave beyond die TTR interface 838. Although no power may be transmitted beyond die TTR interface in the "on" condition, die electromagnetic fields penetrate die TTR surface by a distance on die order of a wavelengdi. There will dso be spatid dependence of die applied electric field beyond die ΗR surface, the field strength being reduced (and in fact inverted) in regions closer to the other electrode 842. The index change is therefore reduced beyond die TTR interface. Care must be taken that the evanescent fields decay to a negligible vdue before substantial variation in die field occurs, or power will leak through the TTR interface. Optimally, die first electrode will overlap the poling interface by a distance chosen for maximum index change and for sufficient constancy of field beyond the interface 838. The first electrode dso extends across die poled waveguide segment 836, and possibly into adjacent areas. The shapes of die two electrodes exciting this region 836 are determined by optimizing the power flow through the waveguide segment and into die permanent waveguide 834. Other electrode structures can be used to modify the strength of the electric field in the poled region. If, for example, the second electrode is extended around die first to form a U shape, die electric field under die first dectrode is increased on die average, but it forms somewhat of a two-lobed waveguide, which may not provide an ided index profile. The TTR switch is an opticd energy router and can dso be used as a modulator. If die voltage source is continuously variable, then the modulator is analog, with a nonlinear relationship between voltage and reflectivity. As the applied voltage is increased, die deptii of the totd reflecting interface is increased, producing a continuously adjustable reflection out of the wave 851 into the wave 854. The modulator can be used in reflection or transmission mode, depending on whether die transmission should go to zero or 100% when die voltage is removed. For special nonlinear applications, the nonlinearity of the reflection and transmission coefficients as a function of voltage, such as where the receiver is logarithmicdly sensitive to the level of die signal, might be useful. FIG. 31 shows a TTR switch with two ΗR reflectors. If it is desired to increase the angle between the output waveguide 834 and die input waveguide 832, a second TTR interface 839 may be added. The angle between die input waveguide 832 and die output waveguide 834 is doubled relative to that of FIG. 30, and may be doubled again and again by adding additional ΗR interfaces. The interface 839 is created at an angle 849 relative to die interface 838 equd to twice the angle 848. (Subsequent TTR interfaces, if any are added, should be added at die same angle 838 relative to the previous TTR interface.) The switched waveguide portion 837 of FIG. 30 is no longer required since the dud TTR mirror structure brings the light so far away from the input waveguide 832 that the permanent waveguide 834 may be butted directly against die end of die poled region 836 without contributing significant loss to the waveguide 832. Again, verticd confinement is provided in die poled segment 836. The poled segment 836 and die output waveguide 834 are configured and aligned so that the field profile propagating in the chain of TTR and waveguide segments optimally matches die local lowest order mode field profile of the input waveguide 832. After die TTR reflectors, die deflected beam is matched into a permanent waveguide 834 to form die output beam 854 when die switch is on. The shape of die inside boundary of die poled region outside die input waveguide 832 is defined by die reflection of die input waveguide through the ΗR mirrors, one after the other. This definition of the inside boundary achieves optimum guiding of die inside edge of die waveguide mode while it is reflecting from the two TTR mirrors. FIG. 32 shows a ΗR switched beam director with a poled ΗR switch 831 with an electrically switched waveguide segment. In this structure, the region 836 is reverse poled, lies behind the interface 838, and is excited as before by a pair of electrodes 840 and 842, which are activated by voltage source 846 and connected via conductors 844. The polarity of the excitation is again selected to produce a negative index change coming from the direction of the input beam 851. When the switch is on, the beam is reflected off the TTR interface 838 towards the permanent waveguide 834, but unlike in FIG. 30, there is no poled waveguide segment joining them. Instead, die electrode 842 is extended over die intermediate region between die input waveguide and die output waveguide 834. A coupling waveguide segment may be formed by applying an electric field to a region between a lateral boundary of die segment of the input waveguide 832 containing die ΗR reflection boundary and an input boundary of the output waveguide 834. The three dimensional distribution of the electric fields is determined, as dways, by die shape of the dectrodes and Maxwell's equations. The electric fields produced by that electrode produce a positive index change through the electro-optic effect, providing die desired switched waveguiding section. As described dsewhere, this waveguide segment is dso configured and aligned to optimize the coupling of die input mode 851 into die output mode 854. As an alternative in this and any of die ΗR switch implementations, die output waveguide may originate at die input waveguide with negligible gap. This dternative has higher insertion loss in the switch off (straight through) configuration, but it has a simpler structure. Referring to FIG. 33, there is shown a two position waveguide router using a poled segment, which is not based on totd internal reflection. The poled region 866 forms an electrically excitable waveguide segment which crosses the input waveguide 862 at a small angle. When the fidd is applied, the index in die segment 866 is increased, while the index in the adjacent region in die input waveguide is decreased. Thus, the input beam 880 is at least partially coupled into the poled waveguide segment. When die switch is off, die input beam continues to propagate through the input guide to form an unswitched output beam 882. The small angle may be tapered adiabatically, forming a low loss waveguide bend, if it is desired to switch dl or most of die input light into the output guide 864 to exit die device as die switched output beam 884. At least two electrodes are used to apply an electric field across die poled region to activate die waveguide. A first electrode 870 is positioned above the poled waveguide segment, while a second electrode 872 is positioned adjacent to the first electrode. The second electrode 872 is adjacent to the first electrode and may be placed on both sides of die poled waveguide segment, in order to achieve a high power splitting ratio. As before, the electrodes are excited by the power supply 846 through conductors 844, and a planar waveguide 835, or die electric field falloff with depth, or one of the other approaches described herein is used to obtain verticd confinement for die switched propagating modes. Referring to FIG. 34, several poled ΗR switches are placed side by side to form an array 900. The poled regions 912 and 914 forming die TTR interfaces are placed one after the other dong die waveguide 910. Each poled region has die same crystal orientation, with the z axis of die crystal in the regions 912 and 914 reversed relative to that of die remainder of die crystal. The otiier aspects and many variations of this configuration have been described above in reference to FIG. 30. Each of the switches are individually activated using a multi-output voltage control source 926, which is connected to die electrodes with wires 928. When all switches are off, die input beam 902 propagates down die input waveguide 910 to form an unswitched output beam 904 with negligible loss. If the first switch is on, then the input beam reflects off the first TTR interface to form a first reflected output beam 908 in waveguide 916. If die first switch is off and the second on, die input beam reflects off the second TTR interface to form a second reflected output beam 906 in waveguide 918, and so on for the subsequent switches. This multiple switch structure can be extended to n switches. An electrode is laid out over each ΗR interface as described above. One or more of the electrodes 920, 922, and 924 serve as die cathode for one switch and die anode for another. For example, a voltage is applied between the second electrode 922 and die first and third electrodes 920 and 924 to activate die second switch forming the output beam 906. An electrode 922 tiiat acts as both an anode and a cathode should preferably extend adjacent to die TTR interface of die prior poled segment 912 while dso covering the TTR interface of one poled region 914 and one waveguide segment of one poled region 914. Only a portion of the structure is shown, witii two complete poled segments 912 and 914 and one complete electrode 922. This structure can be replicated into n switches by digning duplicate complete dectrodes and poled segments. In order to avoid crosstalk in die channels, die voltage on die electrodes may be applied in such a manner that die input beam does not see any electro-optic index changes until it enters the region of the activated switch. For example, to activate the TTR interface of the second poled region 914, a voltage may be applied between electrodes 922 and 924, keeping the same potentid on electrodes 920 and 922 and prior electrodes. Although die totd lengtii of die poled regions is longer than L, die distance occupied dong the waveguide by a given region is equd to L by definition. A linear array of TTR switches witii a 100% packing density would therefore have new poled regions starting every distance L. This is called 100% packing density because at this density die adjacent regions just barely touch each other at the inside corner of the poled region in the waveguide. Having adjacent regions touch each otiier is disadvantageous because some of die light guided in die previous poled structure can leak out into the next poled structure - where the structures touch. We have noted above that the comer which touches the preceding poled region is formed by two verticd faces of die poled region whose placement is not critical. By moving these faces so tiiat die width of die poled region is thinned on the side of this inside comer, it can be arranged that die regions no longer touch each other, reducing die leak of opticd energy. For example, the inside comer can be moved to die middle of die waveguide by halving die lengtii of the face which traverses the waveguide at 90°. The face which used to parallel die waveguide now parallels the TTR interface, and becomes a critically positioned surface. We call die poled regions witii this geometry "dense packed" poled regions. (There are otiier ways die objective of minimizing the light leak may be accomplished, such as adding a seventh verticd face between die two noncriticd faces, but the dternative just described has another advantage in dense packing.) FIG. 35 shows a configuration wherein the linear density of switches is be doubled by using the dense packed geometry for the poled region and reversing die polarity of the adjacent poled regions. The interfaces of die poled regions transverse to the waveguide are now identicd but for a translation dong die axis of die waveguide. The poled regions will therefore stack solidly dong die waveguide, doubling die switch density. In fact, only die reverse poled region is fully spatially defined, since the other region has the same poling direction as die substrate (in the optimd case where die substrate is fully poled). Two regions 952 and 954 of reverse poling are shown in FIG. 35. The TTR interfaces can be thought of as the first face or the input face and the second face or die output face of die poled region where unswitched light travelling in the waveguide 950 potentially enters or leaves, respectively, die unexcited poled region. The TTR interface for the output beam 946 is formed between the poled substrate and the first (input) face of the reverse poled region 952, and is excited by electrode 966. The TTR interface for the output beam 947 is formed between die second (output) face of the reverse poled region 952 and die poled substrate, and is excited by electrode 967. The ΗR interface for die output beam 948 is formed between die poled substrate and the first face of the reverse poled region 954, and is excited by electrode 968. The TTR interface for die output beam 949 is formed between die second face of die reverse poled region 954 and die poled substrate, and is excited by electrode 969. The electrodes extend above the respective TTR interfaces, and dong die switched waveguide segments which connect to die permanent output waveguides 956, 957, 958, and 959. Preferably, one or more of die electrodes 966, 967, 968, 969 and 970 serve as die cathode for one switch and die anode for another. Each electrode therefore extends parallel to and dong die full lengtii of die ΗR interface of the previous switch. Each of die switches is individually switchable by applying electric fields with voltage source 926 via conductors 928. When dl switches are off, the input beam 942 propagates down die bus waveguide 950 to form an unswitched output beam 944. When the first switch is on, the input beam reflects off its respective TTR interface to couple into the first output waveguide segment 956 to form a first reflected output beam 946. For the subsequent switches, the input beam reflects off the respective subsequent TTR interface to couple into a waveguide segment 957, 958, or 959 to form a reflected output beam 947, 948, or 949. The voltage on the electrodes is typically set so that there is no opticd interference from adjacent switches: all preceding switches are off. This can be accomplished for example by maintaining all the preceding electrodes at die same potentid as the switched electrode. This multiple switch structure can be extended to n switches. It is desirable to extend the upstream end of die dense packed poled regions significantly beyond the edge of die input waveguide 950, maintaining the angle of die verticd surfaces with respect to the waveguide. This extension captures die full exponential tail of the input waveguide mode, and pushes die remaining noncriticdly positioned surface of the extended dense packed poled region out of die waveguide 950, thereby diminishing die opticd loss. (Upstream and downstream are defined in relation to the direction of propagation of the input beam 942.) If die switched waveguide segment of die poled regions is designed as described above in reference to FIG. 30, die separation of die output waveguides becomes equal to their width in die highest density packing, so tiiat they merge into a planar waveguide. While a planar output waveguide may be useful for some applications, the output waveguides may be separated using a second poled TTR interface within each switch. The use of two TTR interfaces in a switch has been described in reference to FIG. 31. Note that in die case of FIG. 35, the geometry of die poled region is slightly different to accomplish die stacking. The "output waveguide" section of die extended dense packed poled regions is rotated about the end of the first TTR interface to an angle 30 relative to the input waveguide 942, maintaining the parallelism of its faces. This "output waveguide" section therefore becomes a second TTR reflector segment. The width of die second ΗR reflector segment is about 50% larger than die input waveguide. The mode propagating in the second ΗR reflector segment is unconfined on its inner side for a distance of about 2W/sin0 where W has been defined as die waveguide width. Any diffraction which occurs on this side will result in reduced power coupling into the output waveguides 956-959. It is desirable to keep this distance less than about a Rayleigh range. In the case of a 4 μm wide waveguide operating at a TTR angle of 4.5°, the totd unconfined distance is about 100 μm, which is approximately equd to the Rayleigh range for a blue beam. One solution to optimizing die performance of an array of such switches lies in adding a permanent reduction of index of refraction (without degrading the dectro- optic coeffident) in a strategic location within the second ΗR reflector segment. This strategic location is the zone bounded by the inside wall of die extended dense packed poled region, and by the inside wall of the poled region 836 as defined in reference to FIG. 31. The permanent index of refraction reduction defines a permanent waveguide boundary at the optimd location for confinement of die mode as it is reflecting from the two successive TTR mirrors. The added index reduction tapers to zero as it approaches the input waveguide, and the loss added to die input waveguide can be reduced sufficiently by truncating the index reduction region sufficientiy far from the guide. The index reduction dso does not interfere witii the TTR function of the previous TTR interface (indeed, it helps). Thus, the switched beam reflects from two consecutive TTR interfaces, doubling the totd deflection angle of the switch to 40. By doubling the output angle, space is now made available for output waveguides of width equd to the input waveguide, with a separation equd to their width in the densest configuration. The output waveguides connect to the poled region in FIG. 35 at die find comer of the second TTR reflector, at an angle θ relative to die second ΗR interface and optimdly digned to collect die light reflecting off the second TTR interface. Preferably, die two ΗR reflectors for a given switch are connected without an intervening waveguiding segment. This minimizes die path lengtii that the deflected beam must travel in the poled waveguide, which may have a higher loss than a permanent channel waveguide due to wall roughness and asymmetry. In an dternate poling boundary structure, the boundary between two adjacent poled regions may be a curved TTR structure. The mode of such a structure is again a whispering gallery mode, possibly modified by some confinement on die inside boundary of die waveguide. The radius of curvature of die poling boundary is made small enough so the whispering gallery mode matches well witii the waveguide mode for large power coupling between the two types of guide, yet large enough for practicd totd internal reflection to occur for the distribution of angles within the mode. FIG. 36 shows a dual crossing waveguide structure 980 for higher packing density. This structure incorporates two innovations: an asymmetric loss waveguide cross 997, and 90° mirrors 976 and 977. The density is increased witii die addition of a second input waveguide 982 parallel to die first input waveguide 984, on the same surface of the substrate 981, effectively doubling the packing density. The switching elements 983 and 985 have been illustrated schematically as one of the variants of the poled TTR switch described above, but can alternatively be any integrated optic switch described in the literature, so we do not describe the switch in detail here or in the FIG. 36. (The switches may dso be implemented in dternate ways described herein such as the grating switches described in reference to FIG. 7, die coupler described in reference to FIG. 10, the splitter described in reference to FIG. 25, and the guiding switch described in reference to FIG. 33.) A first input beam 992 propagates down die first waveguide, while a second input beam 994 propagates down the second waveguide. The two beams may originate from distinct sources or from the same opticd source via an active or passive splitter. When the corresponding switch is off, the input beam 992 and 994 propagate through to form the undeflected output beam 993 and 995, respectively. If die corresponding switch is on, the first input beam 994 is deflected into the output beam 996, while the second input beam 992 is deflected into the output beam 998. In die asymmetric waveguide cross 997, two waveguides cross each other with the index of refraction profiles adjusted to minimize die loss in one guide at die expense of somewhat higher loss in the other. The crossing guides are laid out at a large angle with respect to each other (herein illustrated at 90°), in order to mϊnimim the crossing loss. Referring to die geometry of FIG. 36, the second deflected beam 998 crosses over die first waveguide 984 (in this case so that the switched output light beams can propagate in parallel output waveguides 986 and 988). The waveguide 988 is broken at die crossing point with the waveguide 984, leaving die gaps 990 and 991. This is done to minimize the loss in the waveguide 984, producing an asymmetric loss structure with higher loss in waveguide 988 than in waveguide 984 in die crossing region. For later convenience, we say that the asymmetric cross "points" dong the waveguide witii lower loss. The asymmetric cross 997 points dong the waveguide 984. If die gaps 990 and 991 are wider than several exponentid decay lengths for the mode in the guide 984, die cross structure will provide essentidly no additiond loss to die waveguide 984. A large number of asymmetric cross structures may then be sequenced pointing dong the waveguide 984 to produce a low loss waveguide crossing many others. The gaps 990 and 991 will produce some reflection and scatter to the beam 998 propagating in the broken waveguide 988, and the width of the gap may be minimized subject to the combined constraint* of desired low loss in the two waveguides. To minimize the opticd loss from the beam 998 propagating in the waveguide 988 at the cross structure, the index profile transverse to the axis of propagation of the guide may be modulated or tapered dong die axis of die guide. The god is to maintain very low loss in the waveguide 984 while minimizing die loss in 988. This purpose is achieved if the index of refraction change in the regions adjacent to die guide 984 is smdl and slowly varying compared to the index of refraction change of the waveguide 984 itself. (All index of refraction changes referred to are relative to the substrate.) The loss in the second waveguide has two components: one due to reflection from the index discontinuities, and one due to diffractive spreading. The reflection loss is determined by the magnitude of die index change in the waveguides, and by its taper profile at die ends and sides of the waveguides. For example, if the index change at die core of die waveguides is die same in both at Δn » .003, the net reflection loss at the four interfaces will be less than 5%, neglecting corrections due to the exact index profiles which can reduce the reflection. The diffractive loss is even lower because the gap width is typically much less that the free space Rayleigh range. If, for example, the narrowest mode dimension is die deptii, at 2 μm, then the Rayleigh range is 55 μm, assuming an index in die materid of 2.2 and a wavelengdi of 0.5 μm. The diffractive loss at each gap is less than 1 %, assuming a 3 μm wide gap. If the waveguide depth is 4 μm, the diffractive loss is substantidly smaller. The diffractive loss may be TniniinimH by increasing the dimensions of die waveguide relative to the gap size. In general, the "gaps" 990 have an index of refraction distribution adjacent the crossing region. This index of refraction distribution is defined relative to the index of refraction of the substrate. The index of refraction in the gaps may taper from a vdue equd to the index of refraction distribution of the waveguide 988 to another vdue adjacent die crossing region. The important part of the crossing region is the volume within which propagates die opticd mode of die waveguide 984. To minimize the loss in the waveguide 984, the index of refraction adjacent die crossing region in this important part is much smaller than the index of refraction distribution within the waveguide 984. The crossed waveguide geometry with asymmetric opticd loss may be combined in many geometric variations. For example, three or more input waveguides may be used with multiple crossing points where switched output waveguides traverse input waveguides. The selection of preferred waveguides, preferred in die sense of having its loss minimized at die crossing point, can be dso done in many ways. We have discussed an example in which die preferred guides are parallel. However, in a more complex system, there may be preferred guides which cross each other as well as crossing unpreferred guides. The selection of how to accomplish the crossings of the preferred guides depends on the application. The waveguide crossing structures in a device may be any combination of asymmetric loss crossings and symmetric loss crossings where the gap widths are zero. For switches that deflect die beam at a smdl angle (such as a TTR switch), additiond beam turning means such as 976 and 977 may be provided, in order to achieve the desired large angle of intersection at the waveguide cross. The beam mining means 976 and 977 is preferably a verticd micromirror, and is installed at a fixed position. Each micromirror is formed by removing die substrate materid within its volume, leaving a flat verticd surface (preferably with low roughness) adjacent to the waveguide and oriented at such an angle so as to direct die reflected light optimdly down the output waveguide 986 or 988. The micromirrors may be fabricated using conventional processing techniques, including laser ablation with, for example, a high power excimer laser or ion beam etching, both of which might define die mirror geometry with the d of a mask. The volume may be filled with a low index, low loss materid such as aluminum oxide or silica to prevent contamination of the mirror surface, and to maintain die total internal reflection property of die mirror. The angle of die micromirror relative to an input of one of the waveguides is preferably adjusted to provide totd interod reflection. The thickness of the micromirror volume in die direction normal to its reflective surface is preferably much greater than a wavelength of light in order to minimi TΛ leakage through the micromirror volume of the evanescent tail of die reflected light wave. The angle relative to the other waveguide is adjusted so tiiat the mean propagation direction of the reflected beam is parallel to die central axis of the other waveguide. The location of the micromirror is adjusted to optimize die coupling of the light from one waveguide to die other. The location of the mirror in the junction region is preferably adjusted so that die "centers of gravity" of the two beam profiles illuminating die mirror surface are at die same place. The length of the mirror transverse of the incident and reflected beams is greater than about twice the width of the waveguide to reflect essentially the entire mode, including die exponentially decreasing intensity in the beam tails. Light input from one of die waveguide modes diffracts through die waveguide junction region to the micromirror, reflects, and diffracts back through the waveguide junction region at the reflected angle before coupling into die output waveguide mode. The junction region between the two waveguides in the vicinity of die mirror is optimally kept small compared to the Rayleigh range of the unconfined beam, which can be accomplished with waveguides having widths in die 2 to 5 micron range. The structure of FIG, 36 makes possible a large interdigitated array of switched light distribution waveguides. The entire structure 980 may be replicated many times dong a pair of input waveguides, producing a set of interleaved output waveguides with a simple pattem of dternating parentage (in this context, parentage means deriving opticd power from a specific "parent" input waveguide). Each input waveguide may be connected to a large number of output waveguides as long as the switching d m*"** have a very low insertion loss, as is die case for die elements listed above and described herein. Because of the asymmetric cross structures, adding more input waveguides above die others (with additiond switches, micromirrors, asymmetric waveguide crosses, and interleaved output waveguides) does not significantly increase the loss of the lower input waveguides or affect their ability to distribute light over a long distance to many output waveguides. It will increase moderately die opticd source power required for each additiond input waveguide in order to deliver die same power to die end of their respective output waveguides. As many input waveguides as desired may be used in paralld to distribute a potentially large totd power of light. Their output waveguides may be interleaved in many dternative patterns using die approach of FIG. 36. The same result may be achieved using grating reflectors in the place of the TTR switches. If die grating reflectors are oriented at a large angle to the input waveguides, the micromirrors are dso no longer needed. The structure described in the previous paragraph is a one-to-many architecture in that it has one output per switch with a multiplicity of switches per input. There is no way to connect many inputs into the same output. What is needed is a many-to-one architecture. The many-to-many configuration is then obtained by combining the one-to-many and die many-to-one configurations. FIG. 37 shows an array 1060 of waveguides with ΗR switches arranged in a many-to-one configuration. In the structure shown, two Input waveguides 1072 and 1074 switch two input beams 1062 and 1064 into an output beam 1070 in one output waveguide 1076. The input ΗR switches 1090 and 1092, and die output switches 1094 and 1096 have been described before in reference to FIGS. 30 - 32 and 36, so they are shown only schematicdly, leaving off many elements (such as the electrodes, die contacts, the power supply, die controller, die verticd confinement means, the depth of die poled regions, the type of output waveguide confinement) for clarity. The input ΗR switch is arranged with die beam propagating in a forward sense as described in reference to FIG. 36, while the output ΗR switch is arranged with the beam propagating in a reverse sense. The switches 1090 and 1092 are switched at substantially die same time, as are switches 1094 and 1096, because both are required to accomplish injection of power into die output waveguide 1076. As described in reference to FIG. 36, when the switches 1090 or 1094 are on, a fraction of the beams 1062 and 1064 are switched, respectively, into the waveguide 1078 or 1084. The remainder of the input beams propagates dong die extension of die input waveguide into an output path as beams 1066 or 1068, which may be used in some otiier component or brought into a beam dump for absorption or scatter out of the system. Micromirrors 1082 and 1088 are provided to reflect the beams from waveguides 1078 and 1084 into the waveguides 1080 or 1086, respectively. In their on condition, TTR switches 1092 or 1096 receive the beams propagating in the waveguides 1080 or 1086, respectively, forming the output beam 1070. If it is desired to switch die beam 1062 into die output beam 1070, clearly the switch 1096 and all subsequent switches must be off. (It would otherwise reflect much of the desired beam out of the waveguide 1076.) A similar constraint applies for dl the otiier switched beams in multiple switch arrays. The substrate 1098 is processed as described herein to produce die structures illustrated. When the switches 1090 or 1094 are off, die input beam propagates through the switching regions 1090 or 1094 with negligible loss, traverse the waveguide 1076 (in an asymmetric cross if desired), and emerge as output beams 1066 or 1068, respectively, possibly for use as inputs to additiond switches. Additiond input waveguides may dso be provided, coupling into die waveguide 1076 (or not coupled, as desired), in a modified repetition of this structure in the direction of die output beam 1070. Additiond output waveguides may dso be provided, coupled if desired to die input waveguides 1072 and or 1074, in a modified repetition of this structure in the direction of die beams 1066 and 1068. FIG. 38 shows an array 1210 of grating reflectors in a many-to-many configuration. In the structure shown, two input waveguides 1222 and 1224 switch two input beams 1212 and 1214 into two output beams 1220 and 1221 in two output waveguides 1226 and 1228 which abut or encounter die input waveguides. The grating switches 1230, 1232, 1234, and 1236 containing die gratings 1238, 1240, 1244, and 1246 have been described before in reference to FIGS. 1, 8,12, and 13, so they are shown only schematically, leaving off many elements (such as the electrodes, die contacts, die power supply, die controller, the verticd confinement means, the deptii of the poled regions, the tapering of die poled regions or electrode spacing) for clarity. When die switches 1230 or 1232 are on, a fraction of die beam 1212 is switched into die output beams 1220 or 1221, respectively. The remainder of die input beam propagates dong a continuation of die input waveguide into an output path as beam 1250, which may be used in some other component or brought into a beam dump for absorption or scatter out of the system. When die switches 1234 or 1236 are on, a fraction of the beam 1214 is switched into the output beams 1220 or 1221, respectively. The remainder of the input beam propagates along a continuation of the input waveguide into an output path as beam 1252, which may be used in some otiier component or brought into a beam dump for absorption or scatter out of die system. It should be understood that the structures admit to bi- directional propagation. The substrate 1248 is processed as described herein to produce the structures illustrated. When die switches are off, die input beams propagate through the switching regions (in which the waveguides may be configured as an asymmetric cross if desired), and emerge as output beams 1250 and 1252, respectively, possibly for use as inputs to additional switches. The waveguides may cross each other in simple large-angle junctions as shown, or the junctions may be asymmetric crosses, which do not substantially affect the placement of the gratings 1238, 1240, 1244, and 1246. Note tiiat the gratings may in fact be parts of a single large grating which covers the substrate and which is only activated in the regions of the different switches by die desired electrodes. If die gratings are constructed from poled domains, for example, this allows die entire substrate to be poled for the gratings, which may be simpler in production. Alternatively, the gratings could be arranged in stripes or other groupings. Additiond input waveguides may dso be provided, coupling into the waveguides 1226 or 1228 (or not coupled, as desired), in a modified repetition of this structure in the direction of die output beams 1220 and 1221. Additiond output waveguides may dso be provided, coupled if desired to die input waveguides 1222 and/or 1224, in a modified repetition of this structure in the direction of die beams 1250 and 1252. FIG. 39A shows schematicdly an example application of the dternative switch arrays in ' die n x n communications routing application. In this application, the opticd power in n input opticd channels is to be routed to n output opticd channels with minimal loss and minimal crosstalk. A controller sets up an addressable path between one channel and another. A simple square array is formed by repeating the structure of FIG. 38 until n inputs are arrayed on the left and n outputs are arrayed on the bottom, with switches at all n 2 of the waveguide intersections. The intersection angle may be any convenient angle. In this structure, the switching of any channel into any other is accomplished by activating one of the switches. The light beams cross each other at the waveguide crosses with a small amount of crosstalk which can be reduced by optimizing the waveguide geometry. This structure is capable of independent one-to-one connections between any input and any output. Note dso that the connections are bidirectiond so that a communications channel can be used equally well, and in fact simultaneously, in both directions. The switches are shown as implemented with gratings for specificity, but they may be implemented with dud TTR switches as described in reference to FIG. 37 by replicating the structure of FIG. 37 forming the n x n inputs and outputs, or witii any other opticd switching technique now known or yet to be discovered. Note that in the case of die TTR switches, the opticd data path does not pass through die vertex of the intersection between the input and die output waveguide. Instead, it passes through another waveguide near die intersection. According to die specific geometry of the switch, the input and output waveguides may intersect at a large angle as shown in FIGS. 37, 38 and 39, or at an oblique angle. The fixed reflectors 1088 and 1082 in the dual-ΗR switching geometry may not be required in the case of the obliquely intersecting waveguides. In this simple square geometry with n parallel input waveguides, there will be one input waveguide which can be connected into die closest output waveguide witii a single switch, forming a best case connection with lowest loss. At the other extreme, there will be one waveguide which must traverse 2(n-l) waveguide crosses to be switched into the farthest output waveguide. This worst case connection will have much higher loss then the best case connection. To reduce the maximum insertion loss of the switch array structure, asymmetric cross junctions may be used as described in reference to FIG. 36. The loss of the worst case connection will be best helped with every waveguide cross it traverses being an asymmetric cross pointing in the direction of propagation of the light dong either the input or the output waveguide. This structure is clearly not generalizable to the inner waveguides because use of asymmetric switches in the intermediate junctions will help some switching paths at die expense of others. What is needed is an dgorithm for selecting the optimd direction for the asymmetric crosses. A good way to dispose the asymmetric crosses is for roughly hdf of the crosses to point in each direction. Observe that the n(n-l) crosses on the upper left of die diagonal (but not including die diagonal) are predominantly used to distribute energy to the right. These crosses therefore should point dong die direction of die input waveguides, while the crosses on the lower right should point in the direction of the output waveguides. In a bidirectiond structure, the crosses on the diagonal should be simple symmetric crosses, herein cdled the simple diagonal arrangement of die asymmetric crosses. Other arrangements may be used according to different usage patterns, but this is a good general purpose arrangement. A n x m (where n > m) arrangement will permit full connectivity only between m "input" lines and m "output" lines. Here, "input" and "output" are only used for identification purposes since all lines are bidirectiond. The additiond n-m "system" lines may be useful for system control in both monitoring and broadcast functions. If line A wishes connection to line B, for exanφle, it would send system requests for that function until answered. Line m+3, for example, might be dedicated to scanning all die "input" lines for system requests. (To provide a similar line to monitor the "output" lines, a larger matrix of lines is required, such as the n x n matrix shown in FIG. 39A where m lines are dedicated to users in a sub group of m x m lines. A line such as line n-2 may then be used to monitor the "output" lines.) In monitoring, the system will turn on successive gratings corresponding to die "input" or "output" lines, and detect whether the line is active. Some power will be switched into die monitor detector by the successively switched-on gratings in line with the monitor detector if any one of the monitored lines is active. An active line will have an activated reflector connecting it to another selected line. However, the activated reflector will leak some power through to form a beam which can be detected by die monitor detector. When die monitor detector connected to line m+3 in this example switches on the switch 1255 (drawn as a grating switch for specificity) and receives die request from line A, the control system will have to check whether line B is busy. When the connection is made to line n-2 through switch 1253, the residud beam which leaks past the line B connection switch will alert the system that line B is active. If no activity is sensed, a system request can be sent to both lines A and B (possibly through the same monitor line if it has multiplexed send/receive capability, or possibly through a separate system line), and the switch 1254 can be closed to establish die connection. The broadcast function is not feasible from lines within the basic m x m switching block which is used for one-to-one connections, because even partially turning on the required row of switches corresponding to dl die outputs from a given input would interfere witii some of the already established and potentidly active communications connections between other channels. Broadcast is best accomplished from the system lines which are "outside" of the m x m switching block illustrated in FIG. 39A. (The "inside comer" of die geometry is the best case waveguide connection witii die lowest loss, between lines 1 on the "input" side and line 1 on the "output" side.) Line C is shown to be actively connected to most or dl of the "output" lines in FIG. 39A by means of gratings 1256 as an example of broadcast. The switches 1256 on line C must be only partially turned on so that sufficient power is delivered to each "output" line. A similar protocol may be used to prevent collisions between channels in the case of broadcast as in the case of simple communications connection. Broadcast connections would only be set up with inactive channels, and die system can group channels together and/or wdt for individual channels to permit broadcast to them. To increase switching efficiency, the waveguides may be large multimode waveguides, which in the case of a single mode communications network will be connected to the single mode input and output ports 1 through m with adiabatic expanders described elsewhere herein. The entire structure described above in reference to FIG. 39A is useful as an asynchronous transfer mode (ATM) switch, or in any point-to-point switched communications application. One useful variation of the structure is for multiple wavelength operation in a WDM network. Wavdength sdective opticd switches can be implemented as described herein by using poled grating switches, or by using tunable fixed gratings which tune into and out of a specified communications band. In a WDM network, the desire is to switch a specific wavelengdi between channels without affecting other wavelengths which may be travelling (bidirectiondly) in the same channel. With a tunable switch which can select a frequency of reflection while essentidly transmitting the other set of frequencies in the WDM spectrum, die simple geometry of FIG. 39A is appropriate. However, if a switched grating is used which has a single frequency of operation, separate connection paths are necessary for each wavelength. FIG. 39B shows a switched WDM communications network 1260 with separate paths for each frequency used in die network. This example is for a two frequency WDM network, but may be generalized to any number of frequencies of communication. Three "input" waveguides 1276 are shown in FIG. 39B connected to three ports la, 2a, and 3a, and three "output waveguides 1276 are shown connected to three ports lb, 2b, and 3b. The waveguides form nine intersections. At each intersection, there are three additiond opticd paths connecting each "input" and each "output". The additiond paths are identicd in this exanφle, and consist of three types. The first type 1266 of opticd path consists of a pair of fixed frequency switched reflectors both capable of reflecting the first one of die two signal frequency bands of the WDM system. The reflectors are preferably gratings transverse of the "input" and the Output" waveguides associated with the intersection, and reflect power in the first frequency band between the corresponding waveguide and an additiond waveguide segment connecting the two gratings. The second type 1268 of opticd path consists of a second pdr of fixed frequency switched reflectors both capable of reflecting the second one of the two signal frequency bands of the WDM system. Again, the reflectors are preferably gratings placed transverse of die respective waveguides and reflect power in the second frequency band between die corresponding waveguides and an additiond waveguide segment connecting the second two gratings. The third type 1270 of opticd path consists of a pur of frequency independent switched reflectors both capable of reflecting both signal frequency bands of the WDM system. This third type of opticd path may be implemented as the pdr of ΗR reflectors connected by waveguides and fixed mirror (described in reference to FIG. 37). In this case, ports la, 2a, lb, and 2b plus the associated waveguides 1276, 1277 form a 2 x 2 switching network capable of switching two frequency channels simultaneously between any "input" port and any "output" port. System control ports 3a and 3b with associated waveguides 1276, 1277 provide monitoring and system communication functions. If the first frequency of the WDM system is desired to be switched between port 2a and lb, for example, the two switches associated with the opticd path of type 1266 at the intersection of die waveguides connecting to ports 2a and lb are turned on, routing opticd power at the first frequency between ports 2a and lb through the waveguide connecting the two switches. If all frequencies associated witii a given port are to be routed into another port, the switches and opticd path of type 1270 are turned on at the intersection corresponding to the two ports. The opticd paths 1270 are really superfluous in a 2 x 2 network because to switch both WDM frequencies between any two channels, both corresponding paths 1266 and 1268 may be activated. However, in a high order communications network with many WDM frequencies, a single all-frequency connection is desirable since it will have the lowest loss. FIG. 40 shows a two dimensional one-to-many routing structure. A first row of waveguide routing switches connects opticd power from an input waveguide into columns of pixel waveguides. Again, no details of die switches are shown; they are shown schematicdly only as gratings, but may be implemented in several different ways. A two dimensional array of "pixel" switches routes power out of die pixel waveguides at "pixel locations". (What happens to this power at the pixel locations depends on die application.) Two levels of switching are used to reach dl die pixels. This structure may be used for display, to actuate or control processes or devices, or to read certain types of data. In die latter case die direction of the power flow is reversed, and the device operates as a many-to-one routing structure. An input opticd beam 1342 propagates in an input waveguide 1352 and is coupled into one of many pixel waveguides 1354 by one of a two dimensional array 1356 of switching elements. The switching dements 1364 may be implemented as grating switches as described above in reference to FIGS. 7, 8, 12, 13, and 38, or they may be ΗR switches as described in reference to FIGS. 30-32 and 37, or they may be any other switchable element. The beam 1344 is shown being switched by switch dement • 1358 into a pixel waveguide whereupon it is switched for a second time by switch element 1360, forming beam 1346 which propagates into the pixel element 1362. The pixel elements 1366 may be separated from the waveguides 1354 by waveguide segments as shown, or they may abut the waveguides at a short distance so that little of the switched light passes by die pixel elements. In the case of the display application, the pixel elements may be for producing emission of the light 1346 out of the plane of the substrate 1348. The pixel elements may then be roughened patches on the surface of the substrate 1348, or angled micromirrors, or roughened angled micromirrors for light diffusion, or phosphor-filled pits, or otiier means of producing visible light. In the case of die display, the input beam 1342 may contain several colors, in which case the waveguides are capable of guiding all of the colors and die switches are capable of coupling all of the colors. The waveguide switches are armn≠A in a sequence to produce die image of die display. A grating switch is implemented as a multiple period grating, but the TTR switch needs little modification for this purpose. The waveguides, if single mode, must effectively guide die shortest wavelengdi beam. The input beam 1342 is preferably modulated externally (including all its color components) so that the switching elements are simple on-off devices. Note that a single row electrode may be disposed across the columns of waveguides to actuate a row of pixel switches if die pixel elements are arranged in a more-or-less straight line and are connectable dectricdly dong a row. In die case of a projection display, a additiond lens structure is required to collect the light emitted by all the pixels in die array and refocus them on a screen at a (large) distance from die lens. The lens should preferably have a good off axis performance so that the focd plane is reasonably flat at the screen, and it should have a large enough numerical aperture (NA) to collect most of the light emitted by the pixel array. It would be advantageous to couple a lens array to the pixel structure to reduce the divergence of die beams produced by die individual lenses, reducing the (costly) NA requirement on the projection lens. Another way to achieve this is again to taper the waveguides to die largest possible size d die pixel. It is relatively easy to taper the pixels to a large transverse size, but difficult to obtain a very deep waveguide. Large pixels may be made by coupling a wide waveguide with a long grating coupler. The light distributed in the routing structure may dso be used to activate processes, as for example in the case of a DNA reader or an allergy reader, or a protein reader. In each of these specific cases, a separate array of DNA or allergens or proteins is prepared with fluorescent tags which can be excited by die light. One type of molecule or one preparation of molecules may be arranged for excitation over each pixel. The light is scanned electronically among die different pixels, and die speed and order of die scanning may be determined according to the results. The fluorescence may be collected for detection by an externd lens and detector. However, for some applications, it is advantageous for the pixel (and its lens) and waveguide structure itself to collect and guide the emitted radiation to an opticd energy detection means as well as to control the emission of the source light. Depending on die desired light iUumination and collection geometry, the lens may be a collimating lens, a refocussing lens, or even, conceivably a lens to produce a diverging beam. A collimating lens is separated from the end of die waveguide by die focd length of the lens so tiiat the transmitted (and collected) beam is essentidly parallel. Collimating lenses are most useful if there is a large volume of materid to be traversed by die interrogating light beam. A refocussing lens is separated from die end of the waveguide by the object distance, die inverse of which is related to the difference between die inverse of die image distance and die inverse of the focd length, where the image distance is die distance from the lens to the desired image beam spot. The refocussing lens is used if it is desired to concentrate die sample into a smdl spot and to illuminate and/or read it from a waveguide. A diverging beam is created by a lens separated by less than its focd length from the end of the waveguide. The output beam from a simple lens is not necessarily round if die divergences of the wave approaching the lens are different in die two planes. The simplest way to make a beam round ( for minimum spot area after refocussing) is to start witii a round beam at die end of die waveguide, which may be accomplished by design in die waveguide, or by tapering die waveguide. The lens preferably has the appropriate numericd aperture to admit the entire wave from the waveguide and focus it to a diffraction limited spot or collimated beam according to die application. The pixel element 1362 may be any of the elements mentioned above in this case, and it may be associated directly with the materid to be activated, or indirectly as by dignment with an externd plate to which the materid has been conjugated. Each pixel element may contain a lens aligned as described above so that a switch array may be coupled witii a lens array witii the image beam spots in a substantially common plane of focus. (Substantially common, in this case, means within a Rayleigh range or so of the true plane of focus, which may be quite distorted due to aberration. Use of a type of reflector instead of a diffuser in die pixel element 1362 is preferred if die routing structure is dso used to detect the fluorescent emission: the reflector couples die emission back into die waveguide whence it came. This coupling is maintained for as long as the switches for a given pixel are activated. If desired, die light source may be switched off prior to switching to another pixel element in order to resolve the decay of the emission. Used as a data reader, die sense of die light propagation is reversed from that illustrated in FIG. 40. Light from a device containing data is collected at die pixel elements and coupled into the routing waveguide structure which guides it back out the input waveguide 1352. Connected to die waveguide 1352 is a detector to read the data. The detector may be simultaneously connected to the waveguide via a beamsplitter between die waveguide 1352 and die light source used for illumination of the data media. The pixel elements 1366 (or simply "pixels") are preferably coupled witii the data spots via lenses to collect the light routed through the structure 1350 and direct it to the data medium. The lens coupling dso serves for collecting reflected or otherwise emitted light from the data medium and refocussing it on the end of the waveguide coupled to die pixel element. The data may be in a target volume, in which case the lens may be configured to collimate the light beam 1346. The data may be on a target surface, in which case the different pixel elements may correspond to different tracks on the rotating disk of a magneto-opticd data storage surface, for example, or of a CD. The lens is configured to refocus the light from the pixel to the data spot in a diffraction limited way. By associating the different pixels with different tracks, track-to-track switching may be accomplished electronically witii essentidly no dday time. The different pixels may dso be coupled to different planes on die data medium. This is useful for reading data which have been recorded in multiple planes on the medium, to increase totd storage capacity. Switching between die planes may dso be accomplished electronically by switching among pixels coupled to the different planes. In addition, several different pixel elements may be focussed to locations separated by a fraction of the track separation transverse of (preferably normal to) a given track. When the track wanders, positive tracking may be accomplished dectronicdly by switching between pixels, instead of mechanicdly. A sensor and electronics is needed to detect track wander, and a controller for switching to the desired pixels. The signd strengdi or the signd to noise ratio (SNR) may be detected in the different channels to determine die preferred (best digned) channel. If die switches dong the waveguide 1352 are configured as 4-way crosses instead of 3-way, with the fourth leg emerging at die edge of the substrate, a detector array 1368 may be placed in registration with the fourth legs, with individud detectors 1367 individudly digned witii the columns for detecting the return power from each column. The optimd reflectivity for the gratings which lie dong the waveguide 1352 is approximately 50% if the detectors 1367 are used, in order to maximize the return power from the data media on die detector array 1368. If a single beamsplitter is disposed in the waveguide 1352 upstream of the router structure, its optimd reflection is dso 50%. Note that partid excitation of the different pixels can be achieved by partid excitation of the switches dong dther the input waveguide or die pixel waveguides. The switching elements 1364 can be adjusted by means of die applied electric field to vary their reflection coefficient. Some of the beam may be transmitted through the desired partidly-excited switches for use in a second pixel simultaneously. Multiple pixel excitation is of particular interest in the case of track wander correction, since multiple detectors may dso be configured in the router 1350. For example, if three different pixels on three different columns of the routing structure 1350 are to be simultaneously excited their corresponding pixel column switches will need to be partidly excited. A computation is required of die controller to determine die appropriate excitation of the multiple switches. Neglecting losses at the switches, to produce equd intensities on their respective detectors for optimal SNR, the first switch corresponding to die first pixel column should be excited to reflect about 3/16 of the incident light, the second switch corresponding to the second pixel column should be excited to reflect about 1/4 of the remaining light which has passed through the first switch, and the last switch corresponding to die third pixel column should be excited to reflect about 1/2 of die remaining light which has passed through the previous two switches. About 15% of the incident beam is reflected into each detector, assuming 100% reflection from the medium and 100% light collection efficiencies. This result is quite good compared with the optimd 25% of the beam which is received on a single detector in die case of a single pixel (optimum switch excitation = 50% reflectivity). Indeed, more totd photons are collected witii three beams than with only one. Electronic tracking will result in cheaper, faster, and more reliable data read/write devices. Any combination of these approaches (electronic track switching, electronic data plane switching, and electronic tracking) may be taken to increase the performance of a data storage device. A means is dso needed to accomplish variable focussing electronicdly, potentidly removing dl mechanical motion (except for rotation of the media) from die drive. As described below in reference to FIG. 54, dectronicdly variable focussing may be accomplished witii a zone-plate lens by changing the wavelength of the light beam 1342. As drawn, die routing structure of FIG. 40 is a polarizing structure, with the 90° grating switches reflecting only the TM mode. As a result, only beamsplitting based on intensity can be used. It would be quite advantageous to be able to use polarizing beamsplitters because this would result in a factor of four increase in the signd strength for a given light intensity. However, a switching structure capable of transporting and then separating the two polarizations is required. Although the polarization dependence of the TTR switches may be made negligible at a sufficiently grazing ΗR angle (well below the angle for totd intemd reflection for the TE mode), there is a packing density penalty in using very low angle switching geometries. FIG. 41 shows a linear array of strongly polarization dependent switches arranged as a data reader 1370. The switches are excited witii a beam 1342 which is TM polarized and highly reflected in the activated switch 1372. Waveguides 1376 and 1378 such as titanium mdiffiised waveguides in lithium niobate are used which guide both polarizations. The pixel elements are implemented as micromirrors 1374 combined with integrated lenses 1380 and data spots e.g. 1382 arranged in tracks 1384 on a disk 1386 rotating about the axis 1388. The orthogonally polarized light which is reflected from birefringent data spots (or separators) on die data track is collected by die lens 1380, refocussed back to die waveguide 1378, and reflected by the micromirror back into the plane of the guides with TE polarization. Because die TE mode is both polarized at Brewster's angle for die grating and has different propagation constant not phase matched for reflection, it propagates through the switch without reflection into the detector 1367 of die detector array 1368. (Alternately, if the switch is a ΗR switch, the reflectivity is much less for the TE wave than the TM wave, and a large portion of the TE wave transmits through the switch an impinges on the detector.) If another switch 1373 is actuated instead of die switch 1372, the beam will propagate to a different pixel 1375 and be focussed according to die alignment of the pixel 1375 and its microlens 1381 dther into another data track, or to anodier data plane, or to die same track but with a transverse deviation of a fraction of a track width (according to whether the pixel 1375 is for track switching, data plane switching, or tracking control). Many variations are apparent on the structures described in reference to FIGS. 40 and 41, such as that any of the switches in the router may be oriented differently to change directions of opticd propagation in the plane, that multiple types of switches may be used in a single device, and that higher levels of switching may be added. Additiond variations are too numerous to mention. FIG. 42 shows a switchable integrated spectrum analyzer 930. The input beam 921 enters the input waveguide 923 which stops after a certain distance. The input beam 921 may be propagating in another waveguide or it may be a free space beam which is preferably digned and mode matched to optimize the power into the waveguide 923. The device 930 is provided with a planar waveguide 835 which constrains propagation within the plane. The light beam 927 emerging from the end of the input waveguide diverges in one plane within the planar waveguide until it passes through the integrated lens element 925. The integrated lens has an elevated index of refraction relative to the planar waveguide within a boundary defining an opticd thickness that reduces approximately quadraticdly from the opticd axis. (Or if it has a depressed index, die opticd thickness increases approximately quadratically.) The lens may be fabricated by masked indiffusion or ion exchange, or it may be a reverse poled segment excited by electrodes. The lens 925 collimates die light beam which then passes to at least one of three grating sections 929, 931, and 933. The gratings are formed from individual cells, each cell being a domain, die domains being distinguished from die background materid and separated by varying amounts according to the application. The cells have a permanent or adjustable index of refraction difference from die substrate, and different cells may be of different domain types. The permanent domain types include, for example, indiffused regions, ion exchanged regions, etched regions, radiation bombarded regions, and in general, regions formed by any type of index of refraction modifying process. The grating sections may be fabricated by etching, ion exchange, or indiffusion, in which case the gratings are permanent, but they are shown in the preferred embodiment fabricated from poled domains. Electrodes 932, 934, and 936 are used to individually excite the gratings in combination with the common electrode 938. The common dectrode 938 may be placed on the opposite side of die substrate as shown for simplicity, or surrounding the dectrodes 932, 934, and 936 for low voltage excitation. The cells in an individual grating may be arranged in dternate ways to form the desired periodicity in the desired direction to supply virtual photons with the required momenta. They may be arranged in rows to define certain planes with a virtual photon momentum normal to the planes with momentum defined by the spacing of the rows. In this case, there will dso be virtual photons with momentum dong the planes with momentum defined by the spacing of the cells in die rows. To phasematch retroreflection, the momentum of the virtual photon is exactly twice the momentum of the incident photons, and is directed in the opposite direction. Any other reflection process has a smaller momentum and is directed transverse of die incident axis. The period Λ of the row spacing is therefore fractionally related to the incident wavelength λ in that Λ is a fraction of the quantity λ/2n jff . In a general case, the cells may be separated by a distribution of distances which varies with position through the grating so that the virtud photon momentum dong any axis of incidence is determined by the spatid frequency spectrum (determined through the Fourier transform) of the cell distribution dong that axis. At least one of die gratings 929, 931, or 933 is turned on by adjusting the potentid state of the corresponding electrode. In FIG. 42, grating 929 is shown activated. The activated grating contributes virtud photons to the incident photons, phase matching die scattering process into an output direction forming a plurality of output beams 935 and 937 with different wavelengths, the output beam being separated in angle according to their wavelength. The output beams from the activated grating 929 pass through the lens 939 which refocusses the output beams onto a detector array 941. The detector array is a group of sensors disposed to receive a portion of the output beams for detection, and are preferably bonded to an edge of die device 930 as shown. However, if it is desired to integrate the device 930 onto a larger substrate, it may not be desirable to have an edge of the substrate in this location. In this case, other beam extraction methods (such as verticd deflecting mirrors) can be used to deflect a portion of the beams 935 and 937 into the detector array. The sensing means is placed approximately within about one Rayleigh range of the focd plane of the output lens 939. In this position, the input beam angles are mapped into output beam positions. Since the gratings map input wavelength into output beam angles, a collimated input beam results in different input wavelengths being mapped into different positions in the focd plane, with spatial resolution of die wavelengdi spectrum depending on the characteristics of the grating. The detected power as a function of the location of the detector in the array 941 is related to die frequency power spectrum of the input beam 921. The device 930 is therefore a spectrum analyzer. It is also a multichannel detector if the input beam is divided into channels occupying several displaced frequency channels, and the device is configured to disperse die channels into predetermined detectors or groups of detectors. By switching on different gratings, the device can be reconfigured to function in different frequency ranges. For example, if grating 931 or 933 is activated, die dispersed light is focussed by lens 939 onto either a different detector array 943 or a different portion of an extended detector array 941. The frequency range of the gratings is determined by the angle of the grating to the beam, and the periodicities of the grating. Grating 931 is shown to have a shallower angle to the beam so that a higher opticd frequency range is selected when it is activated. Grating 933 has multiple periodicities transverse to each other so that multiple overlapping frequency ranges can be selected. Multiple frequencies may be mapped into poled region boundaries as described above in reference to FIG. 18. The poled elements of the grating 933 may be arranged generally in planes oriented normal to the two principle virtud photon momentum directions. The phasing of the planes is determined by the process for transcribing the component frequencies of the desired grating into domain boundaries. However, die general grating may have momentum components in all directions, in which case the resulting domain boundaries may not organize into planes except possibly in a prinicpal direction. A transmitted beam 913 is refocussed by integrated lens 907 into an output waveguide segment 909 to form the output beam 911 which contains at least a portion of the out of band portions of the input beam 921 which did not interact with the gratings. A useful variation of the switched range spectrum analyzer combines elements of FIGS. 42 and 30-35. The basic idea stems from the fact that the spectral range of a gratmg can be shifted by changing its angle, or equivdently the source point. In this variation, a waveguide routing structure is used to allow die source point to be switched. Waveguide switches are placed on the input waveguide 923 (and possibly on die emanating waveguides) at one or more locations, producing an array of paralld source waveguides among which the input light beam 921 is switchable. The waveguides all end in the same plane, preferably the focd plane of the input lens 925. The remainder of the spectrum andyzer remains the same, dthough with multiple inputs it may not be necessary to have the additiond gratings 931 and 933. The separation of the multiple switched input waveguides is adjusted according to die application to achieve the desired switchable spectral ranges for the analyzer 930. FIG. 43 shows a poled acoustic multilayer interferometric structure 953. The incident acoustic wave 972 may be a bulk or a surface acoustic wave. A poled structure is fabricated in the region 955 of a piezoelectric substrate 965, containing two types of domains 963 and 964. It is known (e.g. U.S. Patent 4,410,823 Miller et d.) that polarity reversals result in partid acoustic wave reflection. The reflection into beam 973 and the transmission into beam 961 is affected by die spacing of die interfaces between the poled regions. If high reflection and low transmission is desired, adjacent interfaces should be spaced by a distance equd to an integral multiple of half an acoustic wavelength. If high transmission is required through a structure, with low reflection, the spacing should be equd to a quarter of an acoustic wavelength plus any integral multiple of hdf a wavelength. By applying an appropriate number of poled regions near an interface where the acoustic impedance changes, an antireflection (AR) structure can be fabricated provided tiiat the phases of the reflected waves are chosen to be out of phase with and the same amplitude as die reflected wave from die interface. FIG. 44 shows a poled bulk acoustic transducer 971. An input acoustic beam 972 is incident on a poled region of a piezoelectric substrate 965 containing a pdr of electrodes 974 and 975. The poled region contains two types of domains 963 and 964 which are optimdly reversed domains. The dectric field induced by the acoustic wave in each of the poled regions can be selected to be identical by reversing the poling direction every hdf acoustic wavelength. In this case, a single electrode may be used to pick up die induced voltage instead of die prior art interdigitated electrodes. The electrodes 974 and 975 are used to detect the presence of the input wave 972. The output voltage, tapped by conductors 979 and seen in die electronic controller 978, varies sinusoiddly (for a narrowband input) as a function of time with an amplitude related to die amplitude of the acoustic wave. As discussed above, if the poled interface spacing is a hdf wavelengdi, die structure dso acts as a high reflector, which may not be desirable in a given implementation. This characteristic may be eliminated by spacing die interfaces dternately at one quarter wavelength and three quarters of a wavelength as shown in FIG. 44. In this case, the structure is an antireflection coating, eliminating the undesired reflection. Since dmost die entire acoustic wave penetrates into the poled structure, where its energy can be dmost totally absorbed into die detection electronics, this structure 971 is an efficient tuned detector of acoustic energy. The bandwidth of the structure is inversely related to the number of acoustic periods that fit within the poled structure covered by the electrodes. The efficiency is related to the acoustic path length under the electrodes. The bandwidth and die efficiency of die detector are therefore related, and can be adjusted by changing the size of the detection region. The structure 971 can dso be used as an acoustic generator, essentially by running the process in reverse. A time dependent electrical signd is applied between die two electrodes at the frequency of die acoustic wave it is desired to excite. The piezoelectric coefficient of the substrate produces a periodic strain at the frequency of the acoustic wave, and a pair of waves are generated, one 961 propagating in the forward direction and one 973 in the reverse direction. A high efficiency unidirectional generator can be made if it is desired to generate only a single wave, by combining the devices 953 and 971, witii 953 being configured as a totd reflector for the undesired wave. If the totd reflector is oriented at 90° to die undesired wave and die phase of die reflected wave is chosen to be in phase with the desired wave, die two waves will emerge in a single direction as essentially a single wave. A variation of the structure of FIG. 44 is a strain-actuated opticd interaction device. In this device, the poled regions 964 and 963 are actuated by a strain field, producing a change in the index of refraction through the photoelastic effect. Now the structure 975 is a strain-inducing pad which may be deposited onto die substrate materid 965 at an elevated temperature so tiiat the different coefficients of thermal expansion of the film and the substrate create a strain field at room temperature. The mechanicd strain field, working through the photoelastic tensor, produces index changes in the substrate which change from domain to domain, again producing a substrate with patterned index of refraction which can be used as described elsewhere herein. Electric fields using the electro-optic effect can be combined witii the photoelastic effect provided tiiat the deposition process of die electrodes do not undesirably affect the desired strain field. The structure 890 of FIG. 45 is a tuned coherent detector of pairs of light waves. It is tuned in the sense tiiat it will only sense frequency differences between light waves within a certain bandwidth about a desired central "resonant" frequency difference. In the simplest case, the device is configured with equd separations between interdigitated electrodes 885 and 886 which form a periodic structure with period Λ. At a given instant, die two input frequencies present in the input beam 887 produce an interference pattem of electric fields within the waveguide 888 witii a spatid period which depends on die opticd frequency difference and the index of refraction of the substrate 889 at the opticd frequency. At a frequency difference where die spatid period of the interference pattem equds the period Λ, the electrode structure is on resonance, and die electrodes will be excited to a potential difference due to the induced displacement charge at the top of the waveguide. The frequency response characteristic is related to a sine 2 function with resonant frequency determined by the opticd frequency difference at which two optical waves dip phase by 2τ in a poled grating period. The buffer layer 891 is required to minimize the loss to the propagating opticd waves when the electrode structure is ldd down. It does not substantially reduce die strength of the induced potentid if its thickness is much smaller than the period Λ. The interference pattem has a low frequency component which oscillates at the frequency difference between the two light waves. The electronic signd which is picked up by the electronic controller 978 via leads 979 therefore also oscillates d the difference frequency. The amplitude of die electronic signal is large at the resonance difference frequency, and falls off d otiier difference frequencies according to die bandwidtii of the device, which is related to die inverse of die number of beat periods contained witiiin the interdigitated electrode structure. The interdigitated electrodes may dternately be configured witii multiple frequency components so that there are several resonant frequencies, or so that the bandwidtii of the response is modified. Note dso tiiat the device may be sensitive to multiple orders. If die electrodes are narrow compared to a hdf period, there will be a significant response at the odd harmonics of the resonant difference frequency. By shifting the fingers relative to each other so that there. is asymmetry dong die axis of die waveguide, a responsivity can be created to die even harmonics. This higher order response can only be improved at die expense of lowering the first order response. It can be rninimized by centering die electrodes relative to each other, and by increasing their width. Finally, the waveguide 888 is not strictly necessary. It may be omitted, but the detected waves should be brought very close to the dectrodes to optimize the signd pickup. FIG. 46 shows a low loss switchable waveguide splitter 780. This device has a permanent wye waveguide splitter 774 consisting of an input waveguide segment widening into a wye junction and branching into two output waveguide segments 775 and 776 which are both opticd path possibilities for light incident in the input segment. The widths and index profiles of the input and output segments are preferably equd. The splitter 780 dso has a poled structure 778 which has an electro-optic coefficient within the region of the wye splitter 774. The poled region 778 may be a thin layer near the top of the substrate, which may have multiple layers, or it may extend throughout the substrate. The remainder of die substrate may be poled or unpoled. A pair of planar electrodes 777 and 779 are disposed adjacent to each other over the waveguides, witii one electrode 777 covering a portion of one output waveguide 775, and the other dectrode 779 covering a portion of the other output waveguide 776. The dectrodes are planar only to the extent that this optimizes fabrication convenience and function: if die surface they are applied to is flat or curved, they conform. The edge 781 of die electrode 777 crosses die waveguide 775 d a very shdlow angle, and forms a smooth continuation of the inside edge of die waveguide 776 d the wye junction. Likewise, the edge 783 of die electrode 779 crosses the waveguide 776 at a very shallow angle, and forms a smooth continuation of die inside edge of die waveguide 775 at the wye junction. When the dectrodes are excited relative to each other with one polarity, the index of refraction under the electrode 777 is depressed and die index under the electrode 779 is increased. As a result, an excited region under die electrode edge 781 forms a waveguide boundary, steering die input beam 789 almost entirely into the output beam 784 with very little power leakage into the dternate output beam 782. The increased index under die electrode 779 aids in steering die opticd energy away from the boundary 781. When die opposite polarity is applied between the electrodes, die input beam is steered almost entirely into the other output beam 782. If no voltage is applied, die input power is evenly divided into the two output ports if the structure is made symmetric. This structure is therefore a 3 dB splitter which can be electrically switched as a beam director into one of two directions with low loss. The electrodes 777 and 779 are tapered away from the wye structure 774 d the input to the structure forming a gradual approach of the lower index region towards the waveguide to minimixr*. opticd losses. The smoothing effect of the electrostatic field distribution produces a very smooth index of refraction trandtion under both electrodes. The edge of die electrodes which crosses die output waveguides far from the wye branching region is preferably arranged at 90° to die waveguide to minimize losses. The wye splitter may be arranged in an asymmetric way to produce a splitting ratio different from 3 dB witii the fields off. This can be done by increasing die deviation angle for one of the waveguides and/or decreasing die angle for the other. The switching function operates almost as well with an asymmetric structure as with a symmetric structure, provided that a sufficiently large electric field is applied with the electrodes. The extinction ratio (the ratio between the power in the switched-on waveguide and die power in die switched-off waveguide) can remain very large despite a large asymmetry. However, the opticd losses will be somewhat different in die two legs of an asymmetric switchable waveguide splitter. The device 780 may, therefore, be configured as a splitter with any desired splitting ratio, and still be switched witii good efficiency and high extinction ratio. This device may be cascaded to dlow switching among more than two output waveguides. If, for instance, the output waveguide 775 is connected to the input of a second device similar to 780, its power may be passively or actively switched into an additiond pdr of waveguides. Sixteen switched output lines may be accomplished with four sets of one, two, four, and eight switches similar to 780. The power division ratio among these lines may be configured to be equd in the unswitched state, or any other power division ratio. When the switches are activated, a single output waveguide may be turned on, a single output waveguide may be turned off, or any combination of output waveguides may be turned on and off. The direction of propagation of the light in the device may be reversed. In this case, an input on dther one of the output ports 775 and 776 can be switched to emerge from die input port. In the absence of an applied voltage, die power d each output port is coupled into the input port with a given attenuation (3 dB in the case of a symmetric device). When the field is switched on, power in die "on" waveguide is connected into the input port with very low loss, while the power in the "off" waveguide is very effectively diffracted away from die input waveguide. The "off" waveguide is essentidly isolated from the input port. Alternatively, a mirror image device may be connected back-to-back with the switch 780 so that the input waveguides join together, forming a 2 x 2 switch or router. An input on either pair of waveguide ports may be switched into either waveguide of the other port pdr. Again, is possible, producing an n x n switch/router. FIG. 47 shows an dternative realization 790 of a switchable waveguide splitter using multiple poled regions. In this configuration, the switched index difference dong die boundaries of the waveguides in the wye region is enhanced, thereby confining better the opticd mode into a narrower region, and reducing the residud coupling into the switched-off output waveguide. Two poled regions 785 and 786 are disposed on each dde of the input waveguide 774 dong the wye splitting region. The poled regions have boundaries 787 and 788 which cross the output waveguides 775 and 776 d a very shallow angle, and which form a smooth continuation of the inside edges of the waveguides 776 and 775 d the wye junction. The boundaries of the poled regions taper slowly away from die input waveguide to allow a dow onset of the electricdly excited index change, and they cross the output waveguides at a large distance from die wye junction where the electric field is substantially reduced, in order to reduce the opticd loss. Electrodes 791 and 792 are disposed substantially over the poled regions 785 and 786. A potentid difference is applied to the electrodes, exciting an electric field in an electrostatic pattem throughout the volume between and around them. The electric field penetrates the poled regions and die surrounding regions, inducing a corresponding pattem of opticd index changes. The locd opticd index change is related to die product of die local electric field direction and the locd electro- optic coefficient. The poled regions are preferably surrounded by regions of opposite polarity, in which case their electro-optic coefficient is of opposite sign to that of the surrounding regions. At the interfaces 787 and 788 there is a sharp change in the index of refraction. On one side of die waveguide, die index is reduced at the interface, producing a guiding tendency away from the low index region. The opposite is true of the otiier side. If the applied electric field is large enough, the interface with the reduced index forms a waveguide boundary. Since the guiding interface connects smoothly as an extension of the inside boundary of the output waveguide across from die poled region, die input light beam 789 is guided into that output waveguide. The light leak is low into the switched-off waveguide if the curvature of the guiding boundary is gradual. There is low loss d the input, because the poled regions approach the waveguide dowly. There is low loss at the wye junction, because the portions of the poled regions which extend beyond die junction depress die guiding effect of the switched-off output waveguide, and enhance the guiding of the switched-on output waveguide. As an dternative, the poled regions could be surrounded by unpoled material. There is still an abrupt change in the index d die interfaces 787 and 788 so die device still functions, but the index change is only hdf the vdue obtained when die poled regions are surrounded with reverse poled materid, so the applied fidd must be higher. The dternatives described before dso apply to this device. FIG. 48 shows d e key design elements of a 1 x 3 switch. The design elements illustrated here show how to transform the device 780 of FIG. 46 into a 1 x 3 switch with a single poled region and patterned electrodes. The device contains a permanent branching waveguide witii the desired number n (n « three) of output branches. The waveguide passes through a poled region which extends deeper than the waveguides (for good extinction ratio) and significantly beyond the junction region where the waveguides have become separated by a large amount (such as three times their width). Several zones are defined by the waveguide boundaries, by their smooth extensions back into the boundaries of the input waveguide, and by normal boundaries across the output waveguides at a distance significantly beyond die junction region. There are (n 2 + 2n - 2)/2 zones so defined. It is useful to extend the outermost zone beyond the outside of die outermost waveguide as shown to taper die input. A separate electrode is placed over each of the regions with a small gap between all electrodes, but sufficient gap to avoid electricd breakdown when excited. To operate the device, electric fields are independently applied to die zones with polarity determined by whether or not the corresponding zone is confined within the desired waveguide. For example, die five zones of FIG. 48 are excited according to Table I. As before, the magnitude of the dectric field is adjusted to produce a good guiding boundary along the edges of adjacent zones excited d different polarities. Electrode Number Top Middle Bottom 1 + - - 2 + + - 3 - + - 4 - + + 5 - - + Table I Alternatively, the design elements of FIG. 48 dso show how to transform die device 790 of FIG. 47 into a 1 x 3 switch witii multiple poled regions. The device again contains a permanent branching waveguide with the desired number n (n = three) of output branches. Again, several zones are defined by die waveguide boundaries, by their smooth extensions back into the boundaries of the input waveguide, and by boundaries which cross the output waveguides at a distance significantiy beyond die junction region. Again, it is useful to extend the outermost zone beyond die outside of die outermost waveguide as shown, in order to taper the input. Each zone is poled in die opposite direction to neighboring zones with a common zone boundary. Zones with the same poling direction may share d most a vertex. Preferably, the input waveguide region is poled oppositely to die innermost zones (i.e. the zones closest to the input waveguide). In FIG. 48 the innermost zones are labelled zones 2 and 4. This zone- based polarity selection procedure results in only zones 2 and 4 being reverse poled, while zones 1, 3, and 5, which are die output waveguide zones, are poled positive (in the same direction as the surrounding region, if die surrounding region is poled). If four output waveguides are used, there are nine zones, six of which are reverse poled, including dl of the output waveguide zones. The splitter implementations which have an even number of output waveguides, therefore, have some advantage because only die even splitters have their output waveguide zones poled opposite to a potentid substrate poling, with the attendant advantage of increased confinement d the final division point and higher transmission for the "on" states and better reverse isolation in the "off" states. A separate electrode is placed over each of die regions. To operate die device, electric fields are independently applied to the zones, but now the rule for the polarity is different. The polarity is determined by two factors: whether or not the corresponding zone is contained within the desired waveguide, and the polarity of the poled region underneath. For exanφle, if a positive polarity applied to a positively poled region produces an increase in the index of refraction, the following selection roles are followed: if a zone is poled positive, the dectricd excitation polarity is selected to be positive if die zone is inside die desired waveguide and negative if the zone is outside; if a zone is reverse poled (negative), the polarity is selected to be negative if the zone is inside the desired waveguide, and positive if the zone is outside. In Table II are shown the optimd poling direction of die zones for the n = 3 case with three output ports as shown in FIG. 48. The design of 1 x n and n x n switches is derived by induction from the descriptions of the FIGS. 46, 47 and 48. Zone Poling Direction Top Middle Bottom 1 - - + + 2 + + + - 3 - + - + 4 + - + + 5 - + + - Table II The planar components described herein may be stacked into multiple layer three dimensiond structures containing electro-opticdly controlled devices and waveguide components. Stacks or diree-dimensiond constructions of planar waveguides and switches are fabricated by dternately layering or depositing electro-opticdly active, polable thin films, preferably polymers, and buffer isolation layers, which may be either insulating or electricdly conducting. Advantages of stacked structures include better crosstalk isolation due to more widely spaced waveguide elements. Higher power handling capability is also achieved because more opticd power can be distributed among die layers. Individud layers can be used if desired to distribute individud wavelengths in a display device. Once deposited on a suitable substrate, poling of the active opticd waveguide/switching layer is done using the techniques heretofore described. A buffer layer of lower index is necessary to isolate one active layer from adjacent layers, and is designed to establish die desired guiding in the dimension normd to the plane. Buffer layers of Si0 2 , for example, may be used. Next comes a ground plane which can be fabricated from a metdlic layer since it is isolated from die optically active layers, followed by a thick buffer layer. The buffer layers must dso be capable of withstanding the applied voltages between die different layers of electrodes and ground planes. In polymers, a large area may be poled, and desired regions selectively de-poled by UV irradiation techniques as previously described in order to create waveguide features, even after a transparent buffer layer, such as SiOj has been applied. Or, poling can be performed electricdly. With polymers, de-poling one layer by UV irradiation will not affect the layer behind it because of die shielding provided by the underlying metdlic ground plane. Metd electrodes and conductive paths may then be ldd down by standard masking and coating techniques, followed by another insulating buffer layer, and the next active layer. The buffer layer should be planarized to minimize die loss in die subsequent active optical waveguide/switching layer. This process of adding layers may be repeated as often as desired for a given device. A variation in fabrication technique for making activation paths and electrodes for die poled device stacks is to coat the electro-optic layer with an insulating layer that is subsequently doped or infused to produce electricdly conductive patterns within the buffer layer using standard lithographic masking techniques. Incorporating the electrodes into die buffer layer would serve to minimize die thickness of the stacked device. Hybridized devices consisting of different electro-opticdly active materids could be used to ameliorate fabrication complexities. For example, the first electro-opticdly active layer containing waveguide devices could be fabricated in a LiNb0 3 substrate, which would dso serve as die support substrate. Next a buffer layer and a layer of electrodes for die lithium niobate devices are depoated. Two insulating buffer layers sandwiching a conducting plane would then be coated onto die device prior to depositing the next active layer which could be a polable polymer. Subsequent layers are built up, poled and patterned as described earlier. The conducting planes in between buffer layers may serve both as electrodes to permit area poling of each polymer layer and to shield previous layers from the poling process. Stacked waveguide arrays may be used, for example, as steering devices for free space beam manipulation. Electricdly activated and individually addressable waveguide elements stacked closely together, and aligned with a source array form a controllable phased array for emitting opticd radiation. The relative phases of the beams can be adjusted by varying die voltages on die poled zones as described previously. By adjusting these phases in a linear ramp, the emitted light from an array of waveguides can be swept in direction rapidly within the plane of the array. A linear array of devices on a plane can therefore sweep within the plane only. However, when poled waveguide array planes are vertically integrated into a three dimensiond bulk device, opticd beams emanating from the device may be directed in two dimensions. An extension of this concept is the mode control of multimode laser bar arrays using a stack of waveguide grating reflectors. The waveguide stack is dimensionally matched to butt-couple to a laser diode array. By controlling die phase of the individud elements, the emission mode pattem of a multi element laser bar can be controlled. In devices where single mode waveguide confinement is not necessary, multimode or bulk arrays may dso be stacked, for example, to increase die power handling capacity of a switched poled device. FIG. 49 illustrates an embodiment of die phased array waveguide stack section 1630 with only a single column of waveguides illustrated for clarity. Opticd radiation 1640 enters the stack 1630 through waveguides 1638 which have been fabricated in an electro-opticdly active thin film 1650, such as a polable polymer. Here the input beams 1640 are shown staggered to represent beams of identicd wavelength, but with different phases. Light travels dong die waveguides 1638 in which tiiey encounter poled regions 1634 within which the index of refraction may be modified electronically using the techniques described herein. Beams 1642 represent the output of the phased array after each light wave has been individudly phase adjusted to produce output component beams that are aligned in phase. Many other input and output wave scenarios are possible. For instance, a single mode laser beam with a fid phase wavefront could illuminate an area of waveguide elements, which would then impose arbitrary phase delays across the spatid mode of die beam, thereby dlowing the beam to be dectronically steered in free space. Directiond beam control devices using this method would be much faster and more compact than current mechanicd or A-O devices. Using opticd-to-dectricd pickup devices described herein or known in the art, phase differences or die presence of multiple frequency components may be sensed within or externd to die stacked device in order to provide instantaneous information for a feedback loop. The device segment 1630 represented here is constructed on a substrate 1632, such as SiO-, by dternately depositing electrodes, buffer layers, and polable materid in the following manner. A broad area planar electrode 1654, composed of an opaque metallic film or transparent conductive materid such as indium-tin-oxide, is deposited, and followed by an electrically insulding buffer layer 1652, such as SiOj, which dso serves as the lower boundary layer for die waveguide 1638 fabricated in the next layer of polable material 1650. On top of die polable layer 1650, another buffer layer 1652 is added to form an upper waveguide bound before depositing the patterned electrode 1636 used to activate the poled structures. Another buffer layer 1652 is then added, this time to electricdly insulate the patterned electrode from the next layer, another broad area planar electrode 1654. The patterned electrode 1636 is separated from one planar electrode only by a thick buffer layer, and from the other by buffer layers and die polable materid. Since it is desired to apply fields across die polable materid, the electricd separation across the polable materid should be less than the separation across the buffer layer only. The layering sequence between broad area electrodes is repeated until the last layer of polable materid 1650, after which only a buffer layer 1652, patterned dectrode 1636, and optiond find insulating layer 1652 need be added to complete the stack. Electrical leads 1646 and 1648 are brought into contact witii electrodes 1636 and 1654, respectively, through integration and bonding techniques known to die art, and connected to voltage distribution control unit 1644. The voltage control unit 1644 serves a dud purpose: to activate the poled devices individually, and to isolate each from the electric field used to control neighboring layers of active dements. The unit 1644 would be in essence a collection of coupled floating power supplies in which die voltages between electrodes 1636 and 1654 sandwiching an active layer may be controlled without changing the voltage differences across any otiier active layer. Region 1634 depicts a poled region witii one or more domains, and dectrode 1636 depicts an unbroken or a segmented or patterned region witii one or more isolated elements. Waveguide stack 1630 is described as a device for phase control, but stacks of waveguide structures may include any number of combinations of poled devices described herein, in series opticdly, or otherwise configured. FIG. 50 shows a prior art adjustable attenuator 1400. An input waveguide 1402 traverses an electro-optically active region of a substrate 1404. An input opticd beam 1406 propagates dong die input waveguide into an output waveguide 1408, forming the output opticd beam 1410. Electrodes 1412, 1414, and 1416 are disposed over the waveguide so tiiat when electrode 1414 is excited d a given polarity (poative or negative) with respect to the two electrodes 1412 and 1416, there is an induced change in the index of refraction within the segment 1418 region of the waveguide under and adjacent to the dectrodes due to the dectro-optic effect. The electrode configuration is somewhat arbitrary and may be different and more complex than shown in the prior art represented by FIG. 50, but die common factor which all the patterns have in common is that overall, they reduce the index of refraction in the core when excited to a voltage, and increase the index of die surrounding regions. In the absence of applied electric field, the loss of the waveguide segments is low, determined primarily by scattering on roughness dong the waveguide wdls. However, when the dectric fi d is applied, the loss can be increased to a very large value. The three electrode pattem allows a negative index change within the waveguide at die same time as a positive index change occurs outside the waveguide, substantially flattening and broadening the index profile. When die field is applied, the modified section of the waveguide 1418 under die electrodes has a much wider lowest order mode profile from the input 1402 and output 1408 sections of the waveguide. As a result, mode coupling loss occurs both when the input beam 1416 transitions into the section 1418 and when die light in section 1418 couples back into the output waveguide 1408. If die index changes are large enough, the lowest order mode goes bdow cutoff, and die light emerging from the end of the waveguide 1402 diffracts almost freely into die substrate, resulting in a large coupling loss at the beginning of the waveguide 1408. When a given mode enters the modified section 1418 of the waveguide, die overlap between its intensity profile and any mode profile of die modified section 1418 is reduced by the change in die index profile of the modified segment. If the segment 1418 is multimode, several propagating modes and radiation modes will be excited. If it is single mode, many radiation modes will be excited. The combination of these modes then propagates to the far end of die segment 1418 and couples into die output waveguide section 1408, where only a fraction of the light couples back into a mode of die waveguide to form the output beam 1410. By controlling the voltage applied to die electrodes, the loss in the device 1400 can be adjusted from very low to very high. The maximum loss which can be obtained depends on die magnitude of die index change, the size of the excited regions, their length, and on whether the input and output waveguides are single mode or multimode. In a variation of the geometry, only two electrodes might be disposed over die waveguide segment 1418, decreasing the index within the waveguide segment and increasing die index to one dde instead of on both sides. The function is again as an attenuator, but the rejected radiation fields will tend to leave the device towards d e side of die increased index. This ability to direct die lost radiation might be of advantage in some systems where control of the rejected light is desired. An absorber may dso be placed downstream of die segment 1418, on one or both sides, to prevent die rejected light from interfering with other functions elsewhere in the system. FIG. 51 shows a poled switched attenuator 1420. This device is an improvement on die prior art device of FIG. 50 in that poled regions are used to increase the definition of the index change and increase the index discontinuity, thereby increasing the amount of attenuation which can be obtained in a single stage. Regions 1422 and 1424 are electro-opticdly poled in a reverse direction from the surrounding material. (As an dternative, the surrounding materid may be unpoled, or have no electro-optic coefficient, or it may simply be poled differently from the regions 1422 and 1424.) The central electrode 1426 covers both poled regions and surrounding materid. It is excited relative to the electrodes 1428 and 1430 to produce a change in index of refraction in the poled regions 1422, 1424, and the surrounding materid. The device 1420 operates in a similar way as described above in reference to the device 1400. The applied voltage reduces and broadens die index profile of die waveguide segment 1418, reducing the coupling between the mode of the output waveguide 1408 and the modes excited in the segment 1418 by the input beam 1406. In this configuration, the change in the index profile is abrapt at die beginning of the modified waveguide region 1418, and therefore the loss is larger. The number and shape of die poled segments 1422 and 1424 can be varied so long as the mode coupling with the excited waveguide segment 1418 is different from die mode coupling with the unexcited segment. The device may be configured with high loss in the electricdly unexcited condition, adjusting to low loss in the electricdly excited condition. In this case the electricdly excited regions and/or die poled regions form a portion of the structure of the waveguide segment 1418. The waveguide segment 1418 may itself may be configured in many different ways, most notably if it is absent entirely without excitation, in which case the device is similar to the switched waveguide modulator of FIG. 29A. As described above, these devices may be cascaded, in this case to increase the maximum attenuation. The devices of FIG. 50 and FIG. 51 can dso be operated as a variable intensity localized ("point") light source. The light propagating in waveguide 1402 is confined to follow the path of the waveguide until a voltage is applied die electrode structure. When the waveguiding effect is reduced or destroyed by changing the index of refraction, part or dl of the previously confined light beam will now propagate according to free-space diffraction theory. The diffracting beam will continue to propagate in the forward direction while the beam area expands in two dimensions to be much larger than the core of the waveguide 1408. At an appropriate distance away from the electrode structure, the beam area can fill a large fraction of the substrate aperture and appear to a viewer as a point source of light emanating from a spatid location near the electrode structure. If desired, a one-dimensiond locdized source can dso be constructed with this technique. The waveguide segment 1418 in FIGS. 50 and 51 can be embedded in a planar waveguide structure fabricated using techniques known to the art, such that when an appropriate voltage level is applied to die dectrode structure, the transverse confinement of the mode is destroyed while the verticd confinement in the planar waveguide is not. Thus the beam area would expand in one dimension, confining the light to a narrow plane. FIG. 52 shows a poled device 1500 with an angle broadened poled grating. The method shown for broadening die bandwidtii is an dternative to the bandwidtii modifying approaches described in reference to FIG. 18 and elsewhere herein. A periodic structure 1500 is shown with poled regions 1502 which are preferably reverse poled into a poled region of the substrate 1504. Other structures such as waveguides and electrodes and additiond gratings are incorporated as desired. The domains 1502 cross the central axis of propagation of the input beam 1508 with a pattem which may be strictly periodic with a 50% duty cycle. The sides of die top surfaces of die poled regions dl dign dong lines drawn from an alignment point 1506. The poled regions approximately reproduce their surface shape some distance into die material. The result is a poled structure with periodicity which changes linearly with the transverse podtion in the poled substrate. An input beam 1508 which traverses the poled region may be a freely propagating Gaussian beam (if the domains are deeply poled) or it may be confined in a waveguide 1512. According to die function of the grating, the input beam may be coupled into a filtered or frequency converted output beam 1510, or into a retroreflected beam 1514. The range of periodicities in the grating structure (and hence its bandwidtii) depends on die width of die beam and separation of the point 1506 from the axis of the beam. By adjusting these quantities, the bandwidtii of the poled structure may be increased substantially over the minimum vdue determined by die number of first order periods which fit in the grating. There is a limit on the maximum desirable angle for the poled boundaries, and therefore the structure shown in FIG. 52 cannot be extended without limit. However, a long interaction region can be obtained by cascading several segments together. To maximize the coherence between the segments, the periodicity of the domains dong the central axis of the beam should be unmodified at die joins between segments. There will be at least one wedge shaped domain between segments. Although increasing the bandwidth of die grating decreases the interaction strength, it makes a device using that grating significantly less sensitive to smdl frequency drifts. For example, a frequency doubler device using an angle broadened grating is more tolerant of temperature drifts. Anodier example application is the channel dropping filter which tends to have narrow bandwidth because of the strong gratings which must be used. Use of an angle broadened grating enables a widened pass band to accept high bandwidtii communications signals. The angle broadened grating can dso be applied in the other grating configurations discussed above. There are dternatives for implementing the angle broadened grating which do not follow the exact pattem described above. For example, die relationship between the angle of the grating periods and the distance dong die propagation axis might be more complex than linear. A quadratic or exponentid variation might be more appropriate for some applications where the majority of the interacting power exists d one end of die grating. The angle broadening technique is dso applicable to prior art types of gratings such as indiffused, ion exchanged, and etched gratings. An dternative angle broadened device 1520 using a curved waveguide is shown in FIG. 53. In this case, the poled regions 1522 have parallel faces, and die angle of the faces are inclined only relative to the locd direction of propagation within the guide. Again, the bandwidtii is broadened by die different components of the wave experiencing different Fourier components of the grating. The curved waveguide has a higher loss than the straight waveguide, but large curvatures are not required. Several sections as shown in FIG. 53 may be concatenated, forming for example a sinuous waveguide structure that waves back and forth around an essentidly straight line. FIG. 54 shows a controllable poled lens 1530. Concentricdly arranged domains 1532, 1534, 1536, and 1538 are poled into an electro-optic substrate 1540 with a reverse polarity from thd of the substrate. Transparent electrodes 1542 and 1544 are applied to die two opposing surfaces of the device above and below die poled regions. When an electric field is applied between die two dectrodes, the poled regions have their index of refraction either increased or decreased according to the polarity. The geometry of the poled regions is determined by die diffractive requirements of focussing an opticd wave of a given color. The separations between the boundaries varies roughly quadratically with radius. If the application requires focussing a plane wave to a round spot, for example, the poled regions will be round (for equd focussing in both planes), and separated by decreasing amounts as the diameter of the poled region increases. The boundaries of die poled regions are determined by die phase of a die desired outgoing wave relative to the incoming wave at the surface of the lens structure. A poled region boundary occurs every time the relative phase of the waves changes by it. For example, if the incoming wave is a plane wave its phase is constant dong the surface. If the outgoing wave is a converging wave which will focus d a spot far from the surface, it is essentidly a spherical wave and die phase changes in thd spherical wave determine the boundaries. The lens 1530 is a phase plate with adjustable phase delay according to the applied voltage, and die domains occupy the Fresnel zones of the object. To focus a plane wave of a given color, a voltage is applied which is sufficient to phase retard (or advance) die plane wave by ir. Each different frequency has a different focd lengtii defined by the Fresnel zone structure of die poled lens 1530. Higher frequencies have longer focd lengths. If it were not for dispersion, every wavelength would optimdly focus at the same voltage. The voltage can be adjusted to compensate for the dispersion in the substrate materid 1540. If the voltage is adjusted away from the optimd vdue, the amount of light which is focussed to die spot is reduced because the phase of the light from the different zones no longer add optimdly. They will interfere partially destructively, reducing the net intensity. FIG. 55 shows a laser feedback device 1450. The laser source consists of an amplifier region 1452, a rear reflector 1454, and a low reflection output region 1456 which may be an antireflection coated window, for exanφle. While a conventiond laser will have a second high reflector, in this invention, the high reflector is removed so that a grating feedback device can control the laser oscillation. The reflection from the output region 1456 and die coupler. 1458 is low enough so did the laser does not lase without additiond feedback from an externd source. The externd feedback source consists of an opticd coupling system 1458 and a poled materid 1460 which reflects a beam from die opticd amplifier when excited by an electric field. Because the reflection spectrum of the poled materid 1460 may be very narrow in frequency space, it may select a narrow region in which laser operation can occur about the single frequency or frequencies which make up the grating according to the distribution of grating periods. If the resonator cavity is long enough so that the FSR is on the same order as the width of die reflection spectrum, the combined device will oscillate on a single longitudinal mode. The means 1458 for coupling opticd energy between the opticd amplifier and die materid 1460 collects and refocuses die output mode of die laser into the poled materid. The coupler 1458 may consist of many dternate redizations, including one or more of the following components: high numericd aperture lenses, such as GRIN (graded index), aspheric, diffractive, or multi-element sphericd lenses; tapered waveguides; proximity adjusters and digners in die case of butt coupling from waveguide to waveguide. The surfaces of die coupler 1460 are preferably antireflection coated. The AR coating may be a multilayer dielectric coating, or a sol-gel coating, or a quarter wave layer of a materid with the appropriate index of refraction (geometric mean of the two adjacent media). If the materid is bulk poled, the optimd focus within the materid 1460 has a Rayleigh range approximately equd to the length of the poled region. If the materid has a waveguide for confinement of die propagating beam, the opticd coupling system should optimdly transform die laser mode into a mode profile at the entrance of the waveguide which matches the desired mode of die waveguide in terms of phase front angle, radii of curvature, and transverse dimensions. The poled structure consists of at least two types of domains 1461 and 1463 which are preferably oppositely poled. The poled material has electrodes 1462 and 1464 which extend across the poled region and which can be excited electricdly by the power supply 1466. When a voltage is applied to the dectrodes, die induced field in the materid produces changes in the index of refraction which vary spatidly according to die poling direction and die electric field strength. By inducing periodic structures in the poling, electricdly controllable periodic modulations in the index of refraction can be induced. The amplifier 1452 is provided with the necessary mounting and excitation to produce an opticd gain coefficient over an extended region characterized by a central opticd axis. The opticd bandwidtii of the amplifier is limited according to die process which gives rise to gain. The bandwidtii is the width (typicdly die 3dB full width) of die gain profile: die dependence of the gain as a function of opticd frequency. The semiconductor diode technology (such as InGaAs, AlGaAs, AlGalnP, InGaAsP, ZnSe, GaN, InSb) is advantageous for providing a large bandwidth, dthough without the capability of supplying high power. The opticd reflector 1454 is a feedback mirror which can be a bulk mirror aligned and matched in radius to the phase front of the mode to reflect the mode propagating out the rear surface of the amplifier back into itself. Or in the case of a waveguide amplifier (Nd:YAG, Er:YAG, Nd:LiNbOj, EπLiNbOj, and various combinations of rare earth ions and crystdline or glassy hosts), it can be a feed of the amplifier which is cleaved or polished normal to the waveguide. If the resonator geometry is a ring, permitting unidirectiond propagation of light, the opticd reflector is a multi element structure composed of d least two dements to collect the light reflected from the materid 1460 which does not pass through the amplifier, and to align and refocus this light back through the amplifier to the materid 1460 again witii similar mode characteristics as it had on previous passes. Several beam interactions with the periodic poled materid 1460 are possible. If the periodicity is chosen to be a multiple of the period required to retroreflect light within the gain profile of the amplifier 1452, the device will function as a (higher order) field controlled feedback mirror. The laser can be turned on when the voltage 1466 is switched on, thereby creating retroreflection within the bandwidth of the grating. The laser output can then be amplitude modulated by modulating thd voltage since the laser oscillation varies in proportion to the strength of the electric field. The modulation control means 1466 provides the voltage and current required to establish the desired electric fields in die materid 1460 as a function of time. The laser can dso be modelocked by operating the modulation control means 1466 d a frequency equd to a multiple of the round trip frequency for the light between the materid 1460 and the laser reflector 1454. Since the reflectivity of the poled structure 1450 is modulated d the same frequency, the light beam resonating between the two feedback mirrors 1450 and 1454 tends to break up into one pulse (or more) which of course bounces around witii the round trip frequency. If the frequency is a multiple (lx, 2x, 3x, ... ) of the round trip frequency, the reflectivity will be high each time the pulse approaches the reflector 1450. At the higher multiples, the reflectivity remains high for a shorter time so a shorter pulse is produced, but some means may be needed to suppress the additiond pulses which tend to be formed at the other high reflection times within the round trip opticd transit time. The additiond pulses can be suppressed by dso applying a component of the signal at the round trip frequency to the reflector 1450, by dso modulating the amplifier 1452, or by otiier means including conventional additiond components. An opticd output may be extracted into die beam 1468 or 1469. The laser is frequency stabilized by using the feedback device 1450 because periodic reflectors operate only d specific frequencies. Incident frequencies outside die bandwidtii of the poled structure are not reflected. In a simple structure, the bandwidth is determined by die inverse of the number of first order grating periods which fit in the length of the poled region containing tiiat frequency component. In a more complicated structure with multiple periods, the bandwidtii is determined by the Fourier transform of the poled structures dong the bisector angle of the incident and die reflected beam propagation directions. Because feedback is only present over a limited frequency range, the output frequency of the device 1450 can be much narrower than that of a free running laser oscillator in which the poled structure has been replaced by a simple mirror. If die bandwidtii of the reflection is comparable to the separation of the longitudind modes of the extended cavity formed by die reflector 1454 and the poled structure, die device will operate in a single frequency mode. The stabilization characteristic is particularly useful in the case of the semiconductor diode laser, where die gain is very high and broadband. Witii diode lasers, dl undesired internd reflections such as the reflection from the output region 1456 should preferably be kept very low (such as below 10 1 ). The electrodes 1462 and 1464 may be on the same side of die substrate or on opposite ades, according to the field penetration and drive voltage preferred for die application. The resonator including the laser and the switched reflector may dso be a ring resonator instead of the linear resonator shown in FIG. 55. Additiond opticd dements are required to form die ring resonator as is known in the prior art, and the reflection from the poled materid 1460 is not at normal incidence. The periodicity and angle of the grating must dways be adjusted so that the virtual photon added to the interaction produces momentum conservation between the input and the output photon. This constraint determines both the angle and the period of die poled grating. FIG. 56 shows a laser feedback device 1470 witii a waveguide. A waveguide 1472 may be incorporated into die poled materid 1460 to confine the light beam for a long distance. This is particularly useful in devices which require the interaction length to generate a significant reflection, and in integrated devices where all light is routed in waveguides. Waveguide lasers 1474 such as semiconductor diode lasers or diode pumped solid state lasers may be butt-coupled to the waveguide, as shown in FIG. 56, for rugged and efficient operation. In butt coupling, the opticd coupling system 1458 is the AR coating on the surfaces 1475 and 1477 dong with the dignment and mounting structures necessary to aint in alignment. The waveguides of the opticd amplifier 1474 and die poled substrate 1460 are aligned so thd the opticd field phase front which emerges from die opticd amplifier towards die substrate has to an optimd extent the same angles, radii, and transverse dimensions as the phase front of the mode which propagates in the waveguide 1472. The separation of the two waveguides should be within a Rayldgh range, and their deviation from coaxial dignment should be less than a fraction of the transverse mode size. Either one of the waveguides 1472 or the guide in the amplifier 1476 may be tapered to optimize this overlap. In waveguide devices, it is not necessary for die poled regions 1478 and 1480 to extend entirely through the substrate 1460. Electrodes 1482, 1484, and 1486 are disposed over die poled region traversed by die waveguide 1472. When electrode 1484 is excited relative to electrodes 1482 and 1486, an index of refraction pattem is created in the waveguide with structure determined essentidly by the structure of the poled substrate. This index pattem may act as a reflector as described in reference to FIG. 55, and/or it may act as a coupler to other waveguides as described above. An opticd output may be extracted from the device d either the through port 1488 or the opposite end of die amplifier 1489. A frequency doubler may be incorporated into die substrate 1460 if the substrate materid is a nonlinear opticd materid such as lithium niobate, lithium tantalate, or KTP. The quasi phase matched doubler may be incorporated as a part of the feedback grating structure, prior to it, or after it. If die grating structure incorporates multiple reflection frequencies, the opticd amplifiers 1452 or 1474 may be induced to oscillate d two or more frequencies within their gain bandwidths. In this case, the nonlinear frequency converter may be a sum frequency mixer instead of a doubler, or several such devices may be cascaded to form multiple frequency combinations of the multiple frequency outputs. The variations described above relative to the poled structure, its excitation, and its mode of use can dso be applied in combination with the externd opticd amplifier. In particular, frequency tunable lasers can be realized by combining die structures of FIGS. 55 and 56 with the tunable gratings of FIGS. 14 and 15, respectively. As before, tuning is achieved by arranging the poled grating structure so thd the average index of refraction changes with applied field. The frequency of operation of the opticd amplifier 1452 or 1474 is determined by die frequency of die feedback from die poled structure 1460, The output frequency may therefore be chirped and/or modulated by chirping and/or modulating die average index of the poled structure. Changing the average index changes the momentum vector of the light photons without changing the momentum vector of the virtud photon contributed by the grating. After the change in average index, the old reflection frequency is no longer optimdly phase matched for reflection; the peak reflectivity has moved to a new frequency. A frequency modulated (FM) laser may be constructed using the configurations described in reference to FIGS. 55 and 56 with the addition of changing the average index of refraction as described in reference to FIGS. 14 and 15. By modulation, we mean changed as a function of some parameter which is time in this case, as in pulsed witii a high or low duty cycle, sinusoiddly varied, or varied with any arbitrary temporal dependence. A control system may be supplied to control die voltages and supply the currents needed to apply the desired temporal variations in electric fidd. Typically, the reflectivity of a grating required for optimd feedback for a semiconductor laser is less than 10%. The remaining light can be used for output. The laser can be forced to operate in dther the TM or TE polarization, depending on the confinement of the opticd beam in the waveguide on the grating chip, the disper on in the grating, and the relative gain of the two polarizations in the gain dement. Since the strength of the grating is controllable, the reflectivity can be adjusted to optimize the output coupling of the laser to maximize the output power. Similarly, the grating can be used to form reflectors of a passive or buildup cavity. Since the coupling of a laser beam to a cavity depends on die relative reflectivity of the input coupler compared to the cavity losses, a variable reflectivity input coupler provides a means to optimize this parameter, and thus impedance match the resonator. In a cavity, this invention can dso be used for single pulse switching, mode-locking, or cavity dumping, with little or no chirping for lower power CW sources, such as semiconductor lasers. In addition, the tuning potentid enables die laser to be used as a source for communications, spectroscopy, and remote sensing. FIG. 57 shows a selectable wavelengdi laser 1490 controlled by an array of switches. The laser is preferably a diode laser 1474 with waveguide 1476 butt coupled to a waveguide 1472 in a substrate 1461. The surfaces 1475 and 1477 are preferably AR coated so that the opticd amplifier 1474 will not se from the reflectivity of its own facets. The substrate may be any substrate capable of supporting the switches 1492, which may be implemented in a variety of ways including the TTR switches of FIGS. 30-32 and 34-35, the grating switch structures of FIGS. 7-8 and 12-13, the couplers of FIGS. 10 and 26-28, the splitters of FIGS. 23, 25, 33, and 46-48, or any of die other opticd waveguide switch structures now known or yet to be discovered. The TTR switches 1492 have been sufficiently described above thd we indicate their presence only schematicdly in this diagram. In their on position, these switches reroute the opticd energy from the amplifier down the one of the waveguides 1494 thd is associated with the switch. A retroreflector array 1496 is disposed in the waveguides, here shown as a grating. The grating reflects the incident light d a specific frequency, and die laser ses within the bandwidtii of the grating. The grating elements are shown directed towards a somewhat distant point 1498 so thd the periods of die gratings farther from the laser are progressively shorter. The reflection spectra of the gratings is therefore essentially identicd but shifted to shorter and shorter wavelengths. By selecting the switch 1492 associated with the desired grating period, die desired frequency of operation of the User can be sdected. The opticd frequency is determined by die geometry, and linearly spaced opticd wavdengths may be obtained witii a constant switch separation. If desired, any wavelengdi spacing within the packing density capability of the arrangement may be chosen. A large number of switches may be disposed dong the waveguide 1472 because of die low insertion loss of the ΗR switches and their high packing density. The tilted output waveguides dso pack together very compactly. An output beam may be extracted from die rear surface of the opticd amplifier 1474 as beam 1489, or it may be extracted from die waveguide 1472 as beam 1488 since the TTR switches will leak a fraction of the User light dong the waveguide 1472. Many dternative configurations such as are described in reference to FIG. 56 are dso relevant to this configuration. For instance, the reflector array 1496 may consist of permanent gratings fabricated by a large number of techniques, or switched gratings. It may consist of a uniform grating structure in which the different opticd path lengths to the grating select a different FSR for die User cavity, producing single mode operation d a selectable array of very narrowly spaced spectral peaks. It may even consist of an array of permanent mirrors dong the waveguides 1494 which might be coated for high reflection or variable wavelength reflection. Again, the differing separation of the mirrors provides the opportunity to adjust the laser cavity path length switchably over a Urge range. A subset of the structure of FIG. 57 is a modulator using an adjustable opticd energy redirector 1492, and one of die feedback reflectors 1496 in one of the waveguides 1494. If the waveguide 1472 is configured not to reflect, as by for exanφle tapering its width to zero following the redirector 1492, die User again is forced to lase witii the feedback afforded by die reflector 1496. By adjusting the amount of opticd energy which is fed back through the excitation of the redirector 1492, die User output characteristics can be controlled. The User power may be modulated in this way, in which case the reflector 1496 may be a fixed grating or even a broadband fixed mirror. With the grating reflector, there is the advantage of a fixed frequency so tiiat the laser power can be modulated deeply without frequency shifts, producing almost pure amplitude modulation. If the redirector 1492 is modulated at an integer multiple of the cavity round trip time, the device is a mode locker and produces a pulsed output. The round trip time is the time taken by a coaxidly digned pulse to return to its origind position and direction within the cavity. By using different switches die cavity length can be varied to vary die pulse separation. By using two different switches simultaneously, it is dso possible to discriminate against die intermediate pulses which tend to grow witii mode locking frequencies d a high order multiple of the round trip time. Frequency modulation can be obtained by modulating the central frequency of the reflector. In this case, the reflector 1496 should preferably be implemented as a tunable grating such as is described in FIGS. 14- 22. FIG. 58 shows a wavelength tuned adjustable focussing system 1550. The combination of a diffractive focussing dement 1552 such as the zone plate lens of FIG. 54 (or a fixed diffractive lens such as an opaque or an etched zone plate) with a tunable light source 1554 offers important new capability in the fidd of date storage. When a zone plate is combined with an adjustable frequency light source, the distance to the focus is adjusted by tuning the light source. This capability is useful for multilayer data storage devices where die data is read from and written to data planes 1556 stacked at various distances into the data storage medium 1558. If the wavelength of the light source is tuned (as we have described above by various means), the distance from the zone plate to the focus is adjusted correspondingly. This change of focus by wavelength change allows both instantaneous tracking of the opticd data storage surface of a distorted disk by andog wavelength change, and selection of the desired data surface with random access to die various stacked planes 1556 by discrete changes in die light wavelengdi. The frequency tunable User of choice for driving the multiplane data storage system is a User system based on a semiconductor diode User 1560 with tuning based on feedback from an dectronicdly tunable grating 1562 such as we have described above. The User may dso be frequency doubled in a quasi phasematched section 1564, in which case use of an angle broadened poled grating is the preferred method of rendering the acceptance of the doubler broad enough to accept significant tuning of the source User. Lens system 1566 coUimates and makes round the laser output in preparation for die find focus in the zone plate lens 1552. The lens system 1566 is not necessary since a zone plate can dso refocus a diverging beam. However, it is desirable to achieve a round beam through the zone plate because this will produce the smallest spot size and therefore the highest density data reading/writing capability. The devices 1562, 1564, and 1566 may be implemented in waveguides on die same substrate if desired, and in combination with one of the out-of-plane reflectors described above, can be integrated witii zone plate lenses on the rear surface of the substrate to achieve a small and lightweight unit capable of rapid actuation in a data storage system. The invention has now been explained witii reference to specific embodiments. Otiier embodiments will be apparent to those of ordinary skill in the art. Therefore, it is not intended thd the invention be limited, except as indicated by the appended claims, which form a part of this invention description.

Claims: WHAT IS CLAIMED IS: 1. A User comprising: a solid materid for passing opticd energy; d least a first electrically-conductive materid forming a first electrode, sdd first dectrode confronting sdd solid materid and bridging at least two elements of an electricdly-controlUble grating structure in sdd solid materid; an opticd amplifier disposed dong an opticd axis, sdd opticd axis traversing sdd solid materid, sdd d least two elements being disposed transverse of sdd opticd axis; and an opticd coupling means disposed between sdd solid materid and sdd opticd amplifier dong sdd opticd axis. 2. The device according to cl m 1 further including: an opticd reflector disposed dong sdd opticd axis, sdd optical amplifier being disposed between sdd opticd reflector and sdd solid dielectric materid. 3. The device according to cldm 1 further including: an opticd reflector disposed dong sdd opticd axis, sdd opticd amplifier being disposed between sdd opticd reflector and sdd solid dielectric materid; waveguide means dong sdd opticd axis in sdd solid dielectric materid, wherein add opticd amplifier is a semiconductor diode; wherein sdd opticd coupling has butt coupling and antireflective means disposed between sdd semiconductor diode and sdd waveguide; and wherein sdd at least two elements form a feedback mirror capable of producing laser oscillation. 4. The device according to cldm 1 further including: an opticd reflector disposed dong said optical axis, sdd opticd amplifier being disposed between sdd opticd reflector and sdd solid dielectric materid; a modulation controller for modulating said electric field creating means; sdd opticd coupling being antireflective to inhibit laser oscillation in absence of sdd electric field; and wherein sdd grating is a field-controlled feedback mirror for producing laser oscillation in proportion to the strength of sdd electric field. 5. The device according to cldm 4 for amplitude modulation of an opticd signd, wherein sdd grating comprises dtemates of sdd first type of sdd elements witii a second type of sdd dements, sdd second type being a poled strocture having a reverse sense to said first type of sdd elements and wherein average opticd distance across sdd first type of elements is substantidly equd to average opticd distance across sdd second type of elements dong said opticd axis. 6. The device according to cldm 4 for frequency modulation of an opticd signd, wherein add grating comprises dternating sdd first type of sdd elements witii a second type of said elements, sdd second type being a poled structure having a reverse sense to sdd first type of sdd dements and wherein average opticd distance across sdd first type of elements differs from average opticd distance across sdd second type of elements dong sdd opticd axis. 7. The device according to cldm 1 for mode locking opticd energy, further including: an opticd reflector disposed dong sdd opticd axis, sdd opticd amplifier being disposed between sdd opticd reflector and sdd solid dielectric materid; and a mode locker operated at a frequency that is a multiple of a frequency which is the reciprocd of the round-trip opticd transit time between said grating and sdd opticd reflector. 8. The device according to cldm 1 wherein sdd at least two elements are formed from a plurality of types of domains having a plurality of electro-optic coefficients, and further including: an opticd reflector disposed dong sdd opticd axis, sdd opticd amplifier being disposed between sdd opticd reflector and sdd solid dielectric materid; wherein sdd optical coupling means is antireflective to inhibit laser oscillation in absence of opticd feedback from sdd d least two elements; and wherein die sum over all domain types of die product, for each domain type, of sdd electro-optic coefficient times the average distance across the domain type dong sdd opticd axis, differs from zero. 9. The device according to cldm 1, for nonlinear conversion of opticd energy, further including: an opticd reflector disposed dong sdd opticd axis, sdd opticd amplifier being disposed between add opticd reflector and sdd solid dielectric materid; wherein sdd solid dielectric materid further includes a pattem of differing domains transverse to sdd opticd axis, d least a first type of sdd domains being an opticdly nonlinear structure and forming a plurality of components dternating with a second type of sdd domains, sdd pattem being phase matched to interact between three opticd waves of at least two different frequencies, wherein a linear combination of the vdues of the frequencies of sdd three opticd waves is substantidly zero to generate at least one opticd output beam. 10. The device according to cldm 9, wherein sdd elements and sdd components together form a combined structure with both reflecting and nonlinear opticd properties. 11. The device according to cldm 9 wherein sdd opticdly nonlinear structure is a frequency doubler. 12. The device according to cldm 9 wherein sdd optically nonlinear structure is a frequency mixer. 13. The device according to cldm 9 wherein said opticdly nonlinear structure is an opticd parametric oscillator frequency doubler. 14. The device according to cldm 1, wherein sdd grating comprises dtemates of sdd first types of sdd elements and second types of sdd elements which are spaced at at least two different periods. 15. The device according to cldm 1 further including: an opticd reflector disposed dong said opticd axis, sdd opticd amplifier being disposed between sdd opticd reflector and sdd solid dielectric materid; and d least one electro-opticdly active region in sdd solid materid transverse of sdd opticd axis and having an electrode adjacent sdd active region for inducing an electric field. 16. The device according to cldm 15 wherein sdd active region defines an opticd focussing device. 17. The device according to claim 15 wherein sdd active region has a reflective interface d a skew with sdd opticd axis and forms a reflecting grating for diverting opticd energy. 18. The device according to cldm 15 wherein sdd active region is a variable dispersion, electrically-controllable waveguide segment dong sdd opticd path. 19. A User comprising: a solid materid for passing opticd energy; an input waveguide in sdd solid materid; a base reflector disposed dong an opticd axis; a plurality of output waveguides encountering sdd input waveguide at intersection regions dong sdd input waveguide; a plurality of electricdly-switchable beam redirectors disposed dong sdd input waveguide at sdd intersection regions, each one of sdd electricdly-switchable beam redirectors comprising a first dectricdly-conductive materid forming a first electrode, sdd first electrode confronting sdd solid materid and bridging at least one electrically-active element in sdd solid materid; a plurality of gratings disposed dong sdd output waveguides defining electricdly- selectable retroreflectors further defining cavities between said base reflectors and sdd gratings; an opticd amplifier disposed dong an opticd axis, sdd opticd axis traversing sdd solid material; and an opticd coupling means disposed between sdd solid materid and sdd opticd amplifier dong sdd opticd axis. 20. The laser according to claim 19 wherein said electricdly-switchable beam redirectors are total internal reflectors. 21. The User according to cldm 19 wherein sdd electricdly-switchable beam redirectors are switchable mirrors. 22. The User according to cldm 19 wherein sdd gratings have differing periods in order to support selectable-frequency operation.

Inventors: BISCHEL WILLIAM K, BRINKMAN MICHAEL J, DEACON DAVID A G, FIELD SIMON J, BISCHEL, WILLIAM, K., BRINKMAN, MICHAEL, J., DEACON, DAVID, A., G., FIELD, SIMON, J.
Applicants: DEACON RESEARCH
Application year: 1995
Main classification: H01S3
IPC codes: G02F1, H01S3, H01S5