Abstract
Controlling electromagnetic wave propagation in multiple scattering systems is a challenging endeavor due to the extraordinary sensitivity generated by strong multi-path contributions at any given location. Overcoming such complexity has emerged as a central research theme in recent years, motivated both by a wide range of applications – from wireless communications and imaging to optical micromanipulations – and by the fundamental principles underlying these efforts. Here, we show that an in-situ manipulation of the myriad scattering events, achieved through time- and energy-efficient adjoint optimization (AO) methodologies, enables real time wave-driven functionalities such as targeted channel emission, coherent perfect absorption, and camouflage. Our paradigm shift exploits the highly multi-path nature of these complex environments, where repeated wave-scattering dramatically amplifies small local AO-informed system variations. Our approach can be immediately applied to in-door wireless technologies and incorporated into diverse wave-based frameworks including imaging, power electronic and optical neural networks.
Similar content being viewed by others
Introduction
Controlling electromagnetic wave propagation in naturally occurring or engineered multi-mode complex media is a core challenge for RF/microwave, modern optical, and photonic systems1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17. The origin of this difficulty lies in multiple scattering and the consequent interference of many photon paths, leading to extraordinary complexity and sensitivity in these media. Yet, controlling these wave-scattering events and their associated interference phenomena is essential for a wide range of applications, including satellite and in-door wireless communications, fiber-based communications and endoscopy, deep-tissue imaging, and optogenetic control of neurons. At first glance, the complete scrambling of a wavefront as it propagates through a complex medium appears to conflict with the objective of precision wave-control—such as focusing electromagnetic radiation on a diffraction-limited spot inside or through a multi-scattering/opaque medium. Indeed, for many years, the presence of random secondary sources (scatterers or reflectors) was considered detrimental. However, novel techniques such as time-reversal18,19 and wavefront shaping (WS)1,2,19 disrupted this paradigm by recognizing that these secondary sources offer additional degrees of freedom. Wavefront shaping protocols have relied on recent technological developments with spatial light/microwave modulators19,20,21,22; these allow phase and/or amplitude modulation to each segment of an incident monochromatic wavefront in order to achieve desired functionalities after propagation through the complex medium. On the other hand, time-reversal provides a broadband approach that yields spatiotemporal focusing of waves.
Although both of these methodologies guarantee optimal efficiency, they require a complete knowledge of the scattering domain, limiting their practicality for a variety of applications. A pivotal example is indoor wireless communications4,23,24, where small temporal variations in the enclosure can drastically alter the scattering process. An entirely different approach relying on smart electromagnetic environments has emerged with the advent of reconfigurable intelligent metasurfaces (RISs)23,24,25,26,27,28,29. This approach foresees a fully programmable wave propagation to harness the wave-scattering complexity and achieve optimized transmission of both information and power. A bottleneck for the practical implementation of this proposal is the development of smart, low-cost/high-efficiency, optimization schemes that will be able to identify in real-time, with low latency, optimal RIS configurations for achieving specific modalities.
Meanwhile, there has been widespread attention towards physical (optical) analog computing for low-latency deep learning applications30,31,32,33,34,35,36,37,38. Pioneering works such as36,37 showed that it is possible to perform in-situ backpropagation through a photonic implementation of an artificial neural network. However, these platforms typically consist of feed-forward waveguides, couplers and interferometers, in contrast to complex multi-scattering multi-resonant electromagnetic environments, in which real-time optimizations of on-demand wave-control functionalities are needed. Obviously, the development of such real-time, on-hardware optimization schemes will benefit not only indoor wireless communications (see Fig. 1a) but also a broad class of physical systems. Representative wave settings include control of closed-loop tabletop experiments, seismic wave control, as well as applications in adaptive optics (atmospheric imaging, endoscopy, free-space optical links) and related remote-sensing tasks – including geo-satellite imaging and adaptive ranging (optical or RF), see Fig. 1b,c.
Examples of physical wave frameworks where the iPAC protocol can be sucessfully implemented: a A smart electromagnetic environment utilizing RIS for a variety of modalities. b Seismic wave management. c Adoptive optics for atmospheric imaging. d A multi-resonant, multi-scattering complex network of coaxial cables has been used as a platform to demonstrate the viability of the iPAC protocol. The protocol used as control parameters, the relative amplitudes and phases of injected waves (which were controlled by the VNA), and a targeted set of coaxial cables of the network whose electrical lengths were digitally controlled using phase-shifters. The iPAC scheme has been demonstrated for a variety of modalities: (i) Targeted Mode Transfer that aims to receive the injected electromagnetic signal at a specific receiving channel; (ii) Coherent Perfect Absorption that aims to absorb the injected electromagnetic signal completely; (iii) Invisibility (cavity camouflaging) that results in an outgoing signal being the same (phase and amplitude) as the injected one.
Here, we experimentally demonstrate an in-situ Physical Adjoint Computing (iPAC) optimization protocol that leverages adjoint sensitivity analysis39,40,41,42 to control and harness complex wave dynamics. The protocol is built around three components: in-situ measurements, targeted perturbations, and an external control mechanism, which collectively enables the real-time optimization of wave systems through two sequential field propagations – forward and adjoint. First, local probes are employed to measure both the forward and adjoint wave fields at specific elements within the system. Forward propagation is utilized to compute a desired merit (or cost) function and to determine the excitation profile required for the subsequent adjoint propagation. The adjoint field, in turn, provides a comprehensive and simultaneous measurement of all targeted sensitivities. An external control mechanism evaluates these sensitivities to identify the potential perturbations that could enhance (or diminish) the merit (cost) function. These adjustments are then delivered by local actuators to the targeted components (i.e., the tunable degrees). The cycle is repeated as many times as necessary to maximize (minimize) the merit (cost) function. The proposed methodology typically achieves the fastest local convergence among competing strategies, which constitutes it attractive for a variety of wave-control applications, see Fig. 1a–c. While the ultimate gain is context-dependent, iPAC is most effective in controlled, quasi-static or slowly varying, multiply scattering environments where forward and adjoint excitations can be launched. Provided adequate sensing-actuation bandwidth, signal-to-noise ratio, and tolerable local model mismatch, iPAC provides a scalable path to on-platform optimization. To demonstrate the versatility of our protocol we showcase three different modalities, namely, targeted channel emission, coherent perfect absorption, and camouflaging, using a microwave experimental platform, see Fig. 1d. The latter consists of a network of coupled coaxial microwave cables whose wave transport demonstrates features characterizing wave chaotic systems43,44,45. These networks are frequently used as models for mesoscopic quantum transport, sound propagation, and electromagnetic wave behavior in complex interconnected structures such as buildings, ships, and aircrafts46,47,48,49,50 and therefore constitute a versatile platform for experimentally implementing our in-situ optimization protocol.
Results
Principles of in-situ adjoint optimization
Formally, the steady-state propagation of a time-harmonic wave field Φ is governed by a linear system: M(p)Φ = b(p). Here, M is the system matrix, b is the driving source, and p is a vector of N-controllable optimization parameters. An optimization objective g is typically expressed as an explicit function of Φ, Φ*, and p, i.e., g = g(Φ,Φ*, p). Using the chain rule, the gradient sensitivities of g with respect to p are given by:
Here, \(\frac{\partial {{{\bf{b}}}}}{\partial {{{\bf{p}}}}}-\frac{\partial {{{\bf{M}}}}}{\partial {{{\bf{p}}}}}\,{{{\mathbf{\Phi }}}}\) physically represents a collection of induced excitations resulting from perturbing the system via one parameter pi at a time for each i = 1, 2, 3, ⋯ , N. Consequently, \({{{\bf{U}}}}={{{{\bf{M}}}}}^{-1}\left(\frac{\partial {{{\bf{b}}}}}{\partial {{{\bf{p}}}}}-\frac{\partial {{{\bf{M}}}}}{\partial {{{\bf{p}}}}}\,{{{\mathbf{\Phi }}}}\right)\) denotes a collection of several wave fields in response to each and every one of these perturbations (the ith column, Ui, corresponds to the wave field generated by perturbing the single pi). However, finding the entire U becomes excessive especially when the number of controllable parameters, N, is large.
The adjoint method addresses this challenge by reformulating the problem as:
Here, Ψ is the adjoint field generated in response to the source \(\frac{\partial g}{\partial {{{\mathbf{\Phi }}}}}\). For reciprocal wave media, where MT = M, the adjoint field can be found by propagating through the same system. The gradient sensitivities are now given by:
This formulation significantly reduces computational demands, as all sensitivities can be obtained through a single additional field propagation, instead of computing the entire collection U of N wave fields. Moreover, \(\frac{\partial {{{\bf{b}}}}}{\partial {{{\bf{p}}}}}\) and \(\frac{\partial {{{\bf{M}}}}}{\partial {{{\bf{p}}}}}\) are typically very sparse tensors since the effect of each parameter pi on M and b is localized. Consequently, only the values of Φ and Ψ corresponding to the non-zero entries of \(\frac{\partial {{{\bf{b}}}}}{\partial {{{\bf{p}}}}}\) and \(\frac{\partial {{{\bf{M}}}}}{\partial {{{\bf{p}}}}}\) are needed.
To implement the adjoint method experimentally, we sequentially excite the wave system with the driving sources b and \(\frac{\partial g}{\partial {{{\mathbf{\Phi }}}}}\), measure Φ and Ψ at the strategic positions designated by \(\frac{\partial {{{\bf{b}}}}}{\partial {{{\bf{p}}}}}\) and \(\frac{\partial {{{\bf{M}}}}}{\partial {{{\bf{p}}}}}\) and then compute \(\frac{dg}{d{{{\bf{p}}}}}\) digitally using Eq. (3). Importantly, our in-situ protocol bypasses the computationally intensive tasks of solving MΦ = b and \({{{\bf{M}}}}{{{\mathbf{\Psi }}}}=\frac{\partial g}{\partial {{{\mathbf{\Phi }}}}}\). Instead, we directly measure Φ and Ψ, inherently accounting for all the complexities of the system, including hidden losses and detunings, thereby enabling self-calibration. Having found \(\frac{dg}{d{{{\bf{p}}}}}\), any gradient-guided optimization algorithm can be applied to advance g51. We set up an external control enclosure to orchestrate the entire process, including the sequential (forward and adjoint) wave-field excitations, in-situ measurements, gradient computations, and optimization updates, ensuring seamless and efficient real-time optimization.
While adjoint analysis shares a conceptual common ground with the celebrated backpropagation algorithm, our goal is not to develop a physical deep-learning platform36. Instead, we aim to optimize a wave system in-situ to achieve specific physical functionalities in real time, such as perfect absorption, signal delivery to targeted channels, or camouflage. Unlike data-driven methods, our protocol does not train any neural network nor rely on extensive datasets. Crucially, our work should be distinguished from physical implementations of feed-forward neural networks36,37, which often avoid back reflections. In contrast, our in-situ optimization holistically exploits the intricate physics of multiple scattering of waves within an arbitrarily complex network topology, where any wave effect, including back reflections and even resonant phenomena, can be utilized as valuable physical degrees of freedom. Furthermore, our implementation at RF and microwave frequencies allows us to easily access both phase and amplitude information of the fields, which ensures that the intricate wave interactions within the system are accurately accounted for, enabling precise and reliable optimization.
Physical platform and implementation of the adjoint protocol
The complex microwave network14,44,52,53,54 consists of n = 1, ⋯ , V vertices, that are connected by one-dimensional coaxial wires (bonds) B = (n, m) of length LB, which are irrationally related to one another. The position xB = x on bond B is x = 0 (lB) on vertex n(m). The connectivity of the network is encoded in the V × V symmetric adjacency matrix C, with elements Cnm = 1 if vertices n ≠ m are connected via a bond lB, and Cnm = 0 otherwise. The number of bonds that emanate from a vertex n defines its valency vn. The electric potential difference (voltage) between the inner and outer conductor surfaces of the coax cables at position x along each bond satisfy the telegraph equation44,52,53,54
where k is the wavenumber of the propagating wave with angular frequency ω, c is the speed of light in vacuum and nr is the complex-valued relative index of refraction of the coaxial cable whose imaginary part describes Ohmic losses in the cables. To emulate realistic conditions, we have considered that all cables suffer Ohmic losses which are modeled by a complex refractive index with imaginary part \({{{\mathcal{I}}}}m({n}_{r})\simeq 0.0085\). Furthermore, it is convenient to define the vertex field \({{{\mathbf{\Phi }}}}={\left({\phi }_{1},{\phi }_{2},\ldots,{\phi }_{N}\right)}^{\top }\) where \({\psi }_{B}\left({x}_{B}=0\right)={\phi }_{n}\) is the voltage at vertex n.
The scattering set-up is completed by connecting α = 1, ⋯ , N ≤ V of the vertices to transmission lines (TL) that are used to inject and receive monochromatic waves of angular frequency ω = 2πf. The coupling to the TLs is described by the N × V matrix W with elements 1(0) when a vertex is connected (not connected) to a TL. At each vertex n, the continuity of the field and current conservation are satisfied. In the frequency domain, these conditions take the following compact form44,52
Above, b = 2iW⊤I is the N-dimensional vector that describes the driving source, and \({I}_{\alpha }={A}_{\alpha }{e}^{i{\theta }_{\alpha }}\) are the components of an L-dimensional vector I that describes the amplitudes Aα and the phases θα of the input fields Iα from the α-lead. Consequently, the system matrix for the microwave network is \({{{\bf{M}}}}=\left({{{\bf{H}}}}(k)+i{{{{\bf{W}}}}}^{\top }{{{\bf{W}}}}\right)={{{{\bf{M}}}}}^{\top }\).
The gradient sensitivities are evaluated using Eq. (3). The implementation of this equation requires the knowledge of the adjoint field Ψ which is the solution of the adjoint Eq. (2). In our case, it takes the same form as the equations that dictate the forward field with the only difference being the driving source vector, i.e., \({{{\bf{M}}}}{{{\mathbf{\Psi }}}}=2i{{{{\bf{W}}}}}^{\top }{\left(\frac{\partial g}{\partial {{{\mathbf{\Phi }}}}}\right)}^{\top }\). The latter is determined from the specific form of the optimization objective function g(Φ, Φ*, p).
The other elements required for the evaluation of Eq. (3) are the gradients \(\frac{\partial {{{\bf{M}}}}}{\partial {{{\bf{p}}}}}\) and \(\frac{\partial {{{\bf{b}}}}}{\partial {{{\bf{p}}}}}\). The optimization parameter vector p is partitioned into two parts: the first one involves cavity-shaping optimization parameters (e.g. selected set of bond lengths \(\{{L}_{nm}^{{{{\rm{opt}}}}}\}\) in the network), which are encoded in the system matrix M. Its gradient \(\frac{\partial {{{\bf{M}}}}}{\partial {L}_{nm}^{{{{\rm{opt}}}}}}\) is a sparse V × V operator with non-zero elements only at entries that incorporate the selected bonds \(\{{L}_{nm}^{{{{\rm{opt}}}}}\}\). We also consider additional optimization parameters, i.e., the amplitudes Aα and phases θα of the incident waves injected into the system from the α-th TL. These wavefront shaping parameters are encoded in b; resulting in \(\frac{\partial {b}_{n}}{\partial {A}_{\alpha }}=2i{e}^{i{\theta }_{\alpha }}{W}_{n,\alpha }\), and \(\frac{\partial {b}_{n}}{\partial {\theta }_{\alpha }}=-2{A}_{\alpha }{e}^{i{\theta }_{\alpha }}{W}_{n,\alpha }\).
Eventually, the objective function gradient becomes:
It is important to emphasize that Eq. (6) does not require measuring the entire Φ or Ψ but only those voltages that correspond to the non-zero entries of \(\frac{\partial {{{\bf{M}}}}}{\partial {L}_{nm}^{{{{\rm{opt}}}}}}\) and \(\frac{\partial {{{\bf{b}}}}}{\partial {A}_{\alpha }}\), \(\frac{\partial {{{\bf{b}}}}}{\partial {\theta }_{\alpha }}\) associated with the controllable parameters. In other words, the sparsity of ∂M/∂p and ∂b/∂p further reduces measurement complexities.
Examples of modalities and optimization objective functions
Below we provide some examples of optimization objective functions associated with various modalities.
Targeted Mode Transfer—In many practical scenarios, particularly in in-door wireless communications, one requires energy/information transfer from specific input channels to designated output channels—distinct from the injected ones. Such targeted mode transfer (TMT) can be achieved by an appropriate cavity-shaping and/or wavefront-shaping process whose success is quantified by the objective function
where {Tα}( ≠ {Iβ}) denotes the set of targeted (injected) channels. In case of lossless structures gTMT = 1(0) indicates perfect (poor) TMT performance.
Coherent Perfect Absorption—Coherent perfect absorption (CPA)14,55,56 requires that the incident radiation has a particular frequency and spatial field distribution (coherent illumination) such that the (weakly) absorbing cavity acts as a perfect constructive interference trap that eventually absorbs completely the incident radiation. The adjoint optimization methodology can be utilized for the management of the multi-path constructive interference via cavity shaping and/or wavefront shaping. In this case, the optimization objective function is
where the second term describes the reflected waves from the injected channels {Iα} and the third term describes the transmitted waves from the remaining {Tα} ≠ {Iβ} channels. Perfect absorption corresponds to gCPA = 1.
Invisibility – Evading the detectability of a scattering object requires the elimination of any imprints in the phase and amplitude of the scattered interrogating waves due to their interaction with a target. This is achieved by appropriate manipulation of the many-path interference phenomena occurring inside the scattering domain via cavity shaping and/or tailoring control signals that counter phase and amplitude scattering imprints (including absorption) caused by interactions with the target. The objective function that ensures such optimal cancellations take the form
where ginvis = 0 indicates optimal invisibility/camouflage performance. Above, the first term on the right-hand-side compares the scattered signal (phase and amplitude) from a probed α0-channel to an interrogating signal injected into the system from a β0-channel; the second term measures the reflectance from the β0-channel. Finally, the last term evaluates the transmittance to all channels that are different from the probe channel α0 and the control channel αc. The objective function Eq. (9) does not enforce any constraints to the reflected wave from the control channel αc.
In-situ Implementation of iPAC
We proceed with the in-situ implementation of our optimization scheme for the three modalities discussed above. The schematics of the microwave networks for each of the three cases are shown in the upper row of Fig. 2. The TLs (black wiggling lines) are attached to vertices that are indicated with red-filled circles. The amplitude and phase of the injected signals from a two-source VNA, have been used as optimization parameters (wavefront-shaping). In all cases, the signal from the α = 1 TL serves as a reference for the amplitude A and the phase θ of the signal injected from the second TL. Finally, the bond \({L}_{12}^{{{{\rm{opt}}}}}\) incorporates a phase-shifter which was digitally controlled for “cavity-shaping” purposes. The selected bond was chosen solely for experimental convenience; it is not special to any of the three modalities (TMT, CPA, invisibility). The only practical requirement is that the bond accommodate a phase shifter and that the fields at its end vertices be accessible for probing. Any bond meeting these conditions would serve equally well. In our prototypes, tuning a single cable length was sufficient to realize the targeted functionalities described in the previous subsection.
In-situ demonstration of the iPAC optimizer using a complex network of coaxial cables (red vertices indicate the positions where TLs are attached). The control parameters are the (electrical) length of the cable \({L}_{12}^{{{{\rm{opt}}}}}\) (using a phase shifter) and the relative phase and amplitude of the injected signals. a Network schematics for Targeted Mode Transmission (TMT) for a wave with frequency f = 1.86 GHz that is injected from TLs α = 1, 3 and is delivered at targeted TL α = 4. b Convergence of the TMT objective function gTMT (gTMT ≈ 87%) vs. iteration number. Evolution of: c The electrical length \({L}_{12}^{{{{\rm{opt}}}}}\); d The injected relative power; e The relative phase (with respect to a signal injected from TL α = 1) of the signal injected from TL α = 3. f Network schematics for Coherent Perfect Absorption (CPA) for a wave injected from TLs α = 1, 2 at frequency f = 3.26 GHz. g Convergence of the CPA objective function gCPA toward nearly perfect absorption (gCPA ≈ 0.9998). Evolution of: h The electrical length \({L}_{12}^{{{{\rm{opt}}}}}\); i The injected relative power; j The relative phase (with respect to a signal injected from TL α = 1) of the signal injected from TL α = 2 vs. iteration number. k Network schematics for signal invisibility (cavity-camouflage). The interrogating signal at frequency f = 0.74 GHz is injected into the network from TL β0 = 1 and is received from TL α0 = 3 with the same amplitude and phase (0.01 dB power variation and 0.1o phase variation with respect to the injected wave). A control signal (phase and amplitude) injected from lead αc = 2 is balancing the losses and together with the length \({L}_{12}^{{{{\rm{opt}}}}}\) ensures the invisibility of the cavity as far as the processing signal at TL α0 = 3 is concerned. The reflected signal from lead β0 = 1 is essentially zero. l Convergence of ginvis to ~10−4, signifying that the transmitted field matches the desired (injected) wave. Evolution of: m The cable-length \({L}_{12}^{{{{\rm{opt}}}}}\); n The injected relative power; o The relative phase (with respect to the signal injected from lead β0 = 1) of the control signal injected from lead αc = 2 vs. iteration number. The black solid (colored dashed) lines with filled black circles (colored squares) are the experimental (digital twin) results.
The in-situ optimization protocol proceeds as follows: (a) Forward Measurement: First, we inject signals from TLs attached to two of the vertices (n = 1, 2 for the CPA and n = 1, 3 for the TMT and invisibility modalities, see upper row of Fig. 3) into the network. Forward voltages Φ are measured at the vertices n = 1, 2 that are associated with the length optimization parameter \({L}_{12}^{{{{\rm{opt}}}}}\). (b) Adjoint Measurement: The source for the adjoint measurement is then constructed from the previously measured forward voltages and according to the specific objective function. For the TMT case, the adjoint input was delivered from the α = 4 TL that was targeted for maximizing the outgoing signal. For the CPA protocol, the adjoint input was delivered to the two α = 1, 2 TLs. Finally, for the invisibility protocol, the adjoint signal was delivered to α = 1, 2 TLs where the optimization constraints have been imposed. In this case, a control field was also injected from the remaining α = 3 TL. The adjoint voltages Ψ that were needed to measure for the evaluation of the gradient were associated with the vertices connected to the TLs that have been used to inject the input signal, i.e. α = 1, 2 for the CPA, α = 1, 3 for the TMT and invisibility protocols; (c) Gradient Calculation: With the local forward Φ and adjoint Ψ measurements obtained, we calculate the gradient of the objective function with respect to the controllable parameters (see Eq. (6)) in real-time. We re-emphasize that the choice of controllable parameters dictates the positions/vertices n where the required forward ϕn and adjoint measurements ψn of the voltages are performed for the gradient calculation \(\frac{dg}{d{{{\bf{p}}}}}\); (d) Parameter Update: Once the gradient was computed, we employed a gradient descent algorithm to update the optimization parameters. Specifically, we used the package NLOPT with the Limited-memory Method of Moving Asymptotes (LD_MMA) option57. This algorithm identifies a new set of parameters, which were then implemented by adjusting the phase shifter length and modifying the relative amplitude and phase of the input signals; (e) Iteration and Convergence: The steps (a–d) are repeated until the objective function converges on an optimal value (within some tolerance). A single operating frequency was selected and held constant throughout the optimization process.
In-silico demonstration of the iPAC scheme using a digital twin of a fully connected network of V = 20 vertices consisting of 190 lossy coaxial cables. Each vertex is attached to a TL. The control parameters used for the in-silico optimization involve only the bonds of the network (cavity shaping). Three different modalities, all at f = 3.2 GHz, are demonstrated: a–c: Targeted Mode Transmission (TMT) for a scenario where six TLs α = 1, 3, 6, 7, 9, and 15 are used to inject a random wavefront, and the network is optimized to deliver the input signal ≈90% to the targeted channels n = 8, 16, 17. a Convergence of the TMT objective function gTMT vs. iteration number. b Representative evolution of selected bond-length variations during the optimization. c Final set of bond-length variations across all network bonds. d–f: Coherent Perfect Absorption (CPA) scenario for a wave injected from all N = 20 TLs. d Convergence of the CPA objective function gCPA toward nearly perfect absorption (gCPA ≈ 0.9998). e Representative bond-length variations vs. iteration. f Final network configuration achieving the CPA state. g–i: Signal invisibility (cavity-camouflage). The interrogating signal is injected into the network from channel β0 = 1 and is received from TL α0 = 8 with the same amplitude and phase. A control signal injected from a control channel αc = 3 is balancing the losses. g Convergence of gtrans to ~6 × 10−4, signifying that the transmitted field matches the desired (injected) wave. h Evolution of selected bond-length variations during the optimization. i Final distribution of bond-length variations across all bonds after 3351 iterations.
In Fig. 2 we report the results of the in-situ optimization (solid black lines with filled circles) for the three modalities discussed above. In all cases, we have achieved a rapid convergence towards an optimal value of the corresponding objective functions occurring after ~20 iterations of the protocol, see Fig. 2b,g,l. The convergence of the three control parameters (\({L}_{12}^{{{{\rm{opt}}}}},A,\theta\)) towards their optimal value for each of the three modalities is reported in the third, fourth, and fifth rows of the same figure respectively.
In-silico Implementation of iPAC for large control parameter system
In Fig. 3, we also present the in-silico results (shown as dashed lines with filled squares) obtained from a digital twin implementation of the AO protocol. The close agreement between the digital twin and the in-situ results confirms that our experimental set-up is adequately captured by our network model. This ad hoc validation supports the applicability of the digital twin approach to more complex networks, with a larger number of control parameters. Needless to stress that, in general/typical cases, an in-silico implementation of the AO is subject to a number of drawbacks like developing a highly accurate model of every propagation path, boundary and loss channel in continuous space which can become computationally burdensome and sensitive to modeling errors, especially for complex cavities. These have to be contrasted with the in-situ implementation of iPAC, where the physical system itself computes its own Green’s function in real time, by performing only local measurements.
We considered fully connected networks consisting of N = 20 vertices with a total of 190 bonds. The bond-lengths are initially uniformly distributed in the interval [L0 − δL, L0 + δL] where L0 = 25 cm and δL = 5 cm. At each vertex, we have attached TLs (i.e. N = 20) that have been used for injecting (receiving) the interrogating (scattering) signal. The frequency of the injected waves was chosen to be f = 3.2 GHz for all cases. The optimization process has been achieved via bond-length variations (cavity-shaping approach).
The first column of Fig. 3 reports the results of the TMT modality. A random wavefront has been injected into the network from six TLs coupled to vertices n = 1, 3, 6, 7, 9, and 15. The adjoint optimization scheme aimed to identify the appropriate bond-length variations that resulted in delivering the injected signal to a specified set of channels attached to vertices n = 8, 16, 17, see inset of Fig. 3a. In the main part of subfigure Fig. 3a, we show the convergence of the objective function gTMT to a total transmittance of approx. 90%. We have checked that for the converged optimal bond-length configuration, the remaining 10% energy loss was associated with the absorption due to Ohmic losses at the wires. Typical bond-length variations \(\delta {L}_{nm}^{{{{\rm{opt}}}}}\) versus the iteration number are shown in Fig. 3b, while in Fig. 3c, we report the bond-length variations for all bonds of the network at the end of the optimization process.
The second column of Fig. 3 reports the digital twin calculations for the CPA-scenario. We have injected a randomly chosen coherent wavefront from all N = 20 TLs into the lossy network, see inset of Fig. 3d. Using the adjoint optimization protocol we have determined the optimal bond-lengths for which the network acts as a perfect constructive interference trap leading to complete absorption of the incident wave. In Fig. 3d, we show the convergence of the objective function towards a value gCPA = 0.9998 occurring after 2276 iterations. The evolution of some typical bond variations versus the number of iterations is shown in Fig. 3e, while Fig. 3f reports the final bond-variation for all bonds.
Finally, the last column of Fig. 3 shows the digital twin simulations for cavity camouflage (invisibility), see the inset of Fig. 3g. We have injected a signal from channel β0 = 1 with an amplitude \({A}_{{\beta }_{0}}=0.56\) and phase \({\theta }_{{\beta }_{0}}=6{9}^{o}\). To balance the network losses we have also injected a control signal into the system from channel αc = 3 with amplitude \({A}_{{\alpha }_{c}}=0.85\) and phase \({\theta }_{{\alpha }_{c}}=33{3}^{o}\). The adjoint optimization protocol aimed to identify an appropriate bond-length configuration for which the scattered signal collected at a specified α0 = 8 TL is identical to the interrogating wave injected from TL β0 = 1. In Fig. 3g, we show the convergence of the objective function gtrans towards the value ginvis ≈ 6 × 10−4 after 3351 iterations. Here, in addition to the constraints imposed by the objective function ginvis in Eq. (9) we have also requested zero transmission and reflection from the control channel αc = 3. This additional constraint introduce the following modification \({g}_{{{{\rm{invis}}}}}\to {g}_{{{{\rm{invis}}}}}+\frac{| {\phi }_{c}-{A}_{{\alpha }_{c}}{e}^{i}{\theta }_{{\alpha }_{c}}{| }^{2}}{{\sum }_{\{{I}_{\beta }\}}| {A}_{\beta }{| }^{2}}\). Even with a modest number of iterations ~400 of the adjoint optimization scheme the objective function can be as small as gtrans ≈ 0.01. Figure 3h,i show a representative evolution of bond-length variations versus iteration number and the final bond-lengths at the end of the optimization process (3351 iterations).
Efficiency of adjoint optimization computing
It is instructive to examine how the efficiency of the Adjoint Optimization scheme varies with the number of controlled parameters p and the complexity of the network. The latter can be quantified by the topological entropy \({h}_{{{{\rm{top}}}}}=\ln \rho\)58, where ρ is the spectral radius of the non-backtracking (Hashimoto) matrix T indexed by the set of directed bonds of the network (see “Methods”). The number of period-n non-backtracking closed paths (counted up to a cyclic shifts) is \(\frac{1}{n}{{{\rm{Tr}}}}({{{{\bf{T}}}}}^{n}) \sim {\rho }^{n}/n\), where ρ is bounded between the minimum and maximum valency vn as \({\min }_{n}\left({v}_{n}-1\right)\le \rho \le {\max }_{n}\left({v}_{n}-1\right)\). Hence, htop characterizes the combinatorial branching complexity of the underlying non-backtracking dynamics and thus reflects the connectivity of the network.
In Fig. 4 we report the efficiency of the Adjoint Optimization for each of the three modalities as a function of the number of control parameters, for three representative values of the topological entropy. In all cases, we find that the efficiency increases with the number of control parameters. The convergence rate of the objective function to its optimum, however, depends on the task and on htop. For CPA, convergence accelerates as htop increases. This finding is consistent with higher connectivity (more lossy bonds), which strengthens multiple scattering, traps energy, and enhances absorption. In contrast, TMT and invisibility show a non-monotonic dependence on htop, with fastest convergence near h ≈ 2 indicating that moderate complexity aids optimization, whereas excessive connectivity slows the approach to the optimal values of the objective functions. Further simulation details are given in Methods.
Efficiency of the Adjoint Optimization as a function of the number of controlled parameters and network complexity htop for: a TMT modality; b CPA modality; and (c) signal invisibility. Solid lines correspond to three representative networks with htop ≈ 1 (blue), 2 (orange), 3 (green). Each network has V = 75 vertices with Vbulk = 50 bulk (interior) vertices whose connectivity is varied to tune htop, and VTL = 25 boundary vertices used to attach transmission lines (TLs). Each TL vertex connects to the bulk via two bonds (valency vTL = 2), which keeps the TL-network coupling constant fixed as the bulk connectivity changes (see Methods). In all cases, performance improves as the fraction σ of tunable bulk-bulk bonds (controlled parameters) increases. For h ≈ 1, 2, 3 the total number of bulk bonds are 73, 193, 529, respectively.
We stress that gradient-based schemes are far more time-efficient than derivative-free alternatives (e.g., genetic algorithms or particle-swarm methods) once the number of optimization parameters grows large59. In high-dimensional settings, non-gradient approaches typically incur substantially greater computational effort and memory, with scaling that deteriorates as the parameter size increases60,61. Empirically, gradient methods also frequently attain better local optima25,59,62,63. As a representative case,59 benchmarks Adjoint optimization against a genetic algorithm for photonic inverse design and finds the former markedly less demanding in computational resources.
Other gradient-based methods that approximate the gradients via finite differences involve solving or simulating the problem described by Eqs. (3),(5)) for every combination of the optimization variables \({{{\bf{p}}}}={({p}_{1},{p}_{2},\cdots )}^{T}\) leading to too-long computational times. Instead, the Adjoint Optimization bypasses this costly (in terms of computational memory and time) bottleneck when number of optimization parameters increases, because all the gradients can be computed at once by solving only two distinct problems associated with the forward and the backward propagation. A detail comparison between finite difference and Adjoint Optimization approaches is given in the Supplementary Information.
Of course, the in-silico implementation of an Adjoint Optimization is naturally limited by the computational complexity of simulating the physical system. On the contrary, the proposed in-situ implementation of the Adjoint Optimization which bypasses all the latencies (memory and time complexity) of digital simulations. All other computational steps have nearly fixed cost that do not scale (or scale very weakly) with the system size.
These unique features of the Physical Adjoint Optimization and its in-situ implementation are very promising for potential applications in RISs, where a large number of tunable elements may need to be reconfigured quickly to achieve predetermined, yet changing, goals.
Discussion
In conclusion, we have presented a proof-of-concept experimental demonstration of in-situ Physical Adjoint Computing for real-time control of electromagnetic wave modalities in complex multi-resonant and multi-scattering systems. Our approach can be mapped onto in-door wireless communication protocols64, in which a reconfigurable intelligent surface can be swiftly programmed to deliver stronger signals to moving targets amidst an evolving environment in real time. In such protocols, electric field measurements need to be made only at the positions of the metasurface elements and the target. Of course, such reconfigurable intelligent metasurfaces (RIS) will require the integration of sensing capabilities by appropriate modification of the tunable meta-atoms constituting the metasurface. While majority of current RIS are not designed to perform such local measurements, there are some recent works that push the boundaries further proposing65,66 and even demonstrating67,68 pixel-level (i.e. per-meta-atom) RF magnitude/phase sensing for closed-loop RIS control.
Importantly, no knowledge is required of the full electromagnetic environment, including any big or small obstacle which may stand in the way or even moving. Therefore, our approach is fundamentally different from existing wavefront-shaping methodologies, which require a full knowledge of the scattering matrix and its eigen-decomposition to identify the optimal wavefront patterns for achieving specific operations. Crucially, in such methods, the entire scattering matrix needs to be repeatedly re-measured and re-analyzed every time the metasurface is reconfigured and/or the surrounding changes, leading to formidable challenges in larger and more complex environments. In contrast, in-situ adjoint optimization bypasses the need for a scattering matrix by directly exploiting the gradient sensitivities judiciously plucked from a set of strategically positioned measurements.
A potential drawback arises in time-varying electromagnetic environments. Three characteristic time scales are relevant: (a) Fast environment vs settling: τenv < τss, the environmental fluctuation (coherence) time τenv is shorter than the wave settling (steady-state) time τss . This regime is atypical and ill-posed for any steady-state optimizer. (b) Quasi-static environment: τenv > τadj, the environment changes slower than the convergence time of the in-situ adjoint optimization τadj. This quasi-static case is ideal for our scheme. (c) Iteration-timescale drift: τenv ∝ O(τit), the environmental fluctuations are on the order of the per-iteration time τit. We analyze this regime in the Supplementary Information under the worst-case condition τenv = τit. There, we assume bond-parameter variations on the timescale of a single iteration and evaluate the optimization efficiency versus the variation strength for each of the three modalities reported in the main text. The results are task-dependent and show differing robustness to environmental fluctuations. In our experiment, the iteration time is ≈1 s, with the bottleneck set by relatively slow mechanical phase shifters. Faster actuation (e.g., semiconductor-based) would enable regimes with τenv > τit, yielding improved performance under fluctuations.
Let us finally point out that our wave-network platform also significantly differs from physical implementations of feed-forward neural networks, which typically do not utilize complex (multi-scattering) wave interactions in a multi-resonant electromagnetic environment. By leveraging these interactions, our platform amplifies small variations in the optimization parameters via multiple interference pathways, deriving richer physical abilities from a relatively smaller number of controllable parameters (in contrast to billions of weights and biases required in a feed-forward neural net). While we do not pursue any deep learning functionality in this work (and thus require no training data), we note that our setup offers a natural “physics-aware” deep learning platform for both in-situ training and inference, rather than a cumbersome imitation of an abstract neural network architecture. Most importantly,our experiments pave the way for the development of more powerful in-situ optimization protocols which will involve nonlinear and non-reciprocal wave mechanics, broadband pulses, and real-time control learning.
We conclude our discussion by pointing out that the implementation of the in-situ Physical Adjoint Computing can be extended beyond in-doors wireless communications. The same protocol can be applied to a variety of other wave-physics frameworks, including adaptive optics (e.g. for turbulence compensation, ophthalmic imaging, deep-tissue microscopy, multimode-fiber endoscopy), seismic wave control etc.
Methods
Network modeling
The transport properties of the microwave network are modeled using a metric graph consisting of one-dimensional wires (bonds) supporting a single propagating mode. The waves propagating between the inner and the outer conductor along the coax cable, is given in terms of the difference ψB(xB) between the potentials at the conductors’ surfaces, see Eq. (4). The bonds are connected together at vertices (v-port dividers) where Neumann boundary conditions are imposed. In the experimental network we have used 3—port vertices (T-junctions).
The solutions of Eq. (4) at a bond B = (nm) can be expressed as
which satisfy the wave continuity conditions \({\psi }_{B}\left({x}_{B}=0\right)={\phi }_{n};{\psi }_{B}\left({x}_{B}={L}_{B}\right)={\phi }_{m}\), for each pair of connected vertices n < m. Furthermore, the current is conserved at each vertex, i.e.,
where \({\delta }_{\alpha {\alpha }^{{\prime} }}\) is the Kronecker delta, and the second term accounts for the derivatives at the ports connected to TLs. Combining the above vertex boundary conditions, together with Eq. (10) we arrive at Eq. (5) which provides the system matrix that describes transport in the forward direction.
Characterization of network complexity
We quantify the network complexity by the topological entropy \({h}_{{{{\rm{top}}}}}=\ln \rho\) where ρ is the spectral radius of the 2B × 2B non-backtracking (Hashimoto) matrix T. The latter is defined in the space of directed edges of the network b = (n → m) with entries
with \(\bar{b}\equiv (m\to n)\) being the reverse arc. Notice that for any row b the sum \({\sum }_{{b}^{{\prime} }}{T}_{b{b}^{{\prime} }}={v}_{n(b)}-1\) where vn(b) is the valency of the vertex n. Therefore, \(\min ({v}_{n(b)}-1)\le \rho \le \max ({v}_{n(b)}-1)\).
Since \({{{\rm{Tr}}}}{{{{\bf{T}}}}}^{n}\) counts the number of period-n non-backtracking closed paths on the network,
More branching and more loops indicate more routes and consequently larger htop; sparse or weakly looped graphs yield small htop (for intuition, a v-regular network with vn = v for all n has topological entropy \({h}_{{{{\rm{top}}}}}=\ln (v-1)\) whereas a single cycle network has htop = 0). Thus htop is a pure connectivity metric, which is relabeling-invariant, independent of bond lengths, that captures the combinatorial growth of admissible routes on the network.
In-silico Implementation of the iPAC
We conducted in-silico simulations of a complex scattering network consisting of V = 20 vertices that are fully connected with 190 bonds. Each vertex was attached to a TL, i.e., N = 20. In the digital twin simulations, we considered a cavity-shaping optimization scheme that allows adjustments of all 190 bond-length, i.e., a large number of DoF relevant to operational realities. In fact, under such conditions is expected that the implementation of the adjoint-based gradient descent protocol is more beneficial as compared to other optimization schemes
The bond lengths were initialized with randomized values uniformly distributed around L0 = 0.25 m, with variations constrained to δL ± 5 cm (=0.5λ where λ is the operational wavelength), such that \({L}_{nm}\in \left[{L}_{0}-\delta L,\,{L}_{0}+\delta L\right]\). For all modalities, the wavefront parameters were fixed, with the amplitude parameters constrained Ai ∈ [0.001, 3.0], and θi ∈ [−π, π]. An amplitude lower bound was set to prevent trivial solutions with zero input power.
Controlling and setting up the VNA for coherent wavefront inputs
To precisely control the phase and amplitude of signals injected into the input ports of the scattering system, a Keysight PNA P5023B four-port Vector Network Analyzer (VNA) equipped with the S93089B Differential and I/Q Device Measurements option was utilized. The S93089B option enables accurate phase control of multiple internal sources, facilitating coherent excitation without the need for external hybrid couplers or baluns. Two internal sources were configured to deliver signals to the desired input ports of our microwave graph network. Both sources were set to the same frequency to maintain coherence, while the relative phase between the two sources was precisely adjusted from 0o to 360o using the S93089B’s phase control settings. This allows the phase difference to be fixed at specific values in degrees of one input port relative to a reference port. The output power of each source was individually adjusted in the interval [ −40 dBm, 0 dBm] to achieve the desired amplitude difference at each input port. A calibration routine was executed to compensate for any inherent phase and amplitude imbalances introduced by the VNA’s internal signal paths and external cabling. For ensuring the experimental stability of the objective function, we performed ten measurements per iteration, resulting in essentially identical outputs characterized by their mean value.
For forward scattering measurements, both sources were activated and phase-aligned according to a random set of initial values. The S93089B option’s source-phase control ensured that the relative phase between the inputs was maintained with high precision throughout the measurement. The VNA’s receivers were configured to measure the DUT’s response at the fundamental frequency, capturing the effects of coherent excitation on the forward scattering parameters. In adjoint measurement scenarios, these sources provided the excitation signal, and the VNA measured the reflected and transmitted signals accordingly (in case only one excitation signal was needed the other source was deactivated).
Controlling and setting up the mechanical phase shifter
To achieve precise length manipulation in our experimental setup, we integrated a mechanical phase shifter into the system (bond \({L}_{12}^{{{{\rm{opt}}}}}\)), a coaxial RF phase shifter, typically operated via a manual knob. To enable automated and repeatable control, we motorized the phase shifter and developed a characterization method to correlate motor movements with the resulting length perturbations.
The mechanical phase shifter used in our experiment was designed to operate over a frequency range of DC to 18 GHz, with an insertion loss of less than 1.0 dB up to 18 GHz and capable of handling up to 100 Watts of average RF power. The device originally featured a manual adjustment knob for phase tuning, however, a stepper motor was mechanically coupled to the phase shifter’s adjustment knob. The motor was securely mounted to maintain alignment and prevent mechanical backlash, ensuring consistent control over the phase adjustment mechanism. The motor was interfaced with a Trinamic motion controller, allowing for precise digital control of the motor’s position, and providing an adjustable phase shifter’s length from 3 mm to 23 mm. The controller was connected to a computer via a USB interface, enabling automated control through custom Python scripts.
To establish a reliable relationship between the motor’s rotational steps and the physical displacement within the phase shifter, we conducted a calibration process using a high-precision digital micrometer (Asimeto IP65 Digital Outside Micrometer). The micrometer was positioned to measure the linear displacement resulting from the motor’s rotation. The micrometer’s spindle was placed in contact with a reference point on the phase shifter that moved in response to the internal adjustment mechanism. The motor was programmed to move in increments of microsteps, and the corresponding displacement was recorded using the micrometer. Movements were performed in both clockwise and counterclockwise directions to account for any mechanical hysteresis. The collected data indicated that 464 microsteps of the motor corresponded to a linear displacement of 1 mm within the phase shifter. A linear relationship was established between the number of micro-steps (Nsteps) and the displacement \(d=\frac{{N}_{steps}}{464}m{{{\rm{m}}}}\). Multiple trials were conducted to confirm the repeatability of the calibration. The standard deviation of the displacement measurements was within the micrometer’s specified accuracy, ensuring confidence in the calibration.
Finally, we point out that the accuracy of the phase shifter was depending on the resolution of our micrometer, which is roughly 0.01 mm. However, the optimizer used to update the optimization parameters, treated this length as a continuous, real-valued set-point, with higher precision than it is measured. Despite this “quantization” error, there was no issue with our optimization performance as the gradients pointed in the correct direction. In fact, a degree of stochasticity in the gradients are known to be beneficial for gradient-guided optimization, as our in-situ studies confirmed due to an unavoidable stochasticity whose origin is traced back to various experimental noise sources (temperature variations, technical noise at the equipments etc).
Modeling of the phase shifter
To understand the phase shifter’s impact on the transmitted signals, we modeled it as a variable-length transmission line supporting a Transverse Electromagnetic (TEM) mode. The phase shift introduced by the device is a function of the electrical length, which depends on both the physical length and the dielectric properties of the medium. Using the calibrated Vector Network Analyzer (VNA) setup described previously, we measured the scattering matrix (S-parameters) of the phase shifter over the frequency range of interest. Measurements were taken at various positions of the phase shifter corresponding to different micrometer readings. The phase shifter was modeled as a two-port network with its behavior represented by transmission line equations. The phase shift (ϕ) introduced by the line is given by ϕ = β ⋅ d where β is the phase constant, and d is the physical length of the transmission line. The phase constant is related to the frequency f and the effective permittivity ϵeff of the medium by \(\beta=\frac{2\pi f}{c}\sqrt{{\epsilon }_{eff}}\) where c is the speed of light in a vacuum. The effective permittivity was assumed to be complex to account for dielectric losses within the phase shifter. We modeled ϵeff as a function of the micrometer-measured length and frequency. To extract the relationship between the effective permittivity, physical displacement, and frequency, we employed surrogate optimization using MATLAB, finding that n = ϵeff ≈ 1.004 + 0.0022i and the functional dependence of the length of the phase shifter LS on the measured length of the micrometer \({L}_{ps}=286mm+2\left(d-7mm\right)\) accounting for the fact that it is a trombone line phase shifter, so the factor of 2 accounts for the doubling of the line when making length adjustments.
Efficiency of adjoint optimization methodology
Efficiency for increasing complexity and optimization parameters
To assess how combinatorial complexity and tunability affect iPAC efficiency, we simulated three modalities (TMT, CPA, invisibility) across three topological-entropy levels htop = 1, 2, 3 (Fig. 4a–c). For each htop, we averaged the optimal objective over 100 random networks with identical connectivity (thus the same htop) but uniformly random bond lengths Lb ∈ [21.2, 28.8] cm. Each network had V = 75 vertices: a bulk of Vbulk = 50 and VTL = 25 boundary vertices used to attach transmission lines (TLs). We increased htop by raising the bulk connectivity (vertex valencies). TL vertices were kept at valency vTL = 2, fixing the TL-network coupling \(\Gamma=1-| \langle {S}_{\alpha,{\alpha }^{{\prime} }}\rangle {| }^{2}=1-{\big(1-\frac{2}{{v}_{{{{\rm{TL}}}}}+1}\big)}^{2}\)44 across realizations and different htop (\({S}_{\alpha,{\alpha }^{{\prime} }}\) are the diagonal elements of the scattering matrix and 〈 ⋯ 〉 indicates an averaging over frequency realizations and channels α).
The networks with htop = 1, 2, 3, involve 73, 193, and 529, respectively, number of bonds that connect the bulk vertices. In our simulations, we varied the number of control parameters by varying the tunable fraction σ of bulk-bulk bonds (σ = 1 indicates that all bulk bonds are tuned). Tunable bond-lengths were constrained within the range 17.3 ≤ Lb ≤ 33.7 cm. The optimization used NLopt’s MMA (gradient-based) with relative tolerances 10−7. For each (h, σ) we report the mean optimum over the 100 network realizations. The optimization scenarios used in this analysis were the same ones discussed in the main text. Specifically: (i) for the TMT we have injected a random monochromatic wavefront from 10 TLs and targeted other 5 TLs; (ii) for the CPA, we have injected a random monochromatic wavefront from all 25 TLs; and (iii) for the invisibility we have used one interrogation TL from where the incident signal was injected, and one receiving TL where we have requested the emitted signal to have equal amplitude and phase as the injected one. Finally, we have also employ a separate control TL to balance losses (as in the main text).
Our analysis show that the optimized objective increases monotonically with σ, and high performance shifts toward σ → 1 for all htop. The convergence behavior depends on the task and on htop: for CPA, convergence accelerates as h increases-consistent with more lossy bonds (from higher connectivity) and stronger multiple scattering that trap energy and enhance absorption. In contrast, TMT and invisibility show a non-monotonic dependence on htop, with fastest convergence near htop ≈ 2; moderate complexity aids optimization, whereas excessive connectivity offers diminishing returns. A detailed analysis of this non-monotonicity is left for future work.
Time-performance benchmark
We model four latencies: measurement tm, interconnect tl, host compute tc, and actuation to. One adjoint iteration (forward + adjoint measurement, gradient assembly, update) yields
where p is the number of tunable parameters and α ≥ 1 is the actuation multiplier per update. The constants conservatively account for round-trip link events in the two measurements and a single actuation block.
A central finite-difference (FD) iteration perturbs each parameter n by ±δ, measures twice, restores the nominal value, and then updates, giving:
On our setup (Keysight P5023B VNA; Intel Core i9-14900K; stepper-motor actuators) tm = 6.7 ms; USB microframe: tl = 125 μs; host compute: tc = 3 ns; stepper actuation: to = 0.1 s per micro-move with α ≈ 10 resulting in αto ≈ 1s. Thus tadj(p) ≈ 1.0006 s (for p ≤ 103) while FD grows linearly with slope 10tl + 2tm + 3to − tc ≈ 0.301 s/parameter, giving tFD(p = 1000) ≈ 302 s. For further details see Supplementary Information and associated Supplementary Fig. 1.
We, therefore, conclude that since the Adjoint uses two measurements and one update per iteration, it results to a runtime which is essentially independent of p. Instead, FD adds two measurements and ≈3 actuations per parameter, making runtime linear in p and dominated by actuation/I/O.
Data availability
The datasets generated during and/or analyzed during the current study are available in the Zenodo repository69 (https://doi.org/10.5281/zenodo.17314682).
Code availability
The algorithms used for this study are standard and are outlined in the Main text and in “Methods.” The corresponding authors can provide code scripts upon request.
References
Cao, H., Mosk, A. P. & Rotter, S. Shaping the propagation of light in complex media. Nat. Phys. 18, 994–1007 (2022).
Gigan, S. et al. Roadmap on wavefront shaping and deep imaging in complex media. J. Phys. Photonics 4, 042501 (2022).
Bliokh, K. Y. et al. Roadmap on structured waves. J. Opt. 25, 103001 (2023).
Souza, L., Souza Lopes, C. H., Santos, R., Cerqueira Sodré Junior, A. & Mendes, L. L. A study on propagation models for 60 GHz signals in indoor environments. Front. Commun. Netw. 2, 757842 (2022).
Jesus Torres, A., Sanguinetti, L. & Björnson, E. Electromagnetic interference in ris-aided communications. IEEE Wirel. Commun. Lett. 11, 668–672 (2021).
Frazier, B. W., Antonsen, T. M., Anlage, S. M. & Ott, E. Wavefront shaping with a tunable metasurface: creating cold spots and coherent perfect absorption at arbitrary frequencies. Phys. Rev. Res. 2, 043422 (2020).
Frazier, B. W., Antonsen, T. M., Anlage, S. M. & Ott, E. Deep-learning estimation of complex reverberant wave fields with a programmable metasurface. Phys. Rev. Appl. 17, 024027 (2022).
Jiang, X. et al. Coherent control of chaotic optical microcavity with reflectionless scattering modes. Nat. Phys. 20, 109–115 (2024).
Wang, C.-Z., Guillamon, J., Tuxbury, W., Kuhl, U. & Kottos, T. Nonlinearity-induced scattering zero degeneracies for spectral management of coherent perfect absorption in complex systems. Phys. Rev. Appl. 22, 064093 (2024).
Goïcoechea, A., Hüpfl, J., Rotter, S., Sarrazin, F. & Davy, M. Detecting and focusing on a nonlinear target in a complex medium. Phys. Rev. Lett. 134, 183802 (2025).
Sol, J., Alhulaymi, A., Stone, A. D. & Del Hougne, P. Reflectionless programmable signal routers. Sci. Adv. 9, 0323 (2023).
Popoff, S. M., Goetschy, A., Liew, S., Stone, A. D. & Cao, H. Coherent control of total transmission of light through disordered media. Phys. Rev. Lett. 112, 133903 (2014).
Hsu, C. W., Liew, S. F., Goetschy, A., Cao, H. & Douglas Stone, A. Correlation-enhanced control of wave focusing in disordered media. Nat. Phys. 13, 497–502 (2017).
Chen, L., Kottos, T. & Anlage, S. M. Perfect absorption in complex scattering systems with or without hidden symmetries. Nat. Comm. 11, 5826 (2020).
Bender, N. et al. Depth-targeted energy delivery deep inside scattering media. Nat. Phys. 18, 309–315 (2022).
McIntosh, R. et al. Delivering broadband light deep inside diffusive media. Nat. Photon. 18, 744–750 (2024).
Plöschner, M., Tyc, T. & Cizmár, T. Seeing through chaos in multimode fibres. Nat. Photonics 9, 529 (2015).
Lerosey, G., Rosny, J., Tourin, A. & Fink, M. Focusing beyond the diffraction limit with far-field time reversal. Science 315, 1120–1122 (2007).
Mosk, A. P., Lagendijk, A., Lerosey, G. & Fink, M. Controlling waves in space and time for imaging and focusing in complex media. Nat. Photonics 6, 283–292 (2012).
Popoff, S. M. et al. Measuring the transmission matrix in optics: an approach to the study and control of light propagation in disordered media. Phys. Rev. Lett. 104, 100601 (2010).
Kaina, N., Matthieu, D., Lerosey, G. & Fink, M. Shaping complex microwave fields in reverberating media with binary tunable metasurfaces. Sci. Rep. 4, 6693 (2014).
Kaina, N., Dupré, M., Fink, M. & Lerosey, G. Hybridized resonances to design tunable binary phase metasurface unit cells. Opt. Express 22, 18881–18888 (2014).
Alexandropoulos, G. C., Shlezinger, N. & Hougne, P. Reconfigurable intelligent surfaces for rich scattering wireless communications: recent experiments, challenges, and opportunities. IEEE Commun. Mag. 59, 28–34 (2021).
ElMossallamy, M. A. et al. Reconfigurable intelligent surfaces for wireless communications: Principles, challenges, and opportunities. IEEE Trans. Cogn. Commun. Netw. 6, 990–1002 (2020).
Di Renzo, M. et al. Reconfigurable intelligent surfaces vs. relaying: differences, similarities, and performance comparison. IEEE Open J. Commun. Soc. 1, 798–807 (2020).
Tsilipakos, O. et al. Toward intelligent metasurfaces: the progress from globally tunable metasurfaces to software-defined metasurfaces with an embedded network of controllers. Adv. Opt. Mater. 8, 2000783 (2020).
Basar, E. et al. Wireless communications through reconfigurable intelligent surfaces. IEEE Access 7, 116753–116773 (2019).
Dupré, M. et al. Wave-field shaping in cavities: Waves trapped in a box with controllable boundaries. Phys. Rev. Lett. 115, 017701 (2015).
Hougne, P., Lemoult, F., Fink, M. & Lerosey, G. Spatiotemporal wave front shaping in a microwave cavity. Phys. Rev. Lett. 117, 134302 (2016).
Wetzstein, G. et al. Inference in artificial intelligence with deep optics and photonics. Nature 588, 39–47 (2020).
Shastri, B. J. et al. Photonics for artificial intelligence and neuromorphic computing. Nat. Photonics 15, 102–114 (2021).
Shen, Y. et al. Deep learning with coherent nanophotonic circuits. Nat. Photonics 11, 441–446 (2017).
Wright, L. G. et al. Deep physical neural networks trained with backpropagation. Nature 601, 549–555 (2022).
Roques-Carmes, C. et al. Heuristic recurrent algorithms for photonic ising machines. Nat. Commun. 11, 249 (2020).
Vadlamani, S. K., Xiao, T. P. & Yablonovitch, E. Physics successfully implements Lagrange multiplier optimization. Proc. Natl. Acad. Sci. 117, 26639–26650 (2020).
Hughes, T. W., Minkov, M., Shi, Y. & Fan, S. Training of photonic neural networks through in situ backpropagation and gradient measurement. Optica 5, 864–871 (2018).
Pai, S. et al. Experimentally realized in situ backpropagation for deep learning in photonic neural networks. Science 380, 398–404 (2023).
Xue, Z. et al. Fully forward mode training for optical neural networks. Nature 632, 280–286 (2024).
Céa, J. Conception optimale ou identification de formes, calcul rapide de la dérivée directionnelle de la fonction coût. ESAIM Mod.élisation math.ématique et. Anal. numér. 20, 371–402 (1986).
Jameson, A. Aerodynamic design via control theory. J. Sci. Comput. 3, 233–260 (1988).
Jensen, J. S. & Sigmund, O. Topology optimization for nano-photonics. Laser Photonics Rev. 5, 308–321 (2011).
Molesky, S. et al. Inverse design in nanophotonics. Nat. Photonics 12, 659–670 (2018).
Kottos, T. & Schanz, H. Quantum graphs: a model for quantum chaos. Phys. E 9, 523–530 (2001).
Kottos, T. & Smilansky, U. Quantum graphs: a simple model for chaotic scattering. J. Phys. A Math. Gen. 36, 3501 (2003).
Kottos, T. & Schanz, H. Statistical properties of resonance widths for open quantum graphs. Waves Random Media 14, 91 (2003).
Hurt, N.E. Mathematical Physics of Quantum Wires and Devices: From Spectral Resonances to Anderson Localization. Mathematics and Its Applications, Vol. 506 (Springer, 2000).
Kuchment, P. Graph models for waves in thin structures. Waves random media 12, 1 (2002).
Kuchment, P. Quantum graphs and their applications. Special issue of Waves in Random Media 14, (2004).
Lawrie, T., Tanner, G. & Chronopoulos, D. A quantum graph approach to metamaterial design. Sci. Rep. 12, 18006 (2022).
Wang, C.-Z., Kononchuk, R., Kuhl, U. & Kottos, T. Loss-induced violation of the fundamental transmittance-asymmetry bound in nonlinear complex wave systems. Phys. Rev. Lett. 131, 123801 (2023).
Johnson, S.G. The NLopt nonlinear-optimization package. https://github.com/stevengj/nlopt (2007).
Kottos, T. & Smilansky, U. Chaotic scattering on graphs. Phys. Rev. Lett. 85, 968–971 (2000).
Hul, O. et al. Experimental simulation of quantum graphs by microwave networks. Phys. Rev. E 69, 056205 (2004).
Wang, C.-Z., Kuhl, U., Dowling, A., Schanz, H. & Kottos, T. Bound states in the continuum induced via local symmetries in complex structures. Phys. Rev. Appl. 22, 014010 (2024).
Baranov, D., Krasnok, A. & Shegai, Tea Coherent perfect absorbers: linear control of light with light. Nat. Rev. Mater. 2, 17064 (2017).
Wan, W. et al. Time-reversed lasing and interferometric control of absorption. Science 331, 889–892 (2011).
Svanberg, K. A class of globally convergent optimization methods based on conservative convex separable approximations. SIAM J. Optim. 12, 555–573 (2002).
Kottos, T. & Smilansky, U. Periodic orbit theory and spectral statistics for quantum graphs. Ann. Phys. 274, 76–124 (1999).
Christiansen, R. E. & Sigmund, O. Inverse design in photonics by topology optimization: tutorial. J. Optical Soc. Am. B 38, 496–509 (2021).
Goldberg, D. E. Genetic Algorithms (Addison-Wesley, 1989).
Aage, N., Andreassen, E., Lazarov, B. S. & Sigmund, O. Giga-voxel computational morphogenesis for structural design. Nature 550, 84–86 (2017).
Sigmund, O. On the usefulness of non-gradient approaches in topology optimization. Struct. Multidiscip. Optim. 43, 589–596 (2011).
Katz, O., Small, E., Bromberg, Y. & Silberberg, Y. Focusing and compression of ultrashort pulses through scattering media. Nat. Photonics 5, 372–377 (2011).
Karamanos, T. D., Fink, M. & Lemoult, F. Topology optimization for microwave control with reconfigurable intelligent metasurfaces in complex media. Phys. Rev. Appl. 21, 044022 (2024).
Alamzadeh, I., Alexandropoulos, G. C., Shlezinger, N. & Imani, M. F. A reconfigurable intelligent surface with integrated sensing capability. Sci. Rep. 11, 20737 (2021).
Rana, B., Cho, S.-S. & Hong, I.-P. Characterization of unit cells of a reconfigurable intelligence surface integrated with sensing capability at the mmWave frequency band. Electronics 13, 1689 (2024).
Alamzadeh, I. & Imani, M. F. Experimental demonstration of sensing using hybrid reconfigurable intelligent surfaces. Sensors 25, 1811 (2025).
Yang, H. Q. et al. Adaptively programmable metasurface for intelligent wireless communications in complex environments. Nat. Commun. 16, 6070 (2025).
Guillamon, J., Wang, C.-Z., Lin, Z., Kottos, T. Data for “in-situ physical adjoint computing in multiple-scattering electromagnetic environments for wave control". zenodo https://doi.org/10.5281/zenodo.17314682.
Acknowledgements
T.K. acknowledges useful discussions with S. Johnson on adjoint methodologies during a Simons Foundation webinar. We acknowledge partial funding from MURI ONR-N000142412548 (J.G. and T.K.), DOE DE-SC0024223 (J.G., C.W., Z.L., and T.K.), NSF-RINGS ECCS 2148318 (J.G., C.W., and T.K.), Simons Foundation SFI-MPS-EWP-00008530-08 (J.G., C.W., and T.K.), and ARO W911NF2410390 (Z.L.).
Author information
Authors and Affiliations
Contributions
J.G. performed the experiments and analyzed the measurements. J.G. and C.W. performed the in-silico calculations. C.W. developed the A.O. protocol under the supervision of Z.L. J.G. performed the time-performance benchmark, complexity-performance analysis and noise analysis. T.K. conceived and initiated the project. Z.L. and T.K. wrote the paper with input from J.G. and C.W. T.K. supervised the execution of the project.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Communications thanks the anonymous reviewers for their contribution to the peer review of this work. A peer review file is available.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Guillamon, J., Wang, CZ., Lin, Z. et al. In-situ physical adjoint computing in multiple-scattering electromagnetic environments for wave control. Nat Commun 16, 11466 (2025). https://doi.org/10.1038/s41467-025-66385-5
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41467-025-66385-5






