Experimental characterization of the energetics of quantum logic gates

We characterize the energetic footprint of a two-qubit quantum gate from the perspective of non-equilibrium quantum thermodynamics. We experimentally reconstruct the statistics of energy and entropy fluctuations following the implementation of a controlled-unitary gate, linking them to the performance of the gate itself and the phenomenology of Landauer’s principle at the single-quantum level. Our work thus addresses the energetic cost of operating quantum circuits, a problem that is crucial for the grounding of the upcoming quantum technologies.


INTRODUCTION
Thermodynamics was developed in the nineteenth century to improve the efficiency of steam engines. Its impact fostered the Industrial Revolution and affected fundamental science, technology, and everyday life alike. In the third millennium, we are facing a potentially equally revolutionary process, whereby standard information technologyusually CMOS (complementary metal-oxide-semiconductor) basedis complemented and enhanced by quantum technologies for communication, computation, and sensing 1,2 .
Despite the significant progress made towards the implementation of prototype quantum devices able to process an increasing amount of information in a reliable and reproducible manner 1,3 , little work has been devoted to the characterization of the energetic footprint of such potentially disruptive quantum technologies 4 . Yet, this is a crucial point to address: only by ensuring that the energy consumption associated with the performance of quantum information processing 5,6 scales favorably with the size of a quantum processor, would the craved quantum technologies embody a credible alternative to CMOSbased devices.
Remarkably, the fast-paced miniaturization process enabled by research in quantum information processing opens realistic possibilities to engineer and implement miniature-scale quantum machines akin to standard (macroscopic) engines that process and transform energy 7,8 . The challenge in this respect is to make use of the emerging field of quantum thermodynamics, which aims at establishing a framework for the thermodynamics of quantum processes and systems, to design energy-efficient quantum machines [9][10][11][12] possibly able to outperform their classical counterparts 3 , or benchmark the performance of quantum devices from a thermodynamic perspective, as recently done for the interesting case of quantum annealears 13,14 .
In this article, we perform a step towards the characterization of the energetics of quantum computation by studying the energy and entropy distributions [15][16][17][18][19][20][21][22] of two-qubit quantum systems realizing quantum gates. We consider the so-called two-point measurement (TPM) approach 23 to the reconstruction of the energy and entropy generated during and as a result of the performance of a two-qubit gate. We present the experimental inference of such quantities by means of a linear-optics setting where qubits are embodied by the polarization of two photons. We then use the information gathered through the reconstructed statistics of energy and entropy distributions to assess Landauer principle at the individual-quantum level, and thus explore the relation between information processing realized through prototype two-qubit gates and the thermodynamics of such transformations. While our quantitative analysis is specific of the chosen experimental platform, our approach is based on the estimation of joint probability distributions. As such, our formal approach to the characterization of the energetics of quantum gates would be applicable to any physical platform for quantum computation and might embody an energetics-inspired methodology for the comparison between devices implemented in different settings.
Our work embodies one of the first attempts at systematically linking the energetics of quantum information carriers to the logic functionality of a quantum gate. When developed to address multipartite settings and high-dimensional quantum systems 24 , our approach will be pivotal to the enhancement of the performance of quantum information processes.

RESULTS
The implemented process and its non-equilibrium thermodynamic analysis We consider the simple quantum circuit in Fig. 1: our two-qubit gate performs a controlled-unitary U, based on its decomposition into local unitary gates u θ and a control-σ z gate, that applies a Pauli σ z gate to the state of qubit B, conditioned on the state of the qubit A. This is the simplest instance of a programmable quantum circuit with a two-qubit interaction, an essential feature to our purposes.
Our physical implementation, depicted in Fig. 1c, adopts the two-photon control-σ z gate based on the use of polarizationselective non-classical interference and post selection [25][26][27] . The polarization encoding represents the logical states 0 j i k and 1 j i k with the horizontal H j i k and vertical V j i k polarizations, respectively, for both qubits k = A and B.
In order to investigate the thermodynamics associated with the performance of our gate, we need to associate a Hamiltonian to the interacting system of the two qubits able to account for the action of the device. To this purpose, we introduce the total Hamiltonian H tot ¼ H L þ H int , which consists of the local Hamiltonian H L and the interaction term H int , which read In Eq. (1), 1 is the identity matrix and σ j k is the j = x, y, z Pauli matrix of the qubit k. The interaction Hamiltonian H int generates a rotation of the state of qubit B that is conditioned on the state of qubit A. In particular, the total Hamiltonian H tot generates the following trajectories for the two-qubit logical states: with and The unitary operation U AB ðtÞ accounting for the trajectories in Eq. (2) can be cast in the following form: with P B ðtÞ diag½1; e ÀiωLt a phase gate on qubit B and R B ðtÞ a single-qubit rotation of a time-dependent angle φ = Δt around an axis identified by the vector n ¼ ðsin ζ; 0; cos ζÞ, where ζ ¼ cos À1 ðω L =2ΔÞ. The transformations in Eq. (2) thus correspond to those imparted by our gate, up to phases cos θ ¼ jh 1 ðtÞj, sin θ ¼ jh 2 ðtÞj that, as we will see, do not influence the energetics of the process. We can then rely on our model to analyze the computation processes from an out-of-equilibrium thermodynamic perspective.

Energy and entropy distributions
The framework for the inference of the statistics of energetics arising from Eq. (4) relies on two crucial points: 1. We adopt the tool provided by the TPM scheme to characterize energy and entropy distributions. This implies the application of two projective measurements onto the energy eigenstates of the two-qubit system at the initial and final times of the evolution of the system. 2. We assume to apply only local energy measurements. We will thus be unable to access quantum correlations between A and B.
In light of the first energy measurement entailed by the TPM approach, any quantum coherence potentially present in the initial state of the system is destroyed. While this is an intrinsic feature of the chosen approach to the inference of energy fluctuations, recently alternative methodologies have been developed, which enable the retention of the effects of initial quantum coherences [28][29][30][31][32][33] . The use of such approaches in the context of our investigation will be reported elsewhere. Point 2 has a deep implication: one has access only to the energy values pertaining to the local Hamiltonian of the two qubits. This means that, at the end of the protocol, the energy of A and B will be one of the eigenvalues of the Hamiltonian terms H LA _ω L ðσ z A IÞ=2 and H LB _ω L ðI σ z B Þ=2, that is, E j k (j = 0, 1 and k = A, B). In order to realize this, we introduce the local measurement operators with ψ, ϕ = 0, 1. Each of the four projectors Π ψ A ϕ B is associated Fig. 1 Details of the quantum circuit. a The element we inspect is a two-qubit controlled operation. b This can be decomposed as a series of three operations: a single-qubit gate u θ , a two-qubit control-σ z gate, and a second gate u θ . This relies on the fact that u θ u θ = 1, that is, the identity, while u θ σ z u θ = u 2θ . c The circuit is implemented in a photonic platform with polarization encoding. The two qubits are represented by the polarization of photons from a standard down conversion source (not shown). The basic element of the gate is a partially polarizing beam splitter (PPBS) with expected transmittivities T H = 1, T V = 1/3 for the two polarizations. This is embedded in a polarization Mach-Zehnder to mitigate the effects of the deviation of T H from 1 (we have T H ≃ 0.985 in our experiment)-for the sake of phase stability this was implemented as a Sagnac loop. Further, PPBSs are needed in order to equalize losses on the two polarizations. Half-wave plates (HWPs) set at an angle θ/2 are used to implement u θ . Polarization measurements in the logic basis are implemented using polarizing beam splitters (PBSs) and singlephoton counting modules (SPCMs).
with the corresponding energy value Those values correspond to stochastic realizations of the composite system at a given time instant t. We should stress how these stochastic realizations E ψ A ϕ B do not contain any correlation originated by the interaction Hamiltonian H int . In what follows, we will express the values of The energy variations are then observed under the lens of the probability distributions associated to the stochastic energy changes [cf. Appendices A and B for the formal definition of energy and entropy production]. In the chosen computational basis and by encoding the binary value of ψ A ϕ B in the integer m so that E ψ A ϕ B E m , the system energy variation reads ΔE m;n E fin m À E in n 17,23 . Thus, E in n (E fin m ) is the measured energy of the quantum system at the initial (final) time t 0 (t fin ).
The probability distribution of the energy variations ΔE can be then formally written as: where δ(x) is the Kronecker delta with argument x, and pðE in denotes the joint probability to measure E in n at t 0 and E fin m at t fin by performing local measurements at time t, whereby More details can be found in the "Methods" section. Notice that we have denoted as ρ 0 the initial state of the system before the first measurement of the TPM scheme is performed. The initial state ρ 0 can be an arbitrary density operator, including the case of initial states with quantum coherence in the energy (Hamiltonian) basis of the system. This means that, by applying a TPM scheme, all the information about ρ 0 is contained in the probability pðE in k Þ 34 . Finally, it is worth observing that experimentally (as it will shown below) the conditional probabilities pðE in n ; E fin m Þ=pðE in n Þ pðE in n jE fin m Þ can be obtained by initializing the system in the product states Π in ψ A ϕ B , letting it evolve according to H tot and then measuring its energy at final time t fin .

Experimental characterization
In the previous section, we have established a connection between the action of our gate in Fig. 1 and the dynamics encompassed in Eq. (2); we can thus proceed to its characterization.
We first address the energy fluctuations observed in the local energy basis. The specific structure of Eq. (2) imposes stringent constraints to the values assumed by the conditional probabilities pðE fin m jE in n Þ. In particular, one finds that the only conditional probabilities different from zero are pðE fin which are all functions of h 1 (t) and h 2 (t). Notice that the trajectories associated with the conditional probabilities in Eq. (8) leave qubit A in the logical state 1 j i A and modify the state of qubit B. As first step, we have thus experimentally reconstructed the conditional probabilities using the experimental apparatus in Fig. 1. In this regard, in Fig. 2 we plot the comparison between the joint probabilities pðE in 1Aϕ B ; E fin 1Aϕ B Þ as obtained by numerical simulations and the analysis of the experimental data. As pðE in k Þ depends on the specific choice of the initial state ρ 0 of the two-qubit system, also the joint probabilities in Fig. 2 would bear a dependence on the value taken for ρ 0 . Although, in principle, any choice of ρ 0 would be equally valid, the test of Landauer principle reported later requires a thermal initial density operator. We have thus considered where β A ¼ 1 2ωL ln α 1Àα with α ∈ [0, 1], and β B = 1/(2ω L ). In our case, we have chosen α = 0.2, so as to ensure a prominent asymmetry among the populations of qubit A. Equation (9) has been simulated measuring single-photon orthogonal polarization states for a time-interval proportional to the probability that such polarization state occurs in ρ 0 . The desired state can be obtained by mixing the weights of the two polarization states.
In Fig. 3a we plot the first 5 statistical moments 〈ΔE h 〉, h = 1, , 5, of the probability distribution pertaining to the energy variation during the implemented process, that is, depending on the evolution time t. From Fig. 3, one can observe that all the energy statistical moments have a periodic time behavior with maximum values in correspondence of ω L t ¼ kπ= ffiffiffiffiffi 26 p % 0:62, with k integer number. Moreover, being the error in the experimental data larger at ω L t ¼ kπ= ffiffiffiffiffi 26 p , it is worth also noting that the curves of 〈ΔE h 〉 obtained by the experiment with h ≥ 4 lose in accuracy in such points. This generally holds also for the other figures. Deviations of the experimental data from theoretical expectations are mostly due to two factors. The first is the non-ideal visibility of quantum interference due to the differences between the effective values of the transmittivity of the PPBS used to implement our gate from the ideal one (cf. Fig. 1). The second is the presence of random accidental counts, which decrease this visibility even further. In terms of energetics, these imperfections are reflected in a smaller values of the observed high-order energy moments close to the maximum achieved at ω L t ≃ 0.62, which turns out to be a very sensitive working point. The energy lost to the environment limits the extent of the fluctuations. Any non-equilibrium process results in the production of irreversible entropy Δσ 22 , which embodies a thermodynamic quantifier of the breakdown of time-reversal symmetry 19 and a non-equilibrium restatement of the second law of thermodynamics. At the quantum level, its values are determined by the competition of two sources of randomness: a classical one associated with the choice of initial state [cf. Eq. (9)] and a quantum mechanical one induced by the stochastic nature of quantum trajectories, which renders entropy production an inherently aleatory quantity.
One can thus introduce the associated probability distribution for the quantum entropy production 19,22 to study the statistics of such quantity. As illustrated in "Methods" section, for any unitary dynamical evolution, Δσ m;n ΔσðE fin m ; E in n Þ obeys a quantum fluctuation theorem 20-22 so that Δσ m;n ¼ ln ½pðE in n Þ=pðE fin m Þ ; where pðE in n Þ and pðE fin m Þ denote the probabilities to measure the nth and mth energy outcome at t 0 and t fin , respectively. In particular, pðE fin m Þ is given by the following relation: where ρ fin is the density operator of the bipartite quantum system at the end of its dynamical evolution. ρ fin can be experimentally obtained by preparing the quantum system in the ensemble average after the first energy measurement of the TPM scheme and then letting it evolve. Since the unitary operator U AB ðtÞ acts separately on qubits A and B by means of product state operations, also the final probability pðE fin m Þ as well as the 16 realizations of the stochastic quantum entropy production have been obtained by experimental data. Further details are in "Methods" section.
The statistics of Δσ is determined by evaluating the corresponding probability distribution Prob(Δσ). As shown in "Methods", this is given by where the joint probabilities pðE in n ; E fin m Þ are the same of those used to derive the energy probability distribution. Thus, having experimentally measured the joint probabilities pðE in n ; E fin m Þ [cf. Fig. 2] and then obtained the stochastic realizations of Δσ, we can directly derive the statistical moments of the entropy distribution. In Fig. 4 we plot the comparison between the experimental and theoretical statistical moments The experimental evidence shows a good agreement with the theoretical predictions. Moreover, an important physical point can be drawn: the black line and dots in Fig. 4, which show the behavior of the average stochastic entropy production, closely resembles the trend followed by the l 1 -norm of quantum coherence 35 with ρ ij denoting the (i, j) entry of the density matrix ρ. When evaluated for the last two trajectories in Eq. (2), C l1 follows the same trend as shown in Fig. 5. The stationary points of C l1 achieved at ω L t ¼ kπ= ffiffiffiffiffi 26 p ðk ¼ 1; 2; 3Þ correspond to analogous extremal points for 〈Δσ〉, thus corroborating the expectation that dynamically created quantum coherence play a crucial role in the determination of the amount of irreversible entropy generated across a non-equilibrium process 36 b. Fig. 3 Statistical moments of ΔE. a Statistical moments of the energy probability distribution as a function of time. We compare the experimental values and the corresponding theoretical predictions. The initial state of the two-qubit system is the density matrix ρ 0 in Eq. (9). We show the experimental (theoretical) values of the moments from 1st to 5th as black, red, green, blue, and magenta dots (lines) for the same parameters as in Fig. 2. b Absolute error jhΔE h i theo À hΔE h i exp j accounting for the difference between theoretical and experimental statistical moments of ΔE from 1st to 5th, provided by black circles, red dots, green diamonds, blue crosses, and magenta squares, respectively. coherence embodies an additional source of entropy production that adds to the (classical) contribution provided by the populations of the density matrix under analysis. The experimental simulation of a non-equilibrium process discussed in this paper provides a striking instance of such interplay between classical and genuinely quantum contributions to entropy production and strikingly connects them to the functionality of the gate encompassing the dynamics that we have addressed. Such connections are reinforced by the assessment of a Landauer-like relation connecting stochastic energetics between qubit A and B and the associated entropy production, which can be cast as [38][39][40] βhΔEi ! hΔσi ; (17) where β is the inverse temperature of the initial reduced state of qubit B. Figure 6 compares the ratio 〈ΔE〉/〈Δσ〉 with 1/β, showing full agreement with the predictions of Landauer principle and demonstrating an enhanced energy-to-entropy trade-off at the time minimizing the entropy production. The experimental dataset underestimates the energy-to-entropy ratio close to the maximum achieved at ω L t ≃ 0.62. This is due to the fact that the experimental value of 〈Δσ〉 at such time deviates from the nearly null expected one, thus lowering the observed ratio 〈ΔE〉/〈Δσ〉. While the results reported here refer to the initial thermal state in Eq. (9), as mentioned earlier, our general methodology for the inference of 〈ΔE〉 and 〈Δσ〉 do not depend on the specific choice of ρ 0 . Thus, it could be also used to measure Clausius-like relations for an arbitrary quantum system, without initializing the system in a thermal state, which would embody an interesting development of the endeavors reported here.

DISCUSSIONS
We have performed the theoretical and experimental characterization of the energetics of a quantum gate implementing a controlled two-qubit quantum gate. Using tools specifically designed for the quantification of energy changes resulting from a non-equilibrium process, we have inferred the statistics of quantum energy fluctuations and entropy production resulting from the implementation of such gate in a linear-optics platform where information carriers are encoded in the polarization of two photons.
The inferred statistics brings about clear signatures of the influence of quantum coherence generated in the state of the two qubits by the quantum gate, and allows for the test of the energyto-entropy trade-off embodied by Landauer principle, thus connecting in a quantitative manner logical and thermodynamic irreversibility entailed by the experimental process that we have realized. Our investigation is aligned with current efforts aimed to bridge quantum thermodynamics and quantum information processing, which hold the promises to deliver a deeper understanding of the origin of quantum advantage, based on nonequilibrium thermodynamics.
Our experiment was purposely chosen as the simplest instance for the sake of clarity. It will be interesting to extend our study to recent coherence-preserving approaches to the quantification of the distribution of energy fluctuations [28][29][30][31][32] to check the influences that such key quantity has on the energetic footprint of the gate. Moreover, consideration should also be given to multi-qubit gates to check if the full detail of the circuital scheme needs being taken into account for the drawing of suitable thermodynamic bounds.

Energy change distribution
At the nanoscale, non-equilibrium fluctuations play a crucial role and we expect that they are responsible for the irreversible exchange of energy between the system and the external environment. In this regard, the energy change ΔE m;k E fin m À E in k during the evolution of the system is defined as the difference between the measured energy of the quantum system, respectively before (1st energy measurement at t 0 ) and after (2nd energy measurement at t fin ) its dynamics. The Hamiltonian of the system is assumed to be time-independent, so that the energy values that the system can take remain the same during all its dynamics: no coherent modulation of the Hamiltonian is indeed considered. For this reason, no "mechanical" work is produced by or on the system, with the result that all the energy variations have to be ascribed to loss into the environment in the form of heat. In case the Hamiltonian of the system is timeindependent and energy changes are induced by measurement processes, one could refer to quantum-heat 17,41 .
As usual, the probability distribution of ΔE is given by the combinatorial combination of the Kronecker delta δ(ΔE − ΔE m,k ) weighted by the joint probability pðE in k ; E fin m Þ to measure E in k at t 0 and E fin m at t fin . Formally, one has The expression of the joint probabilities pðE in k ; E fin m Þ, as well as the specific values of E in k and E fin m , changes whether we apply global or local energy measurements on the bipartite quantum system. Here, we will analyze only the case of applying local energy measurements, for which we just take into account the local Hamiltonian H LA and H LB of A and B. They can be . The Landauer principle β〈ΔE〉 ≥ 〈Δσ〉 (1/β, red dashed line) is respected both theoretically and experimentally, although the experimental dataset underestimates the energy-toentropy ratio close to the maximum achieved at ω L t ≃ 0.62. This is due to experimental imperfections keeping preventing the value of 〈Δσ〉 at such time to achieve the nearly null expected one.
generally decomposed as with f H j i; V j ig computational basis of the single partition (qubit). As a remark, observe that the complete (or maximally informative) characterization of energy and entropy production of a multipartite quantum system is achieved by performing global measurements, since also the effects of (quantum) correlations between each partition are properly taken into account. However, local measurements are simpler to be performed and sometimes they constitute the only experimentally possible solution.
Hence, if only local energy measurements are performed, the joint probabilities of the distribution Prob(ΔE) are generally provided by the following relation: where Λ t is a complete positive trace preserving map 42 modeling the evolution of the system, while with ρ 0 the initial density operator.

Quantum entropy distribution
The fluctuations of the stochastic entropy production of a quantum system obey quantum fluctuation theorems 16,[20][21][22] . They are determined by evaluating the forward and backward processes associated to the dynamical evolution of the system. In particular, one can find that the stochastic quantum entropy production Δσ m,n equals to where p F ða fin m ; a in k Þ and p B ða in k ; a ref m Þ are the joint probabilities to simultaneously measure the outcomes {a} in a single realization of the forward (F) and backward (B) process, respectively. Instead, {a} denotes the set of measurement outcomes from a generic TPM scheme in which the measurement observables O are not necessarily the system Hamiltonian at t 0 and t fin . However, in our case the measurement outcomes {a} are chosen equal to the energies {E} of the system. Then, as proved in ref. 20 , the outcome a ref m refers to the state after the 1st measurement of the backward process, which is called reference state. If the evolution of the system is unital (in our case, the dynamics is simply unitary), then the stochastic quantum entropy production Δσ m,n becomes with pðE ref m Þ denoting the probability to get the measurement outcome E ref m . Although the quantum fluctuation theorem can be derived without imposing a specific operator for the reference state 16 , it is worth choosing the latter equal to the final density operator after the 2 nd measurement of the forward process. This choice appears to be the most natural among the possible ones to design a suitable measuring scheme of general thermodynamic quantities, consistently with the quantum fluctuation theorem and the asymmetry of the second law of thermodynamics. This means that for our purposes the stochastic quantum entropy production is where pðE fin m Þ denotes the probability to measure the mth energy outcome at the final time instant t fin . Experimentally, it is not possible in general to derive the stochastic realizations of the quantum entropy production of a multipartite quantum system by just performing local measurements. Specifically, it becomes feasible if the dynamical map of the composite system acts separately on each partition of the system and ρ 0 is a product state. In such a case, indeed, one can write where Π in n Π in A Π in B . Thus, by experimentally measuring the conditional probabilities pðE fin m jE in n Þ and the set fpðE in n Þg, one can also determine the set fpðE fin m Þg of final probabilities, as well as the 16 realizations of the stochastic quantum entropy production-see Fig. 7. In Fig. 7, one can observe that only the black and red lines are not constant in time: they all correspond to the situation of finding qubit A at t fin in the eigenstate 1 j i A of the local Hamiltonian H LA . Now, let us introduce the probability distribution Prob(Δσ). Depending on the values assumed by the measurement outcomes {E in } and {E fin }, Δσ is a fluctuating variable. Thus, each time we repeat the TPM scheme, we have a different realization for Δσ within a set of discrete values. The probability distribution Prob(Δσ) is fully determined by the knowledge of the measurement outcomes and the respective probabilities. As proved in refs. 20,21 , it is equal to Once again, it is worth noting that the specific values of E in k and E fin m change whether we apply global or local energy measurements on the bipartite quantum system.

Comparison between energy change and entropy distributions
The trends followed by the statistical moments of the energy changes and entropy production is markedly different. While the moments of ΔE (up to those reported in this work) are all positive within the time window that we have addressed, hΔσ 3 i and hΔσ 5 i can take negative values. These features have implications in the shape taken by the respective probability distributions, which are reported in Fig. 8 for two choices of the rescaled time: the distribution of energy changes showcases a larger skewness with a short and fat right tail. The indefinite signs taken by the moments of the entropy production, on the other hand, keep the corresponding distribution very symmetric around Δσ = 0. c. d.  c. d. Error analysis. Absolute error jp theo À p exp j accounting for the difference between theoretical and experimental joint probabilities pðE in 1Aϕ B ; E fin 1Aϕ B Þ as a function of the rescaled time ω L t. The blue dots report the values for pðE in 1A0B ; E fin 1A0B Þ, the red circles those for pðE in 1A1B ; E fin 1A0B Þ, the black crosses and the green diamond label the values for pðE in 1A0B ; E fin 1A1B Þ and pðE in 1A1B ; E fin 1A1B Þ, respectively. As in Fig. 2, we have taken ω int /ω L = 5. The initial state ρ 0 is given by Eq. (9) and V j i k ¼ ð1; 0Þ, H j i k ¼ ð0; 1Þ for both qubits k = A and B.