Inverse design and realization of an optical cavity-based displacement transducer with arbitrary responses

Optical cavity has long been critical for a variety of applications ranging from precise measurement to spectral analysis. A number of theories and methods have been successful in describing the optical response of a stratified optical cavity, while the inverse problem, especially the inverse design of a displacement sensitive cavity, remains a significant challenge due to the cost of computation and comprehensive performance requirements. This paper reports a novel inverse design methodology combining the characteristic matrix method, mixed-discrete variables optimization algorithm, and Monte Carlo method-based tolerance analysis. The material characteristics are indexed to enable the mixed-discrete variables optimization, which yields considerable speed and efficiency improvements. This method allows arbitrary response adjustment with technical feasibility and gives a glimpse into the analytical characterization of the optical response. Two entirely different light-displacement responses, including an asymmetric sawtooth-like response and a highly symmetric response, are dug out and experimentally achieved, which fully confirms the validity of the method. The compact Fabry-Perot cavities have a good balance between performance and feasibility, making them promising candidates for displacement transducers. More importantly, the proposed inverse design paves the way for a universal design of optical cavities, or even nanophotonic devices.


Introduction
Optical cavity-based transducers, such as Fabry-Perot (F-P) cavities 1−4 , interferometric cavities 5−7 , and grating encoders 8−10 , have found great success in displacement measurement and other displacement-based measure-ments of, for example, force 11 , acceleration 12,13 and speed 14 , in terms of the ultrahigh stabilization and precision of wavelengths as traceable distance metrics 15 .Among various types of optical cavities, the F-P cavity incorporates key features of tunable finesse, the promise of miniaturization, compactness and high sensitivity; thus, it has been widely used for versatility 16−18 .The output light intensity of an F-P cavity changes in optical path length induced by either a change of cavity length or the refractive index.Regarding a displacement transducer, high optical contrast and flat response are preferred, bearing sensitivity and linearity, respectively.The optical response is usually manipulated by adjusting the cavity mirrors, which can be dielectric or metal layers.There have been a series of theories and models 19−22 that successfully predict the optical response of an ideal F-P cavity.However, the inverse problem, e.g., the design of an optical cavity with an arbitrary response, was extremely difficult 23 in the past because of the unaffordable cost of computation.Hence, displacement-sensitive cavity design has historically relied on intuitionbased approaches 3,24,25 , which cannot tune multiple parameters and optimize interdependent characteristics simultaneously.
Inverse design, attributed to the steady progress of algorithmic techniques and the ability to compute, has opened new avenues for designing nanophotonic structures with desired functional characteristics 26−29 .Numerical methods (e.g., Finite-Different Time-Domain method 30 , abbreviated FDTD, and Rigorous Coupled-Wave Analysis method 31 , abbreviated RCWA) are established to connect the variable parameters of the system to the characteristics of a solution, and intelligent algorithms such as evolutionary algorithms 32 , swarm intelligence algorithms 33 , and machine learning methods 27,34 are introduced to dig out the desired characteristics from the parameter space.Notable contributions have been made in areas such as plasmonic nanostructures 35,36 and metamaterials 37,38 .However, there still exist a lot of areas where only promising preliminary work has been done.Cavity design is one of the challenges, and problems including how to realize high sensitivity, linearity, and technical feasibility simultaneously remain open.A systematic design and realization of a cavity-based displacement transducer considering multiple objects has been elusive.In addition, common numerical methods are more like a fuzzy operation that cannot help understand physics and cost substantially more compared with simple formula calculation.
To design and realize an optical cavity-based displacement transducer, we combine the characteristic matrix method and algorithm-enabled inverse design to estab-lish a path toward an arbitrary response.The output response extracted from the characteristic matrix method is demonstrated to be concise and trustable by benchmarking other numerical methods.A modified mixeddiscrete genetic algorithm is used to optimize the variable parameters of the optical cavity by constructing a self-built fitness function.The algorithm is fit for discrete variables such as the material index number (each material's complex refractive index is numbered, termed MI) to greatly improve the speed.The fitness function contains the evaluation factors of optical contrast, intensity, linearity, symmetry, and is moderately adjusted.Single-layer and multi-layers systems are both considered, and the optimal results in turn pass through tolerance analysis to maintain high process feasibility.Herein we report two specific cavity designs to illustrate the effectiveness of our method, where the cavities have a designated sawtooth-like light-displacement response and a highly symmetric response, respectively.Such designs are verified by experiments, which demonstrate that they have high contrast and good consistency.This makes the compact cavities promising candidates for displacement transducers aiming at high sensitivity and other performances.Furthermore, the semi-analytical inverse design-based flow, including theoretical model setup, mixed-discrete variables evolutionary algorithm and Monte Carlo method-based tolerance analysis, allows a specific design of displacement sensitive optical cavities and further opens avenues for universal design of stratified devices.

Theoretical model
As shown in Fig. 1(a), the investigated cavity is an F-P cavity consisting of two parallel mirrors.The reflection type is chosen because as a transducer, the cavity is usually attached to a measurand through mirror 2, or 'moving' mirror, while mirror 1 is a 'fixed' mirror.The moving mirror is first simplified as a single-layer film due to technical feasibility.In addition, the fixed mirror should have a substrate because the optical films are ultrathin; thus, the stratified system has two forms, as illustrated in Figs.1(b) and 1(c), where a SiO 2 wafer serves as the substrate for the fixed mirror because it is a stable and accessible material.Hence, we have two types of simplified cavity settings: one is that the SiO 2 layer is the lower layer of the fixed mirror, termed the low-case and shown in Fig. 1(b), and the other one is that the SiO 2 layer is the upper layer, termed as up-case and shown in Fig. 1(c).However, the analyses are identical because the SiO 2 layer is regarded as a layer in the stratified system.
We assume that the incident light is a linearly polarized plane wave (it can be easily converted to a wave with a Gaussian profile 39 ), and all media are linear homogeneous and isotropic.The reflectance of the cavity is our concern.The cavity consists of n layers along with the semi-infinite ambient (0th) and the measurand ((n + 1)th) media, as shown in Fig. 1(a).For convenience, the moving mirror and the air gap are labeled the nth and (n -1)th layers, respectively.Each layer has a complex refractive index, nr i = n i -ik i , and thickness d i .The displacement transducer is situated in the air; hence nr 0 and nr (n-1) are approximated to 1.In each layer, an incident plane wave generates a reflected plane wave in the same layer and a resultant transmitted plane wave in the next layer.The total field inside the ith layer can be divided into two plane waves, a forward-and a backward-traveling plane, denoted by + and -, respectively.We term the direction perpendicular to the layer boundaries as the zaxis; we have the complex amplitudes of the plane waves at an arbitrary position z: Using the scattering matrix method 20,40 , it is easy to obtain the complex amplitude relation between two parallel positions z' and z'': where S is the scattering matrix representing the reflection and transmission properties of the stratified structure.The scattering matrix is expressed as a product of the interface and layer matrices, denoted by I and L respectively, and taken in order: I and L can be further calculated by the Fresnel reflection and transmission coefficients r ij and t ij of the interface: in which β i is the phase shift in the ith layer, given by: where d is the length in the layer, λ is the wavelength of the light, and φ denotes the angle between the propagation direction and the z-axis.Considering the light in the measurand media, E (n+1)-= 0, it yields the relationship between incident light and the light in the measurand as: Hence, the overall reflectance can be obtained as: Equation (7) gives the path to calculate the output light-displacement response of the cavity by simple matrix multiplication combining Eqs. ( 3), ( 4) and (7), whereas the displacement information is contained in the phase shift.Interestingly, the transmission coefficients can be divided out, which means that the response only depends on the Fresnel reflection coefficient of the interfaces and the phase shift of the layers.
The aforementioned theory is valid under linear homogeneous and isotropic media conditions, while the anisotropic case is discussed in detail in the Supplementary information.The difference is that the complex amplitude is replaced by tahe electromagnetic-field vectors, and the element of the scattering matrix becomes a 4 × 4 matrix.This theoretical model is appreciably simple for numerical computation and is a more feasible underpinning for cavity inverse design compared with other complicated numerical methods.

Verification and analysis
The correctness and reliability of the theoretical model are hereafter confirmed by benchmarking with widely used methods, including RCWA and FDTD.As examples, we consider a simple case of a single-layer or two-layer film suspended in air (without the SiO 2 substrate) with 850 nm laser illumination normal to the sur-face, and the measurand is covered by a thick silver (Ag) film (1 μm).The suspended film is selected as Ag only, chromium (Cr) only, and a stack of Ag/Cr.The thickness of the Ag or Cr layer is 10 nm, and the gap (or cavity length) is set to 4 μm.The complex refractive index of Ag and Cr can be found in the Supplementary information, where we referred to the work of Arkadiusz 41 and Johnson 42 .
Figure 2 represents the reflectance as a function of cavity length for three cases, wherein the red lines, blue dashed lines, and black circles represent the theoretical results, the RCWA results, and the FDTD results, respectively.The theoretical results are in excellent agreement with those numerical results in all three cases, which definitively confirms the validity of our model.Notably, the theoretical results perfectly fit the RCWA results, while the deviation between the theoretical and FDTD results is slightly larger than the former.This is because RCWA is similar to another semi-theoretical method, although it requires more computing resources in terms of its mode expansion operation; while for FDTD, it is a completely numerical method, whose accuracy is relevant to the mesh accuracy, PML setting, and other factors such as the Gibbs phenomenon.However, the good consistency has demonstrated that the theoretical model is a reasonably reliable underpinning to calculate the light-displacement response.
Unlike other numerical methods, this model allows further analytical investigation of the physical picture, e. g. to discuss the symmetry or periodicity of the response because it can give an analytical expression for a specific cavity setting.For example, the expansion of Eq. ( 7) reveals that either dielectric material (k = 0) or metal (k ≠ 0) can lead to asymmetry, and the period maintains λ/2 no matter how the variable parameters change.This provides a glimpse into the light-displacement characterization, while the inverse design is evidently required because the mathematical relation between dozens of parameters is still too complicated, and the cavity setting is ever-changing.

Inverse design process
Inverse design flow Figure 3 outlines the inverse design flow of the cavity.This starts from the initial setting, wherein the cavity is simplified as a stratified system, and the moving mirror is further simplified to a single-layer film.The aforementioned theoretical model is used to establish the relation between the variable parameters and the response, or fit-ness function, and the modified genetic algorithm is employed to obtain the primary candidates.These candidates pass through the Monte Carlo-based tolerance analysis, filtering out the best candidate with technical feasibility.
More specifically, the independent variable is the cavity length, or d (n -1) , while the initial value is inessential due to the perfect periodicity obtained by the theoretical model.The dependent variable parameters include the wavelength of the incident laser λ, the layer number of the fixed mirror, the thickness of each layer d i , and the real and imaginary parts of the refractive index of each  J o u r n a l P r e -p r o o f layer.We input a set of dependent parameters to the theoretical model during the genetic algorithm-based optimization, sweeping the cavity length to obtain the lightdisplacement response and thus the fitness function to form the cycle.However, the real and imaginary parts of the refractive index of a material have a certain relation to reality.Independent and continuous optimization not only increases the computational cost but is also a pointless exercise.The layer number or even the thickness of a layer can also be a discontinuous variable.Hence, we index the material number (the number is termed MI) and discretize the thickness of layers to improve the optimization efficiency.
The self-built fitness function contains the evaluation factors of absolute intensity, contrast, linearity, and symmetry, which are labeled as f 1 , f 2 , f 3 , and f 4 , respectively.These evaluation factors can be obtained from the lightdisplacement response curve, as illustrated in Fig. 4, whose period equals λ/2.The ideal responses are a sawtooth-like wave and a perfectly symmetric wave, shown in the inset, which respectively have the largest linear range in one period (also has a very sharp sensitive region) and the best symmetry.Factor f 1 equals the maximum intensity in one period, termed I max , multiplied by a weight factor w 1 .The contrast factor f 2 is defined by w 2 × (I max -I min )/(I max + I min ), where w 2 is another weight factor, and I min is the minimum intensity.Note that these two have to be considered simultaneously; otherwise, f 2 would converge to 1 while I min is approximate to 0 regardless of what I max is.Factor f 3 is a combination of the coefficient of determination (R-squared) and a sum of squares due to error (SSE) of both components of the one-period curve, corresponding to L 1 and L 2 in Fig. 4.
In addition, f 3 is normalized to the peak-to-peak amplitude of the response and then multiplied by a weight factor.Factor f 4 is calculated by the deviation between the larger of L 1 and L 2 , and the period.These four factors can be readily adjusted by the weight factors in terms of the design goal.The detailed function and values are included in the Supplementary information.The genetic algorithm-based optimization outputs several primary candidates, and the number can be adjusted as desired.
The tolerance analysis is performed for both singleparameter and multi-parameters, and the latter is a more conservative measure because all variable parameters cannot be the worst case at the same time in reality.
Herein, the Monte Carlo method generates dozens of random parameters in a designated range, and these parameters are then input to the theoretical model, obtaining corresponding responses.After sorting according to the performance, one optimal candidate with a reasonable tolerance range is finally output.The inverse design flow performs a comparable scope of application compared with the neural network-based method and can be more suitable for some specific problems due to the merits of the mixed-discrete variables scheme and Monte Carlo-based tolerance analysis.
The parameters mentioned above are all listed in Table 1, along with their values or ranges.J o u r n a l P r e -p r o o f Optimization and tolerance analysis of the cavity In the specific design, we first consider all materials to enlarge the parameter space.The materials were classified into simple substances, normal materials, and (relatively) whole materials according to whether they could be easily coated or not.The quantity numbers are 27, 55, and over 100, respectively, and the detailed list can be found in the Supplementary information.The wavelength of the laser can be a continuous variable; however, it makes more sense to assign several wavelengths directly based on accessible laser sources.In the following, we took 850 nm as the illustration.The thickness of the SiO 2 substrate layer was set to 400 μm, and the material was Borofloat 33 (BF33).The thickness range of a layer was 10 to 200 nm in terms of fabrication difficulty.The validation of the modified genetic algorithm parameters, including the population size and generations, was obtained by comparing the optimization results with the results obtained by all parameters sweep.The former absolutely resembles the latter, with a time reduction by orders of magnitude.

Sawtooth-like design
Regarding the sawtooth-like design, both low and upcase, shown in Fig. 2(b) and 2(c) were taken into account.For the low-case, the output 5 primary candidates of single-layer setting among the simple substance materials were Ge/16 nm/Ag, Te/18 nm/Ag, In/10 nm/Ag, Al/10 nm/Ag, and Sn/10 nm/Ag, wherein the first information denotes the material of the fixed mirror above 400 μm BF33 wafer, the second number denotes the thickness of the layer, and the third information denotes the material of the moving mirror.Figure 5(b) shows the candidates with the best fixed mirror material but different moving mirror materials.This demonstrates that the material of the thick moving mirror has little influence on the response, partly owing to the simplification of the large thickness of the moving mirror.Hereinafter, we excluded the settings with the only difference of moving mirror material.Two settings, Ge/16 nm/Ag and Te/18 nm/Ag, outperformed other counterparts in the primary candidates; thus, they were chosen to conduct the tolerance analysis.Regarding the single-parameter tolerance analysis, we used the Monte Carlo method to produce more than 50 fluctuating values within a range around the optimal value for each variable parameter.Variable parameters include n f (±10%), k f (±10%), t f (±10%), n r (±10%), k r (±10%), n BF33 (±1%), and t BF33 (±1%), which denote the real part and negative part of the complex refractive index of the fixed mirror material, thickness of the fixed mirror film, real part and negative part of the complex refractive index of the material of the moving mirror, real part of the complex refractive index of the BF33 substrate (the negative part is approximately 0), and thickness of the BF33 substrate, respectively.The investigated range of BF33 is set to 1% because the refractive index of a commercial SiO 2 wafer is relatively stable, and the thickness deviation (±4 μm) is sufficient relative to the large thickness.Figure 5(c) shows the single-parameter tolerance analysis results of these two settings, where the blue and red circles represent the calculated fitness value for each random variable parameter, the chain dotted J o u r n a l P r e -p r o o f lines represent the original fitness values obtained by optimization, and the blocks represent the variation range of the fitness values.It is explicitly shown that the variation of the refractive index of the moving mirror (Ag) rarely affects the fitness value, which confirms the conclusion obtained in Fig. 5(b).The variation of the fixed mirror and the BF33 substrate play a more important role in this case, especially the BF33 variables for the Ge/16 nm/Ag setting.However, except for the variable parameters of the BF33 substrate, the tolerance performance of Ge/16 nm/Ag is better than that of Te/18 nm/Ag; thus, there is very little to choose between these two.We then obtained the primary candidates for both two-layers and single-layer among the whole materials, which are MgO/47 nm/PbSe/13 nm/Ag, Te/12 nm/SiO 2 / 92 nm/Ag, and Bi 2 Se 3 /19 nm/Ag, MoTe 2 /16 nm/Ag.The aforementioned candidates are plotted in Fig. 5(d), along with their fitness values.There is no doubt that the settings based on two-layers and unusual materials perform slightly better, especially the linearity.This is confirmed by the multi-parameter tolerance analysis, whose results are depicted in Fig. 5(e).One more interesting thing is that the variation of the parameters can not only degrade the performance but can also improve the performance.A possible interpretation is that the discretization of parameters misses the optimal value in the  continuous parameter space, especially the refractive index of materials.In general, it is straightforward to achieve higher performance, or a smaller fitness value, in an ideal world using a two-layers setting and unusual materials.However, the penalty paid is the increased fabrication complexity and decreased feasibility.Usually, the refractive index of ultrathin films differs from that of bulk materials, and it is not easy to stack layers at will in reality.
Hence, the choice of two or even multiple layers should be careful according to the requirement and expenses.Similarly, by putting the 400 μm BF33 layer in front of the investigated films, we obtained the primary candidates for the up-case.Regarding the single-layer up-case among the simple substance materials, the candidates are Ge/17 nm/Ag, Te/22 nm/Ag, In/10 nm/Ag, Al/10 nm/Ag, and Zn/10 nm/Ag, whose responses and fitness values are shown in Fig. 5(f).Note that the simple substance of Ge and Te perform consistent excellence as the low-case, especially in the Ge setting.The single-parameter tolerance analysis results, shown in Fig. 5(g), confirm the resemblance of the impact of the variable parameters between the up-case and low-case, wherein the parameters of BF33 and the coated film have a larger impact.Among the simplest settings (single-layer and the simple substance material), it is evident that the up-case of Ge/17 nm/Ag is the best.It has the smallest fitness value and high error tolerance, as demonstrated by Fig. 5(g), a comparison diagram of the single-parameter tolerance analysis results of Ge and Te settings in low-and up-cases.Considering two-layers and the whole materials, we selected 6 primary candidates, which are PbSe/11 nm/As 2 S 3 /15 nm/Ag, MgO/36 nm/PbSe/11 nm/Ag, MoTe 2 /20 nm/Ag, PbSe/15 nm/Ag, Ge/17 nm/Ag, and Te/22 nm/Ag.The first layer is located beneath the BF33 layer.Figure 5(h) shows the responses of these settings, and the setting of Ge/17 nm/Ag serves as a datum.The response, fitness value, and the multi-parameter tolerance analysis result, shown in Fig. 5(i), imply that the two-layers settings using unusual materials have a slightly better performance.However, similar to the lowcase, the choice of multi-layers settings is limited to the expense of increased fabrication complexity and decreased feasibility.

Highly symmetric design
Regarding the highly symmetric design, the target response was switched to target 2 shown in Fig. 4, by adjusting the fitness function, where the target of symmetry factor f 4 was set to 0 as possible.Herein we only considered the single-layer setting among the simple substance materials in terms of the fabrication feasibility as previously discussed.Figure 6(a) presents the lightdisplacement responses of 5 primary candidates for the single-layer setting among the simple substance materials.It obviously shows that the up-case of Si/86 nm/Cr performs the best symmetry, and the optical contrast is still good.Figure 6(b) shows the single-parameter tolerance analysis results of this setting, where the black and navy circles represent the calculated contrast-related factor and symmetry factor for each random variable parameter.It is found that the symmetry maintains perfect regardless of how the variable parameters change.This is also confirmed by Fig. 6(c), which plots the responses of all multi-parameter tolerance analysis results.
In summary, the inverse design can realize almost perfect sawtooth-like and symmetric responses with a very complicated cavity setting, including many layers, freely varying thickness and material.In addition, this inverse design flow enables arbitrary light-displacement responses to be achieved by building a designated fitness  J o u r n a l P r e -p r o o f function.Nevertheless, the procurability of the material, the stability of the material properties, and the fabrication feasibility should be considered in practical design.This type of problem exists in multi-layers settings with whole materials.Excluding Te settings in terms of its toxicity and difficulty coating over a large area, we therefore chose the single-layer up-case of Ge/17 nm/Ag, and up-case of Si/86 nm/Cr, two readily achieved settings, to experimentally verify the effectiveness of the inverse design.

Experimental verification
The experimental configuration is shown in Fig. 7(a).The red ray represents the measurement light path, and the blue ray (He-Ne laser) represents the indication light path to indicate the invisible measurement light path.One output laser beam from a single longitudinal mode source (Model L850VG1 with a driver LDC200CV, Thorlabs Inc., wavelength, λ = 850 nm, bandwidth GHz, with temperature stabilization) was first collimated by a beam shaping system and then passed through an optoisolator (Model ISO850-3-1.5W,LBTEK Inc.).This beam struck the cavity normally, which comprised a designed fixed mirror (Mirror 1) and a commercial Ag reflector (Mirror 2) attached to a piezoelectric ceramic (PZT, Model PA25LEW, Thorlabs Inc.), as shown in the expanded view in Fig. 7(b).After being deflected by a splitter, the reflected beam was measured by a photodetector (Model GDT-D020V, Daheng Optics Inc.).The movable autocollimator was used to align the compon-ents of the optical cavity, wherein two mirrors were mounted strictly parallel by a 5-axis kinematic mount (Model K5X1, Thorlabs Inc.).The films, as shown in the inset of Fig. 7(c), were coated by magnetron sputtering in terms of the materials and the thickness we chose.Note that the out-of-flatness and irregularity of the cross-section view of the Ge film are mainly due to the extremely large magnification of SEM (> 200 K) and the consequent imaging quality degradation.The real roughness is smaller than one nanometer.
The incident light intensity was first obtained by replacing the cavity with an Ag reflector.The response is shown in Fig. 8(a), whose amplitude was calibrated by the reflectivity of the reflector.During the measurement, the movable mirror was driven by a PZT to obtain a linear variation in the displacement with a step of approximately 11 nm (corresponding to the applied voltage amplitude of 0.5 V).The light-displacement responses of two designs are depicted in Fig. 8(b), and one point represents one averaged value of the time-varying output for each displacement.
For the sawtooth-like design, its periodic response can be divided into two linear regions, whose R-squared values are 0.911 and 0.949, respectively, as shown in Fig.  J o u r n a l P r e -p r o o f setting, represented by the dashed blue line.The relative deviation in the experimental result with respect to the optimal theoretical result, such as the zero drift, could be due to the errors involved in the variable parameters.For example, the thickness of the BF33 substrate, shown in Fig. 7(c), was not perfectly 400 μm, but at a value of approximately 401 μm, and the thickness of the Ge film was approximately 20 nm.Substituting these values (BF33 401 μm, Ge 20 nm) into the theoretical model, the response with a zero drift was obtained, as shown by the dotted line in Fig. 8(d).Although the experimental res-ult is not perfectly consistent with either of the two theoretical results, it is likely a state in between.We calculated the evaluation parameters for quantitative evaluation, including peak-to-peak amplitude, contrast, and symmetry factor, and compared them with those of the theoretical result considering tolerance, as listed in Table 2.The deviations are all smaller than 13%.The possible interpretation of the deviation can be concluded as the deviation of parameters between the reality and designated value (primarily from fabrication and alignment), especially the complex refractive index of the thin film and variable parameters of the BF33 substrate that drastically affect the response.In addition, the commercial Ag reflector usually has a SiO 2 protection film with an unknown thickness; it inevitably changes the actual response as well.
For the symmetric design, we similarly obtained the normalized output of the experimental result, shown in Fig. 8(e), as a comparison to the optimal theoretical result and the theoretical result considering tolerance.The experimental result perfectly reproduced the peak-topeak amplitude and the contrast of the theoretical results.The evaluation parameters included in Table 2 indicate that the symmetry of the experimental result is excellent, which fully attests to the robustness of the symmetric design.
Two types of cavity-based transducers were proven to have high reliability by performing the repeatability test, as demonstrated by Fig. 8(f), wherein three separate tests gave almost the same light-displacement responses.The tiny difference could be mainly due to the nonlinearity and hysteresis of PZT.
The compact design, good optical contrast ratio, and tunable responses make the cavity a strong candidate for displacement measurement.More importantly, the agreement of the theoretical results with the experimental results for two entirely different designs confirms the validity of the inverse design, further proving applications with diverse requirements.

Conclusions
In this work, we demonstrate optical cavity-based displacement transducers with diverse performances that make use of a self-built inverse design methodology.The cavities achieve a designated sawtooth-like light-displacement response with high optical contrast and a sufficiently large linear range, and a highly symmetric response with high contrast.Moreover, the presented inverse design flow, which combines the characteristic matrix method, mixed-discrete variables optimization algorithm and Monte Carlo method-based tolerance ana-lysis, allows for arbitrary response tuning of a stratified system.Although the ideal performance cannot be perfectly achieved due to the limitation of manufacturing and alignment, this methodology has been experimentally proven to yield reasonable robustness in terms of tolerance analysis.The mined compact cavity designs from tremendous parametric space undoubtedly serve as promising candidates for displacement measurement, whilst we believe the methodology has become of more paramount importance.This allows a specific analysis and design of an optical cavity and allows for the universal design of high performance nanophotonic devices with improvements in fabrication technology.J o u r n a l P r e -p r o o f

Fig. 1 | 3 J
Fig. 1 | (a) Schematic diagram of the investigated F-P cavity-based displacement transducer located in air.(b) Low-case of the stratified system.(c) Up-case of the stratified system.

Fig. 2 |
Fig. 2 | Comparison of reflectance verse cavity length between the theoretical results and results obtained by RCWA and FDTD for cases of a suspended film of (a) Cr with a thickness of 10 nm, (b) Ag with a thickness of 10 nm and (c) a stack of Ag/Cr with the thickness of 10/10 nm, and the reflector is a 1 μm thick Ag.

Fig. 3 |
Fig. 3 | Inverse design flow of the F-P cavity that contains the mixed-discrete variables optimization and the Monte Carlo-based tolerance analysis, wherein the matrix method-based theoretical model serves as the connection between the variable parameters and the fitness function.

Fig. 4 |
Fig. 4 | Illustration of the light intensity response as a function of displacement, and the target responses, a sawtooth-like curve and a perfectly symmetric response, are shown in the inset.

Figure 5 (
a) depicts the light-displacement responses of these settings, along with their fitness values.The figure of merit of the response has a strong correlation with the fitness value.

Fig. 5 |
Fig. 5 | Optimization results of the sawtooth-like design.(a) Light-displacement responses of 5 primary candidates of the single-layer setting among the simple substance materials for the low-case.(b) Light-displacement responses of the candidates with Ge but different moving mirror materials for the single-layer low-case setting.(c) Single-parameter tolerance analysis results of single-layer low-case settings of Ge and Te, where the circles represent the calculated fitness value for each random variable parameter, the chain dotted lines represent the original fitness values, and the blocks represent the variation range of the fitness values.(d) Light-displacement responses of primary candidates of both twolayers and single-layer settings among the whole materials for the low-case.(e) Histogram of multi-parameter tolerance analysis results of all candidates for the low-case.(f) Light-displacement responses of 5 primary candidates of the single-layer setting among the simple substance materials for the up-case.(g) Comparison of single-parameter tolerance analysis results of Ge and Te for both low-and up-cases, where blue and red colors represent the Ge and Te results, and left and right slashes represent low-and up-cases, respectively.(h) Light-displacement responses of primary candidates of both two-layers and single-layer settings among the whole materials for the up-case.(i) Histogram of multiparameter tolerance analysis results of all candidates for the up-case.

Fig. 6 |
Fig. 6 | Optimization results of the symmetric design.(a) Light-displacement responses of 5 primary candidates among the simple substance materials for the single-layer setting.(b) Single-parameter tolerance analysis results of Si/86 nm/Cr up-case setting.(c) Responses of all multiparameter tolerance analysis results.

Fig. 7 |
Fig. 7 | (a) Experimental configuration of the cavity-based displacement measurement.(b) Magnified view of the length tunable F-P cavity.(c) Cross-sectional view of mirror 1, along with the SEM images of the Ge film and the Si film in the inset.

Fig. 8 |
Fig. 8 | Experimental data.(a) Output voltage of the incident light as a function of time.(b) Static outputs of the optical cavities versus displacement for two designs, each point denotes an average value at a specific displacement.(c) Linear fit of the experimental result of the sawtooth-like design.(d) Comparison of the experimental results of the sawtooth-like design and theoretical results of optimal setting and setting considering tolerance.(e) Comparison of the experimental results of the symmetric design and theoretical results of optimal setting and setting considering tolerance.(f) Results of the repeatability test for two designs.