Magnetic fluid (MF) is a kind of special functional material, which is formed by magnetic particles wrapped with surfactant evenly and distributed in carrier fluid . It has the properties of magnetic materials and fluid. MF has versatile optical properties, such as magnetic refractive index (RI) tunability  , birefringence , and circular dichroism . As a new kind of artificial material, photonic crystal (PC) has been widely investigated in recent decades . By integrating waveguide and micro-cavity into a PC slab through introducing defects, various functions can be realized, such as slow light , filters , optical switches , logic gates , mode converters , and chiral light . Many researchers are devoted to design various PC slab sensors  - .
Zhao et al. proposed a magnetic field and temperature sensor by using two different types of MF-infiltrated PC cavities . In their work, the temperature affects the RI of MFs, and the RI of Si slab is constant. Liu et al. designed a single-mode double-cavity PC sensor for simultaneous detection of ambient RI and temperature, in which the temperature affects the RI of Si slab .
PC micro-cavity has a high Q factor and a strong local field effect. As MF has a large absorptive coefficient, for the MF-filled PC, the strong light in the micro-cavity will heat the filled MF, which will cause the temperature of micro-cavity to be higher than that of the surrounding environment . Yao et al. experimentally studied the temperature effect of light on Fabry-Perot (FP) cavity filled with MF . To solve the temperature cross sensitivity problem of the sensors and monitor the temperature stability of MF in real time, it is necessary to measure the temperature of MF cavity. In this work, a PC slab sensor was designed by infiltrating two different kinds of MFs into a two-mode cavity and a one-mode cavity, respectively. The magnetic field, ambient temperature and temperature in the high-Q MF cavities can be measured simultaneously. It can solve the magnetic field and temperature cross-sensitivity problem, and for the first time, distinguish the different temperatures of environment and MF cavities.
2. Device Configuration and Sensing Principle
2.1. Device Configuration
Figure 1 is the schematic structure of the proposed sensor, which is a PC silicon slab with a defect waveguide and two cascaded cavities. The holes in the slab form a square lattice. The period of the lattice, the radius of the holes and the thickness of the slab are denoted by a, r, and h, respectively. The defect waveguide is formed by removing a row of holes (W1 waveguide, namely, width of waveguide is 2a). Two additional holes at each end of W1 waveguide are also
Figure 1. Schematic of sensor structure configuration.
removed to enhance the coupling efficiency between PC waveguide and stripe waveguide. One cavity is formed by filling eight holes neighboring the waveguide with one kind of MF (i.e. MF1). The filled four holes form a symmetrical triangular shape. Another cavity is formed by filling eighteen holes neighboring the waveguide with another kind of MF (i.e. MF2). The filled nine holes form a 3 × 3 square symmetrically. Two dielectric stripe waveguides are connected to the incident and outgoing ends of the PC waveguide with width of 2a and thickness of h. The lattice period was selected as 450 nm so that the device can work at about 1550 nm wavelength. This type of PC device can be fabricated using electron beam lithography and electron-cyclotron-resonance ion-stream plasma etching using SOI substrates. The underlying SiO2 layer can be removed by selective wet etching using hydrofluoric acid to create an air-bridge PC membrane  .
2.2. Sensing Principle
As shown in Figure 1, light is launched from the left dielectric stripe waveguide into the PC waveguide, and the outgoing light is monitored in the right dielectric stripe waveguide. When the frequency of incident light coincides with the resonance frequency of either of the cavities, light in the PC waveguide will be coupled into the cavity. Dips will appear in the transmission spectrum at the resonant frequencies. According to perturbation theory, when there is a tiny perturbation of cavity’s geometry or RI, the dip wavelength will shift. MF has the property of magnetically tunable RI  . It is supposed that the magnetic field direction is in the plane of the PC slab and along the PC waveguide. The magnetic particles can be considered as magnetic dipoles. When external magnetic field is applied, the direction of magnetic dipoles will tend to be the same as external magnetic field direction. The magnetic particles will be lined up end to end, then form magnetic chains along the magnetic field direction  . When magnetic field increases beyond a critical value, the RI of MF increases. When the temperature of MF increases, the thermal motion of magnetic particles becomes violent, which impedes the formation of magnetic chains. Then, the RI of MF decreases with temperature. When the ambient temperature increases, the RI of silicon slab increases (see Table 2 later).
The effect of RI of single MF cavity on the resonant wavelength is shown in Figure 2. λ1 is the resonant wavelength of MF cavity 1. λ2 and λ3 are the resonant wavelengths of MF cavity 2. In Figure 2(a), only the RI of MF cavity 1 is changed. When the RI of MF cavity 1 increases, the spectral line of MF cavity 1 shifts to long wavelength, while the two spectral lines of cavity 2 keep unchanged. In Figure 2(b), only the RI of MF cavity 2 is changed. When the RI of MF cavity 2 increases, the two spectral lines of MF cavity 2 shift to long wavelength, while the spectral line of cavity 1 keeps unchanged. It can be seen that the spectral lines of the two cavities are far away enough that they work independently without affecting each other.
Figure 3 shows the distribution of electric field at three resonant wavelengths. The light in the waveguide is coupled into the MF micro-cavity, which forms a strong electric field distribution within and around the cavity. It is obvious that the strong electric field is mostly located within the MF holes. The field nodes occur at silicon material between the MF holes, where light field is weak. Therefore, it is reasonable to consider that the light heats the MF in the holes. As a preliminary exploration, we have assumed that the two MF cavities have the same temperature .
Figure 2. Effect of the refractive index of magnetic fluid cavity on the spectral lines. (a) The refractive index of MF1 is 1.3385 and 1.3428, respectively, and the refractive index of MF2 is fixed at 1.4671; (b) the refractive index of MF1 is fixed 1.3428, the refractive index of MF2 is 1.4635 and 1.4671, respectively (RI data see Table 2 later).
Figure 3. Electric field distribution at resonant wavelength λ1 (a), λ2 (b), and λ3 (c), respectively.
The RI variations of the two MF cavities and Si slab can be described as  .
where , , and are the RI variations of the two MF cavities and Si slab, respectively. , , and are the change of magnetic field, Si slab temperature and MF temperature, respectively. and are the magneto-optical coefficients of the two kinds of MF, respectively. , , and are the thermo-optical coefficients of the two kinds of MF and Si slab, respectively. When the ambient temperature changes, the RI of silicon slab and air holes changes (see Table 2 later). Considering the very small thermo-optical coefficient of air, the influence of ambient temperature on the RI of air is ignored and only the influence of ambient temperature on the RI of silicon slab is considered. Then, the shift of resonant wavelength can be described as  
where is the wavelength shift of cavity 1 (filled with MF1). and are the wavelength shifts of the two modes of cavity 2 (filled with MF2), respectively. , , , , , and are wavelength sensitivities of three dips responding to RI variations.
3. Modeling Methodology and Material Data
3.1. Modeling Methodology
Some reported works use the constant effective RI of silicon slab for two-dimensional (2D) calculation  . In fact, the effective RI of silicon slab varies with wavelength. The variational finite-difference time-domain (varFDTD) method can be used to calculate the effective RI of silicon slab with wavelength . It is faster than 3D-FDTD method. The varFDTD method is based on collapsing a 3D geometry into a 2D set of effective RIs that can be solved with 2D-FDTD. The lattice constant a = 450 nm, the radius of normal air holes is r = 0.38a. The thickness of the PC slab is h = 0.7a. The simulation area is truncated with a perfectly matched layer to prevent leakage of light reflection. The PC waveguide port is connected with rectangular silicon dielectric waveguide. Simulation was implemented using MODE SOLUTIONS of Lumerical .
3.2. Material Data
The RI of the silicon slab is 3.47809 at temperature of 295 K and wavelength of 1550 nm . The thermo-optical coefficient of silicon is almost constant at around 300 K, i.e. 1.8 × 10−4/K . The RIs of two types of MFs at different magnetic fields and temperatures can be found in . The material data used in the simulations are shown in Table 1 and Table 2. The effects of error of RI from  were tested, and it was found the shifts of dips were so little that software can’t distinguish them, so error of RI was ignored in simulations.
4. Influence of Hole’s Radius and Slab Thickness
4.1. Influence of Silicon Slab Hole’s Radius
Equation (2) indicates that the sensitivity of the sensor depends on the thermo-optical coefficients of MF and silicon slab, magneto-optical coefficient of MF, sensitivity of spectral line to the RI change. The sensitivity of spectral lines to RI change depends on the structure of the cavity, the coupling between waveguide and cavity, and the structure of the silicon slab. In this work, the radius of holes and thickness of silicon slab are changed to investigate their influence on the three spectral lines. When the radius of holes   or the thickness
Table 1. Refractive index of two types of MFs at different magnetic fields at 296.3 K .
Table 2. Refractive index of two types of MFs and Si at different temperatures   .
 -  of Si slab changes, the effective refractive index of Si slab will change, then the guided mode and cavity modes will change accordingly. Qualitatively, the coupling strength between cavity modes and guided mode, and then the deepness of dips and Q factors will change accordingly. The depth of spectral line and Q factor are taken as the evaluation index. First, the radius of the hole increases from 0.36a to 0.39a with a step 0.005a. The corresponding changes of the three spectral lines are shown in Figure 4. Figure 4(a) shows that the spectral line blue-shifts with the radius increase, which can be explained by the variational principle . When radius increases, the effective RI of silicon slab decreases and then the resonant frequency increases. Moreover, three spectral lines are gradually deepening, especially at λ1 and λ3, which is much clear as shown in Figure 4(b). Finally, the Q value is calculated by using Lorentz fitting of the spectral lines, which is shown in Figure 4(c). , where is full width at half-maximum (FWHM) and λ is resonant wavelength. At λ1, Q value is relatively small and gets maximum value at 0.37a. Q value is almost constant at λ2. Q value decreases as the radius increases at λ3.
Figure 4. (a) Influence of hole’s radius on the transmission lines; (b) Transmittance of three dips at different radiuses; (c) Q factor of three dips at different radiuses.
4.2. Influence of Silicon Slab Thickness
The thickness of PC slab is critical to its properties, such as band gap  - , guided mode   and Q factor  . For optimizing the silicon slab thickness, the hole radius r is kept at 0.38a, and the slab thickness increases from 0.4a to a. The change of three spectral lines is shown in Figure 5(a). Figure 5(a) displays that the spectral line redshifts with the slab thickness, which can be explained by the variational principle . As the slab thickness increases, the effective RI of silicon slab increases and then the resonant frequency decreases. Furthermore, the three spectral lines gradually deepen. The explicit result is shown in Figure 5(b). Finally, the Q value is calculated by using Lorentz fitting and the results are shown in Figure 5(c). Q value decreases as slab thickness increases at λ1. At λ2, the Q value reaches the maximum when the thickness is 0.5a. At λ3, the Q value reaches the maximum when the thickness is 0.6a.
5. Results and Discussion
Considering that the depth of resonant dips in real experiments becomes very shallow due to various reasons such as fabrication errors and attenuation, we prefer to make the dips deeper in our design. When the radius is 0.38a and the
Figure 5. (a) Influence of PC slab’s thickness on the transmission lines; (b) Transmittance of three dips at different thicknesses; (c) Q factor of three dips at different thicknesses.
thickness is 0.7a, the transmittance is less than 10%. On the other hand, the higher the Q value is, the higher the resolution of the resonant dips is. As can be seen from Figure 4(c) and Figure 5(c), when the radius is larger than 0.38a and the thickness is larger than 0.7a, the Q value basically decreases (except λ2 in Figure 4(c)), so radius of 0.38a and thickness of 0.7a were chosen in the following simulations. To investigate the effect of magnetic field on the three spectral lines, the temperature is assumed to be 296.3 K (room temperature). The RIs of two types of MFs at different magnetic field intensities are listed in Table 1. Figure 6 shows the shift of three resonant wavelengths with magnetic field, ambient temperature and MF cavity’s temperature. The corresponding explicit results are plotted in Figure 7. Figure 6 indicates that the influence of magnetic
Figure 6. Shifts of three resonant wavelengths. (a) Magnetic field increases from 50 to 200 Oe, MF cavities’ temperature and ambient temperature are fixed at 296.3 K; (b) ambient temperature increases from 280 to 324 K, MF cavities’ temperature is fixed at 296.3 K, without magnetic field applied; (c) MF cavities’ temperature increases from 280 to 324 K, ambient temperature is fixed at 296.3 K, without magnetic field applied.
Figure 7. Resonant wavelengths as functions of (a) magnetic field (MF cavities’ temperature and ambient temperature are fixed at 296.3 K); (b) ambient temperature (MF cavities’ temperature is fixed at 296.3 K, without magnetic field applied); and (c) MF cavities’ temperature (ambient temperature is fixed at 296.3, without magnetic field applied).
field and temperature on Q values is very small, so the Q factors’ evolution is not shown here. Figure 6(a) and Figure 7(a) displays that the spectral lines shift to long wavelength with the increase of magnetic field, and the relationship between the wavelength shift and magnetic field is almost linear. It can be explained by the variational principle . As the magnetic field increases, the RI of MF increases and then the resonant frequency decreases, namely, the resonant wavelength increases. The achieved magnetic field sensitivities are 2.89 pm/Oe, 4.57 pm/Oe, and 5.14 pm/Oe, respectively.
Then, the influence of ambient temperature on three spectral lines is studied. When the ambient temperature increases, the RI of silicon slab increases. At 295 K, the RI of silicon is 3.47809 at 1550 nm. The thermal expansion coefficient of silicon is very small, and the influence of temperature on the size of silicon slab is ignored. The RI of silicon slab at different temperatures is listed in Table 2. Because the thermo-optical coefficient of air is smaller compared to that of silicon, the influence of temperature on the RI of air is ignored in the simulation. Figure 6(b) and Figure 7(b) displays the shift of spectral lines with ambient temperature. With the increase of ambient temperature, the spectral line shifts to long wavelength, and the relationship between the wavelength shift and ambient temperature is almost linear. The obtained ambient temperature sensitivity is 65.51 pm/K, 50.94 pm/K and 58.98 pm /K, respectively.
Finally, the influence of MF temperature on three spectral lines is investigated. The simulation results are shown in Figure 6(c) and Figure 7(c). When the temperature of MF increases, the RI of MF decreases (see Table 2). As the temperature of MF increases, the spectral line blue-shifts. The three transmission valleys shift linearly with the MF temperature, and the corresponding sensitivity is −14.41 pm/K, −17.06 pm/K, and −18.81 pm/K, respectively.
Based on the above results, the sensitivity matrix is obtained as
Then, the strength of magnetic field, ambient temperature and MF cavity temperature can be written as
In real experiments, it is difficult to let one parameter change and other parameters fixed, which is a drawback of some sensor designs requiring additional design of thermostatic system. But in theoretical simulation, the effect of each parameter can be studied using variable control method, then effect of several parameters can be derived from superposition of contribution from each parameter. Several parameters change simultaneously in real world, but the effect of single parameter can be known by theoretical study, then each parameter can be measured according to the reversibility of sensitivity matrix. In this way, by measuring the shift of three spectral lines, the cross-sensitivity problem can be solved and the magnetic field, ambient temperature and temperature of the MF cavity can be measured simultaneously. Here the RI-H data and RI-T data of the two kinds of MFs are the values at fixed temperature and magnetic field strength, respectively. In practice, it is necessary to measure massive data and establish refractive index database of RI-H and RI-T with changing temperature and magnetic field. However, it was confirmed that the change of ambient temperature and MF temperature can be inferred from the inverse matrix based on the data of changing both ambient temperature and MF temperature. In this work, we focus on realization of measuring three parameters by infiltrating MFs, and especially distinguishing MF cavity temperature and ambient temperature, sensitivities are not necessarily superior to other works   . In order to further improve the sensitivity of the sensor, MFs with larger RI responsivity to magnetic field can be employed. On the other hand, the Q value of the micro-cavity can be further optimized and the area of the micro-cavity filled with MF can be increased as much as possible.
A cascaded PC cavity magnetic field sensor is proposed, which can measure the magnetic field, ambient temperature and MF cavity temperature simultaneously. The influence of the radius of hole and slab thickness on the depth and Q value of the resonant spectral line are studied. The moderate radius 0.38a and thickness 0.7a are employed for investigating the sensing properties. The advantages of the designed magnetic field sensor lie in small size (compared with fiber-based sensors) and unnecessary temperature compensation structure. Also, the structure is simple and has no complex multi-round hole radius design, which can become a “programmable” device with great freedom of post-design.
 Hong, C.Y., Yang, S.Y., Horng, H.E. and Yang, H.C. (2003) Control Parameters for the Tunable Refractive Index of Magnetic Fluid Films. Journal of Applied Physics, 94, 3849-3852.
 Chen, Y.F., Yang, S.Y., Tse, W.S., Horng, H.E., Hong, C.Y. and Yang, H.C. (2003) Thermal Effect on the Field-Dependent Refractive Index of the Magnetic Fluid Film. Applied Physics Letters, 82, 3481-3483.
 Wang, W.H., Zhang, H.M., Li, B., Li, Z. and Miao, Y.P. (2019) Optical Fiber Magnetic Field Sensor Based on Birefringence in Liquid Core Optical Waveguide. Optical Fiber Technology, 50, 114-117.
 Zhuang, Y., Chen, H. and Ji, K. (2017) Cascaded Chirped Narrow Bandpass Filter with Flat-Top Based on Two-Dimensional Photonic Crystals. Applied Optics, 56, 4185-4190.
 Yu, Y., Heuck, M., Hu, H., Xue, W.Q., Peucheret, C., Chen, Y.H., Oxenløwe, L.K., Yvind, K. and Mørk, J. (2014) Fano Resonance Control in a Photonic Crystal Structure and Its Application to Ultrafast Switching. Applied Physics Letters, 105, Article ID: 061117.
 Husko, C., Vo, T.D., Corcoran, B., Li, J., Krauss, T.F. and Eggleton, B.J. (2011) Ultracompact All-Optical XOR Logic Gate in a Slow-Light Silicon Photonic Crystal Waveguide. Optics Express, 19, 20681-20690.
 Ye, H., Wang, D.L., Yu, Z.Y., Zhang, J.Q.N. and Chen, Z.H. (2015) Ultra-Compact Broadband Mode Converter and Optical Diode Based on Linear Rod-Type Photonic Crystal Waveguide. Optics Express, 23, 9673-9680.
 Sollner, I., Mahmoodian, S., Hansen, S.L., Midolo, L., Javadi, A., Kiršanskė, G., Pregnolato, T., El-Ella, H., Lee, E.H., Song, J.D., Stobbe, S. and Lodahl, P. (2015) Deterministic Photon-Emitter Coupling in Chiral Photonic Circuits. Nature Nanotechnology, 10, 775-778.
 Lai, W.C., Chakravarty, S., Zou, Y. and Chen, R.T. (2012) Silicon Nano-Membrane Based Photonic Crystal Microcavities for High Sensitivity Bio-Sensing. Optics Letters, 37, 1208-1210.
 Sünner, T., Stichel, T., Kwon, S.H., Schlereth, T.W., Höfling, S., Kamp, M. and Forchel, A. (2008) Photonic Crystal Cavity Based Gas Sensor. Applied Physics Letters, 92, Article ID: 261112.
 Baker, J.E., Sriram, R. and Miller, B.L. (2017) Recognition-Mediated Particle Detection under Microfluidic Flow with Waveguide-Coupled 2D Photonic Crystals: Towards Integrated Photonic Virus Detectors. Lab on a Chip, 17, 1570-1577.
 Cardador, D., Segura, D. and Rodriguez, A. (2018) Photonic Molecules for Improving the Optical Response of Macroporous Silicon Photonic Crystals for Gas Sensing Purposes. Optics Express, 26, 4621-4630.
 Caer, C., Serna-Otálvaro, S.F., Zhang, W.W., Roux, X.L. and Cassan, E. (2014) Liquid Sensor Based on High-Q Slot Photonic Crystal Cavity in Silicon-on-Insulator Configuration. Optics Letters, 39, 5792-5794.
 Zhu, E.Y., Rewcastle, C., Gad, R., Qian, L. and Levi, O. (2019) Refractive-Index-Based Ultrasound Sensing with Photonic Crystal Slabs. Optics Letters, 44, 2609-2612.
 Zhao, Y., Zhang, Y.N. and Lv, R.Q. (2015) Simultaneous Measurement of Magnetic Field and Temperature Based on Magnetic Fluid-Infiltrated Photonic Crystal Cavity. IEEE Transactions on Instrumentation and Measurement, 64, 1055-1062.
 Liu, Z.Q., Sun, F.J., Wang, C. and Tian, H.P. (2019) Side-Coupled Nanoscale Photonic Crystal Structure with High-Q and High-Stability for Simultaneous Refractive Index and Temperature Sensing. Journal of Modern Optics, 66, 1339-1346.
 Yao, T.J., Pu, S.L., Rao, J. and Zhang, J.M. (2018) Investigation of Optical Force on Magnetic Nanoparticles with Magnetic-Fluid-Filled Fabry-Perot Interferometer. Scientific Reports, 9, Article No. 12352.
 Notomi, M., Yamada, K., Shinya, A., Takahashi, J., Takahashi, C. and Yokohama, I. (2001) Extremely Large Group-Velocity Dispersion of Line-Defect Waveguides in Photonic Crystal Slabs. Physical Review Letters, 87, Article ID: 253902.
 Su, D.L., Pu, S.L., Mao, L.M., Wang, Z.F. and Qian, K. (2016) A Photonic Crystal Magnetic Field Sensor Using Ashoulder-Coupled Resonant Cavity Infiltrated with Magnetic Fluid. Sensors, 16, 2157.
 Komma, J., Schwarz, C., Hofmann, G., Heinert, D. and Nawrodt, R. (2012) Thermo-Optic Coefficient of Silicon at 1550 nm and Cryogenic Temperatures. Applied Physics Letters, 101, Article ID: 041905.
 Benmerkhi, A., Bouchemat, M. and Bouchemat, T. (2016) Improved Sensitivity of the Photonic Crystal Slab Biosensors by Using Elliptical Air Holes. Optik, 127, 5682-5687.
 Deghdak, R., Bouchemat, M., Bouchemat, T., Lahoubi, M. and Otmani, H. (2016) Optimized Complete Photonic Band Gap in Magneto-Photonic Crystal Slab. Journal of Nanoscience and Nanotechnology, 6, 39-42.
 Johnson, S.G., Fan, S.H., Villeneuve, P.R., Joannopoulos, J.D. and Kolodziejski, L.A. (1999) Guided Modes in Photonic Crystal Slabs. Physical Review B, 60, 5751-5758.
 Hong, C.Y., Drikis, I., Yang, S.Y., Horng, H.E. and Yang, H.C. (2003) Slab-Thickness Dependent Band Gap Size of Two-Dimensional Photonic Crystals with Triangular-Arrayed Dielectric or Magnetic Rods. Journal of Applied Physics, 94, 2188-2191.
 Bayat, K., Chaudhuri, S.K. and Safavi-Naeini, S. (2007) Polarization and Thickness Dependent Guiding in the Photonic Crystal Slab Waveguide. Optics Express, 15, 8391-8400.
 Hou, J., Citrin, D.S., Wu, H.M., Gao, D.S., Zhou, Z.P. and Chen, S.P. (2012) Slab-Thickness Dependence of Photonic Bandgap in Photonic-Crystal Slabs. IEEE Journal of Selected Topics in Quantum Electronics, 18, 1636-1642.
 Tandaechanurat, A., Iwamoto, S., Nomura, M., Kumagai, N. and Arakawa, Y. (2008) Increase of Q-Factor in Photonic Crystal H1-Defect Nanocavities after Closing of Photonic Bandgap with Optimal Slab Thickness. Optics Express, 16, 448-455.
 Saker, K., Bouchemat, T., Lahoubi, M., Bouchemat, M. and Pu, S.L. (2019) Magnetic Field Sensor Based on a Magnetic-Fluid-Infiltrated Photonic Crystal L4 Nanocavity and Broadband W1 Waveguide. Journal of Computational Electronics, 18, 619-627.