text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Revealing missing charges with generalised quantum fluctuation relations

## Abstract

The non-equilibrium dynamics of quantum many-body systems is one of the most fascinating problems in physics. Open questions range from how they relax to equilibrium to how to extract useful work from them. A critical point lies in assessing whether a system has conserved quantities (or ‘charges’), as these can drastically influence its dynamics. Here we propose a general protocol to reveal the existence of charges based on a set of exact relations between out-of-equilibrium fluctuations and equilibrium properties of a quantum system. We apply these generalised quantum fluctuation relations to a driven quantum simulator, demonstrating their relevance to obtain unbiased temperature estimates from non-equilibrium measurements. Our findings will help guide research on the interplay of quantum and thermal fluctuations in quantum simulation, in studying the transition from integrability to chaos and in the design of new quantum devices.

## Introduction

Einstein famously vouched for the enduring success of thermodynamics ‘within the framework of the applicability of its basic concepts’ stemming from the simplicity of its premises and breadth of its scope1. From its birth as a practical science in the cradle of the industrial revolution2 to modelling thermal fluctuations in biological processes through fluctuation relations (FRs)3,4, thermodynamics constitutes one of the most successful theories to understand nature. The increasing degree of control on meso- and nano-scopic systems has driven interest into the field of quantum thermodynamics to describe phenomena where both quantum effects and finite-size fluctuations are apparent5. Important findings so far range from generalised Carnot bounds on the efficiency of quantum heat engines6,7,8 to quantum versions of the classical FRs—i.e., quantum FRs (QFRs)—for processes starting in a canonical equilibrium state9. According to the principles of quantum statistical mechanics, such a state is characterised by a single parameter, the inverse temperature β, which also plays a special role in the QFRs (see ref. 10 and references therein).

The dynamics of an important number of quantum systems, however, eludes this approach. Integrable quantum systems, for instance, feature a large number of conserved quantities, or ‘charges’, which effectively constrain the phase space that the system can explore in its dynamic evolution11. Notable models with charges include the one-dimensional Hubbard model12, the Dicke model13,14 and the super-symmetric t-J model15, to name a few. The existence of charges leads sometimes to striking experimental observations such as the practically dissipationless dynamics of the quantum Newton’s cradle16, which stems from the (infinitely many) charges of the Lieb–Liniger model. On other occasions, however, their existence is far from obvious. For instance, it is only recently that a whole set of quasi-local charges in XXZ model were discovered17,18,19 as result of a discrepancy observed between numerical simulations of the model and estimates based on the Mazur bound20.

It is a critical task of quantum many-body physics to develop methods to confidently ascertain whether a quantum system features such charges, especially when these may be difficult to measure directly. Unfortunately, the Mazur bound is only sensitive to charges with a non-zero overlap with the current operator, which implies it cannot serve as a general witness to unveil all charges in a generic quantum many-body system. It is thus necessary to develop more general systematic methods to explore the existence of unknown conserved charges in quantum many-body systems.

Here we introduce an approach to this problem based on a statistical analysis of arbitrary non-equilibrium measurements of the system of interest. In short, we demonstrate that non-equilibrium measurements on a quantum many-body system are more sensitive to the existence of charges than equilibrium ones, and describe a protocol that exploits this sensitivity to reveal the existence of charges that restrict the dynamics in any degree of freedom of the system. To this end, we first provide a theory that completely characterises the non-equilibrium fluctuations of quantum systems with conserved quantities. Specifically, we present generalised versions of the Tasaki–Crooks relation (TCR)21 and the quantum Jarzynski equality (QJE)22,23,24 suitable to describe fluctuations in systems with an arbitrary, and possibly variable, number of charges. Then, we show how these results open the door to determining from experimental measurements the existence of hitherto unknown charges. We also discuss how this can improve the accuracy, e.g., of temperature measurements. Finally, we illustrate our results with simulations of the Dicke model13, 14, a well-known many-body model that features a single charge and which can be realised in current experimental platforms.

## Results

### Theoretical framework

The quantum statistical description of systems with charges can be reliably built on Jaynes’ information theory formulation of statistical mechanics25. In this approach, a new statistical ensemble, the generalised Gibbs ensemble (GGE), has been proposed26 to incorporate the constraints on the known values of the charges to the equilibrium state via the maximum entropy principle (see also ref. 27). In the GGE, the equilibrium state of a system with Hamiltonian $$\hat H$$ is given by a density matrix of the form

$$\hat \rho _{{\mathrm{GGE}}} = \frac{1}{{\cal Z}}{\mathrm{exp}}\left( { - \beta \hat H - \mathop {\sum}\limits_{k = 1}^{\cal N} {\kern 1pt} \beta _k\hat M_k} \right),$$
(1)

where $${\cal Z} \equiv {\cal Z}\left( {\vec \beta ,\hat H,\left\{ {\hat M_k} \right\}} \right)$$ = $${\mathrm{Tr}}\left[ {{\mathrm{exp}}\left( { - \beta \hat H - \mathop {\sum}\nolimits_k \beta _k\hat M_k} \right)} \right]$$ is the partition function, and the operators associated with the charges, $$\hat M_k$$, satisfy $$\left[ {\hat M_k,\hat H} \right] = 0$$, for k = 1, …, $${\cal N}$$, with $${\cal N}$$ the number of charges of the system, see Fig. 1a. (Below, we will assume the charge operators commute with each other, which enables measuring them simultaneously.) The generalised inverse temperatures, $$\vec \beta = \left( {\beta ,\left\{ {\beta _k} \right\}_{k = 1}^{\cal N}} \right)$$, are fixed by requiring that averages over $$\hat \rho _{{\mathrm{GGE}}}$$ reproduce the known average values of the energy, $$\left\langle {\hat H} \right\rangle \equiv {\mathrm{Tr}}\left[ {\hat H\hat \rho _{{\mathrm{GGE}}}} \right] = \overline E$$, and charges, $$\left\langle {\hat M_k} \right\rangle = \overline M _k$$. A crucial open question springing from Eq. (1) is the identification of all charges $$\hat M_k$$ relevant to the dynamics of the system. The usual approach consists in the study of equilibrium expectation values of certain observables. However, this approach suffers from a number of caveats and difficulties, like the very need of measuring a large number of observables, or the existence of particular observables that may not thermalise (see Supplementary Note 1 for more details). We show below that measurements in non-equilibrium processes are highly sensitive to the existence of charges, and how one can use them to reveal the presence of conserved quantities in the equilibrium state.

### Generalised QFRs

We study the energy fluctuations of a system with charges by considering two processes (forward (FW) and backward (BW)) that take the system away from initial equilibrium states (Fig. 1a). Each process is a four-step protocol similar to the two-projective-measurement (TPM) protocol utilised to derive the standard QFRs28.

In the FW process, the system is (i) prepared in the equilibrium state corresponding to Hamiltonian $$\hat H$$. If this Hamiltonian features a number $${\cal N}$$ of charges, this state can be written in the form of Eq. (1) with $${\cal N}$$ + 1 parameters $$\vec \beta$$ = {β, β1, …, $$\beta _{\cal N}$$}. We build a basis of the Hilbert space with eigenvectors $$\left| {\vec i} \right\rangle$$ = $$\left| {i_0,i_1, \ldots ,i_{\cal N},\eta } \right\rangle$$, where the quantum number i0 identifies the energy eigenvalue, $$\hat H\left| {\vec i} \right\rangle = E_{i_0}\left| {\vec i} \right\rangle$$, and i k similarly labels the eigenvalues of $$\hat M_k$$ through $$\hat M_k\left| {\vec i} \right\rangle = M_{k,i_k}\left| {\vec i} \right\rangle$$ (k = 1, …, $${\cal N}$$); η contains the additional quantum numbers required to fully determine a basis state. After this preparation stage, (ii) at time t = 0 one performs simultaneous projective measurements of $$\hat H$$ and $$\hat M_k$$ on the system, obtaining definite values for its energy, $${\cal E}_{{\mathrm{ini}}}$$ {E i }, and the other observables, $${\cal M}_{k,{\mathrm{ini}}} \in \left\{ {M_{k,i_k}} \right\}$$. (iii) In the third step, the system is driven out of equilibrium by steering its Hamiltonian in a time-dependent process, $$\hat H \mapsto \hat H(t)$$, for times 0 < t < τ. This defines a unitary time-evolution operator $$\hat U(t)$$ as the solution of $$i\hbar \partial _t\hat U(t) = \hat H(t)\hat U(t)$$, with $$\hat U(0) = {\Bbb I}$$, the identity operator on the system’s Hilbert space $${\cal H}$$. Finally, (iv) at time t = τ, the system is projected on the eigenbasis of the instantaneous Hamiltonian, $$\hat H\prime = \hat H(\tau )$$. In general, the operators $$\hat M_k$$ will not commute with $$\hat H(t)$$ for t > 0, and we denote the set of charges that commute with $$\hat H\prime$$ as $$\left\{ {\hat M_l ' } \right\}$$(l = 1, …, $${\cal N}\prime$$). Assuming that these operators commute with each other, this second projective measurement provides the quantities $${\cal E}_{{\mathrm{fin}}}\hskip -0.7pc \prime$$ and $$\left\{ {{\cal M}'_{l,{\mathrm{fin}}} } \right\}$$, each belonging to the spectrum of the corresponding operator, in full analogy to the situation at t = 0. Thus, at the end of a single realisation of the FW process, one has collected the data set $${\cal D}_{{\mathrm{FW}}}$$ = $$\left\{ {{\cal E}_{{\mathrm{ini}}},\left\{ {{\cal M}_{k,{\mathrm{ini}}}} \right\};{\cal E}_{{\mathrm{fin}}}' ,\left\{ {{\cal M}_{l,{\mathrm{fin}}}' } \right\}} \right\}$$ associated to the parameters $$\vec \beta$$ of the initial state Eq. (1).

The complementary BW process starts by preparing the system in an equilibrium state of the Hamiltonian $$\hat H\prime$$ (Fig. 1a). In accordance with the preceding discussion, this state will be of the GGE form with $${\cal N}\prime$$ + 1 parameters, $$\vec \beta \prime$$ = $$\left\{ {\beta ' ,\beta _1' , \ldots ,\beta _{{\cal N}\prime }' } \right\}$$. At time t = 0, the system is projected on the basis $$\left| {\vec f\prime } \right\rangle$$ of simultaneous eigenvectors of $$\hat H\prime$$ and $$\hat M_l^\prime$$, obtaining the values $${\cal E}_{{\mathrm{ini}}}'$$ and $$\left\{ {{\cal M}_{l,{\mathrm{ini}}}' } \right\}$$ for the corresponding observables. The system then evolves under the time-reversed protocol $$\hat U^{ - 1}(t)$$ for 0 < t < τ, so that at time τ its Hamiltonian is $$\hat H$$. A projective measurement on the final instantaneous eigenbasis provides values $${\cal E}_{{\mathrm{fin}}}$$ and $$\left\{ {{\cal M}_{k,{\mathrm{fin}}}} \right\}$$ for the energy and other observables. A single realisation of the BW protocol thus gives a data set $${\cal D}_{{\mathrm{BW}}}$$ = $$\left\{ {{\cal E}_{{\mathrm{ini}}}' ,\left\{ {{\cal M}_{l,{\mathrm{ini}}}' } \right\};{\cal E}_{{\mathrm{fin}}},\left\{ {{\cal M}_{k,{\mathrm{fin}}}} \right\}} \right\}$$ associated to the parameters $$\vec \beta \prime$$ of the BW initial state.

With the data sets $${\cal D}_{{\mathrm{FW}}}$$ and $${\cal D}_{{\mathrm{BW}}}$$ we build two (dimensionless) work-like quantities

$${\cal W}_{{\mathrm{FW}}} \equiv \beta {'}{\cal E}_{{\mathrm{fin}}}' + \mathop {\sum}\limits_{l = 1}^{{\cal N}\prime } {\kern 1pt} \beta _l' {\cal M}_{l,{\mathrm{fin}}}' - \left[ {\beta {\cal E}_{{\mathrm{ini}}} + \mathop {\sum}\limits_{k = 1}^{\cal N} {\kern 1pt} \beta _k{\kern 1pt} {\cal M}_{k,{\mathrm{ini}}}} \right],$$
(2)
$${\cal W}_{{\mathrm{BW}}} \equiv \beta {\cal E}_{{\mathrm{fin}}} + \mathop {\sum}\limits_{k = 1}^{\cal N} {\kern 1pt} \beta _k{\cal M}_{k,{\mathrm{fin}}} - \left[ {\beta {'}{\cal E}_{{\mathrm{ini}}}' + \mathop {\sum}\limits_{l = 1}^{{\cal N}\prime } {\kern 1pt} \beta _l' {\cal M}_{l,{\mathrm{ini}}}' } \right].$$
(3)

Due to the projective nature of the measurements, both these quantities are stochastic variables, and their statistics can be described through probability distribution functions (PDFs), $${\cal P}_{{\mathrm{FW}}}$$ and $${\cal P}_{{\mathrm{BW}}}$$, associated respectively to the FW and BW processes. We find that although the initial states of the two processes are independent, and may feature different numbers of charges and generalised inverse temperatures, these PDFs are not independent, but obey the following relation (see Methods):

$$\frac{{{\cal P}_{{\mathrm{FW}}}({\cal W})}}{{{\cal P}_{{\mathrm{BW}}}( - {\cal W})}}e^{ - {\cal W}} = \frac{{{\cal Z}' }}{{\cal Z}},$$
(4)

where $${\cal Z}\prime$$ = $${\cal Z}\left( {\vec \beta \prime ,\hat H\prime ,\left\{ {\hat M_l^\prime } \right\}} \right)$$ is the equilibrium partition function of the initial state of the BW process. By introducing (dimensionless) generalised free energy functions as $${\cal F}$$ = −ln $${\cal Z}$$ and $${\cal F}\prime$$ = −ln $${\cal Z}\prime$$, the right-hand side (r.h.s.) of Eq. (4) becomes exp($${\cal W}$$ − Δ$${\cal F}$$), with Δ$${\cal F}$$ = $${\cal F}\prime$$ − $${\cal F}$$. Equation (4) is the generalisation of the TCR to systems with arbitrary numbers of charges associated to each equilibrium state, and to out-of-equilibrium processes that change the number of charges.

If we multiply both sides of Eq. (4) by $${\cal P}_{{\mathrm{BW}}}$$(−$${\cal W}$$) and integrate over $${\cal W}$$, we get

$$\left\langle {\left\langle {e^{ - {\cal W}}} \right\rangle } \right\rangle _{{\mathrm{FW}}} \equiv {\int}_{ - \infty }^\infty {\kern 1pt} {\mathrm{d}}{\cal W}{\kern 1pt} {\cal P}_{{\mathrm{FW}}}({\cal W})e^{ - {\cal W}} = e^{ - \Delta {\cal F}},$$
(5)

which is a generalisation of the QJE for systems with charges. Here we remark a qualitative difference between Eqs. (4) and (5). While the TCR relates the outcomes of driving processes starting in two different initial states, the QJE applies to a single system driven out of an equilibrium characterised by parameters $$\vec \beta$$. The apparent dependence on $$\vec \beta \prime$$ of Eq. (5) in fact shows that this equation relates an initial equilibrium state to all possible GGE-like states of the final Hamiltonian: for each possible set of ‘final’ equilibrium parameters $$\vec \beta \prime$$, the numerical values on the left-hand side (l.h.s.) and the r.h.s. of Eq. (5) will differ, but the equality will hold as long as the initial state is of the GGE form, Eq. (1). In this sense, the $$\vec \beta \prime$$ dependence in Eq. (5) is irrelevant, and one can test its validity taking, e.g., $$\vec \beta \prime = \vec \beta$$. This agrees with the intuition that by driving the system out of equilibrium we can obtain information on its initial equilibrium state (i.e., $$\vec \beta$$), but we cannot give physical meaning to the values of $$\vec \beta \prime$$ in Eq. (5). (The physics of Eqs. (4) and (5) is further discussed in Supplementary Note 2.)

More generally, consider the following scenario in which one of the constants of motion, say $$\hat M_m$$, commutes with the time-dependent Hamiltonian and with all the other charges at all times. Then, the time-dependent Hamiltonian can be set in a block-diagonal form, with different blocks corresponding to the different eigenvalues of this operator, and the values of $$\hat M_m$$ measured at the start and end of the TPM protocol must be identical. In this case, let us introduce a marginal generalised work $${\cal W}_m$$ by $${\cal W}_m \equiv \beta {\prime}{\cal E}_{{\mathrm{fin}}}$$ + $$\mathop {\sum}\nolimits_{l \ne m} {\kern 1pt} \beta _l' {\cal M}_{l,{\mathrm{fin}}}'$$ − $$\left( {\beta {\cal E}_{{\mathrm{ini}}} + \mathop {\sum}\nolimits_{k \ne m} {\kern 1pt} \beta _k{\cal M}_{k,{\mathrm{ini}}}} \right)$$. The corresponding PDF, $${\cal P}_{{\mathrm{FW}}}^{(m)}({\cal W}_m)$$, satisfies a marginal version of the generalised TCR (see Methods):

$$\frac{{{\cal P}_{{\mathrm{FW}}}^{(m)}({\cal W}_m)}}{{{\cal P}_{{\mathrm{BW}}}^{(m)}( - {\cal W}_m)}}e^{ - {\cal W}_m} = e^{ - {\mathrm{\Delta }}{\cal F}}.$$
(6)

We show below how this result can be used to check whether a particular observable does or does not change in a non-equilibrium process without measuring it.

### Revealing missing charges

We now discuss how Eqs. (4)–(6) underlie novel strategies for two applications: (i) to reveal hidden conserved charges, and (ii) to check whether a particular observable of difficult experimental access does or does not change during a quantum non-equilibrium protocol. Next, we will illustrate this in practice through numerical studies of a trapped-ion quantum simulator.

The key realisation is that the r.h.s. of Eqs. (4)–(6) is determined solely by equilibrium properties pertaining to the initial states of the FW and BW processes, respectively, while the l.h.s. relates to measurement outcomes of non-equilibrium processes starting from those initial states, obtained via the TPM protocol. We can then check the completeness of the set of known charges by running the TPM protocol with a number, $${\cal N}_{{\mathrm{prot}}}$$, of different protocols $$\hat U$$ (corresponding, for instance, to different durations τ). The experimental data corresponding to the $${\cal N}_{{\mathrm{prot}}}$$ protocols provide different values for the l.h.s. of the generalised QJE, Eq. (5). As discussed above, these values depend physically on the $${\cal N}$$ + 1 parameters $$\vec \beta$$ of the initial GGE state. The fact that all these expressions must equal the same single value on the r.h.s. entails a set of $${\cal N}_{{\mathrm{prot}}}$$ (non-linear) equations for $${\cal N}$$ + 1 unknowns. If we can find values for $$\vec \beta$$ that satisfy these equations, then we have accounted for all the charges required to describe the non-equilibrium dynamics of the system induced by $$\hat U$$; on the other hand, failure to find a satisfactory set of parameters points that more charges need to be included. A similar argument can be made based on the generalised TCR (4), to check whether all the charges in both FW and BW initial states have been accounted for. (Generally, the TCR depends on the $${\cal N}$$ + $${\cal N}\prime$$ + 2 parameters $$\left\{ {\vec \beta ,\vec \beta \prime } \right\}$$ characterising the FW and BW initial states. In practice, the number of required experiments can be notably reduced, e.g., by putting the system in contact with the same bath at the start of both FW and BW processes, so that $$\vec \beta = \vec \beta \prime$$, in which case only $${\cal N}$$ + 1 unknowns need to be determined.) We note in addition that these completeness tests do not require prior knowledge of the inverse temperatures characterising the initial states; however, if we do have a reliable preliminary estimate of the inverse temperatures, this test allows to verify this estimate, or to conclude that the number of known charges is insufficient as soon as inconsistencies with Eqs. (4) and (5) emerge.

As a complement, Eq. (6) enables us to assess whether an operator that is known to commute with a Hamiltonian $$\hat H$$ does, or does not, change in a non-equilibrium procedure without measuring it, i.e., it enables to determine whether a non-equilibrium procedure transforms a charge into a dynamical variable. To see this, let us imagine that we are interested to know whether a certain observable of difficult experimental access, $$\hat M_m$$, is or not perturbed by a certain class of non-equilibrium protocols. To assess this, we perform a set of FW and BW protocols, excluding $$\hat M_m$$ from the TPM measurements, and calculate the marginal work $${\cal W}_m$$. With these values, we build the associated PDFs, $${\cal P}_{{\mathrm{FW}}}^{(m)}$$ and $${\cal P}_{{\mathrm{BW}}}^{(m)}$$. If we can find values of $$\vec \beta$$ and $$\vec \beta \prime$$ without β m such that the r.h.s. of Eq. (6) matches the data on the l.h.s., then the contributions of $$\hat M_m$$ to $${\cal F}$$ and $${\cal F}\prime$$ must cancel one another in Δ$${\cal F}$$, i.e., $$\hat M_m$$ has remained constant throughout the process. Otherwise, $$\hat M_m$$ cannot have the same value at the start and end of the protocol, i.e., $$\hat M_m$$ is a dynamical variable in the process.

### Application to a trapped-ion quantum simulator

Our generalised QFRs are valid for arbitrary unitary non-equilibrium processes, $$\hat U$$, applied to quantum systems with conserved quantities16,29,30,31. In the following, we illustrate their implications in the context of a trapped-ion experiment realisable with current technology32,33,34,35. First, we show that this system can be described by a Hamiltonian with a single charge. We then report numerical evidence showing how measurements of its work statistics in generic non-equilibrium protocols would violate the standard QJE and TCR—and how they agree with the predictions of our generalised QFRs. The fact that this model features a single charge makes it an especially attractive test ground, as this makes experimental tests of our generalised QFRs far more accessible than other models that would in principle require measurements on an infinite number of charges, such as the XXZ model.

We consider N 43Ca+ ions in an ion trap32,33 (Fig. 1b). Each ion can be described as a two-level system with internal states corresponding to two Zeeman levels within the ground 2S1/2 electronic state, whose energy splitting, ħωat, can be controlled by an external bias magnetic field32,33. The motional state of the ions in the trap is characterised by N − 1 collective modes in each direction36. Among these, we focus on the centre-of-mass (COM) mode, which couples identically to all ions and whose eigenfrequency, ω COM , is of the order of the trap’s oscillator frequency36. Internal and motional states can be coupled by light fields of frequency ω close to ω± = ωat ± ωCOM, the blue (+) and red (−) motional sidebands. The Hamiltonian describing the dynamics of this system can be written in the form (see Methods and refs.35,37,38,39)

$$H{\mathrm{/}}\hbar = \omega _{{\mathrm{COM}}}\hat b^\dagger \hat b + \omega _{{\mathrm{at}}}\hat J_z \\ + \frac{{2g}}{{\sqrt N }}\left[ {(1 - \alpha )\left( {\hat J_ + \hat b + \hat J_ - \hat b^\dagger } \right) + \alpha \left( {\hat J_ + \hat b^\dagger + \hat J_ - \hat b} \right)} \right]$$
(7)

where $$\hat b^\dagger$$ and $$\hat b$$ are the operators creating and annihilating excitations in the COM mode, and $$\hat J_s$$ (s = z, +, −) are Schwinger spin operators describing the internal state of all the ions, with J = N/2. In Eq. (7) we have introduced g = (Ωrsb + Ωbsb)/2 and α = Ωbsb/(Ωrsb + Ωbsb), with Ωbsb(rsb) the Rabi frequency characterising the coupling of internal and motional states through the first blue (red) motional sideband; these are functions of the light intensity at frequency ω±, respectively35,36. The Hamiltonian Eq. (7) is exactly that of the Dicke model13,14. For α = 0, it reduces to the Tavis–Cummings model, which is integrable and has an additional conserved quantity, $$\hat M = \hat J + \hat J_z + \hat b^\dagger \hat b$$ (see Methods and Supplementary Note 3). Thus, the dynamics of this system starting from an equilibrium state will be governed by our generalised QFRs. This can be verified by extending the filtering method34,40 used to verify the standard QJE34, to account for the internal structure of the ions in the Dicke model, so as to determine the initial and final energy values; indeed, as the spectrum of the Dicke model is non-degenerate, an energy measurement provides both $${\cal E}$$ and $${\cal M}$$. Additionally, the PDF of standard work can be obtained without projective measurements by utilising an ancilla qubit41,42,43.

In order to assess the existence of charges, we drive the system out of equilibrium. For simplicity, we consider a series of sudden quenches in space {g, α}; experimentally, these quenches correspond to changes in the intensities of the lasers realising the sideband couplings on a timescale much shorter than $$\omega _{{\mathrm{COM}}}^{ - 1}$$. We consider in particular the FW protocol {gini, 0} → {gint, 1/2} → {gfin, 0}, with the system remaining in the intermediate stage for a variable time τ (Fig. 1c); this duration plays the role of the parameter τ characterising the $${\cal N}_{{\mathrm{prot}}}$$ protocols in the procedure to reveal missing charges described above.

The choice α = 0 at t {0, τ} ensures that $$\hat M$$ commutes with both $$\hat H$$ and $$\hat H\prime$$. Hence, the initial equilibrium state of FW and BW processes will be of the GGE form with specific values for the inverse temperatures related to $$\hat H$$ and $$\hat M$$, which we label β and β M (for concreteness, we analyse here the case that $$\vec \beta \prime = \vec \beta$$; see Supplementary Note 2 for a discussion on this choice). However, in the intermediate stages α = 1/2, which implies that there are no charges during an important part of the process. We will see that it is nevertheless possible to determine whether the system had a conserved quantity at the start of the process. (Additional simulations in Supplementary Note 4 for a process ending in α = 1/2, i.e., where $$\hat M$$ and $$\hat H\prime$$ do not commute, support analogous conclusions, see Supplementary Fig. 1.)

We show in Fig. 2a the average exponentiated work performed on the system by a FW process as a function of duration τ. We compare the results using standard work, $$\left\langle {\left\langle {{\mathrm{exp}}\left( { - \beta _w} \right)} \right\rangle } \right\rangle _{{\mathrm{FW}}}$$, to those with generalised work $$\left\langle {\left\langle {{\mathrm{exp}}\left( { - {\cal W}} \right)} \right\rangle } \right\rangle _{{\mathrm{FW}}}$$. We see that the standard work average varies by up to 40% for durations τ 0.1 μs. This τ dependence indicates that the standard work is no longer the relevant magnitude in non-equilibrium processes: there is one (or more) missing charge(s) whose fluctuations need to be taken into account to describe the measurement outcomes. In contrast to this, the average of generalised work including $$\hat M$$ remains constant for all τ; it thus follows from Eq. (5) that this definition of $${\cal W}$$ includes all the relevant charges of the system.

Notably, the two averages agree with each other for short processes, τ < 0.1 μs. This reflects that, at short times, $$\hat M$$ remains approximately constant and a marginal TCR is expected to hold. Importantly, however, both averages agree with the prediction of the generalised QFRs, i.e., exp(−Δ$${\cal F}$$), while the expectation that excludes $$\beta _M\hat M$$ (dashed line) is off by 20%. In practice, this means that a nave fit of the $$\left\langle {\left\langle {{\mathrm{exp}}\left( { - \beta _w} \right)} \right\rangle } \right\rangle$$ data to exp (−βΔF) would yield a biased value for β, i.e., a wrong estimate of the initial temperature of the system. Generally, use of the standard QFRs will provide biased estimates if the system has charges. Figure 2b support analogous conclusions for the case β M  < 0.

The relevance of charge fluctuations in the non-equilibrium dynamics becomes apparent in Fig. 2c–f, which portray the statistics of standard and generalised work under driving protocols with τ = 1 μs. In Fig. 2c, d we observe that scaling the PDF of standard work for the BW process by exp[β(w − ΔF)] (diamonds) does not agree with the PDF of the FW process (bars), in contrast to the prediction of the standard TCR. Such a disagreement is a strong indication of the existence of charges in a system. On the other hand, the prediction of the generalised TCR, Eq. (4), is satisfied with great accuracy for both β M  > 0 [Fig. 2e] and β M  < 0 (Fig. 2f). In other words, the TCR equality is only fulfilled when all relevant charges are included in the calculations of $${\cal W}$$ and Δ$${\cal F}$$, and a discrepancy between the measurable quantities $${\cal P}_{{\mathrm{FW}}}$$($${\cal W}$$) and $${\cal P}_{{\mathrm{BW}}}$$($${\cal W}$$) exp($${\cal W}$$ − Δ$${\cal F}$$) points to the existence of hidden charges that need to be included.

## Discussion

Our findings extend the foundations of quantum thermodynamics with charges44,45,46,47,48 to non-equilibrium processes with various (generalised) baths and/or that break one or more conservation laws, while they revert to the standard QFRs in the case that the Hamiltonian is the only conserved quantity ($${\cal N}$$ = $${\cal N}\prime$$ = 0) and both processes start at the same inverse temperature, β′ = β. In this case, $${\cal W}_{{\mathrm{BW}}}$$ = −$${\cal W}_{{\mathrm{FW}}}$$ = −βw and Eq. (4) becomes the standard TCR21 with the standard free energy F = −β−1 ln $${\cal Z}$$. In the same conditions, Eq. (5) recovers the standard QJE22,23,24. In addition, if $${\cal N}$$ = $${\cal N}\prime$$ and $$\vec \beta = \vec \beta \prime$$, Eq. (4) reduces to the version of the TCR for GGEs derived in ref. 44 under the assumption of continuity of the charges during the driving protocols.

Our numerical results in Fig. 2a–d highlight the limitations of the standard QFRs in dealing with systems with charges, in particular in order to extract equilibrium properties by means of non-equilibrium measurements41,42,43,49,50. Our generalised QFRs, Eqs. (4) and (5), provide the robust theoretical basis necessary to do that, as evidenced by the exquisite agreement of our numerical simulations with their predictions (Fig. 2a, b, e, f).

The framework informed by the approach based on our QFRs is of general applicability to quantum many-body systems. In particular, our protocol to reveal the existence of charges enables one to uncover more general charges than those related to transport properties and governed by the Mazur bound17,18,19,20,51, as illustrated by our analysis of the Dicke model. Ongoing developments in several physical platforms—e.g., trapped ions32,33,34,35 and superconducting circuits52,53—readily enable precise experimental investigations of this model, which will further inform the development of tools to study non-equilibrium quantum dynamics, and its exploitation in practical tasks54,55. We remark as well the possibility of simultaneously revealing new charges and determining the associated (equilibrium) inverse temperatures borne in our protocol.

An important question that remains open is how to determine the exact form of the charge operators. Indeed, their intimate dependence on the associated Hamiltonian makes it hard to give a general prescription. Still, we conjecture that a strategy based on analysing the behaviour of different candidate operators under various driving protocols by means of the marginal TCR, Eq. (6), will illuminate the exact form of the charges. This possibility, which lies beyond the scope of this work, will be explored in the future.

These findings will be relevant to fundamental studies on relaxation and thermalisation of quantum systems56,57,58, and to the advance of quantum simulation and quantum probing protocols that exploit QFRs41,42,43,49,50. Our results extend the foundations of quantum thermodynamics with charges44,45,46,47,48 to non-equilibrium processes with various (generalised) baths and/or that break one or more conservation laws, while they revert to the standard QFRs in the case that the Hamiltonian is the only conserved quantity ($${\cal N}$$ = $${\cal N}\prime$$ = 0) and both processes start at the same inverse temperature, β′ = β. In this case, $${\cal W}_{{\mathrm{BW}}}$$ = −$${\cal W}_{{\mathrm{FW}}}$$ = −βw and Eq. (4) becomes the standard TCR21 with the standard free energy F = −β−1 ln $${\cal Z}$$. In the same conditions, Eq. (5) recovers the standard QJE22,23,24. In addition, if $${\cal N}$$ = $${\cal N}\prime$$ and $$\vec \beta = \vec \beta \prime$$, Eq. (4) reduces to the version of the TCR for GGEs derived in ref. 44 under the assumption of continuity of the charges during the driving protocols.

We further remark that our QFRs do not assume any particular relationship between the sets of observables that commute with $$\hat H$$ and $$\hat H\prime$$; in particular, we do not assume continuity between these sets44; this is important, as frequently even a small perturbation of a Hamiltonian transforms its charges into dynamical quantities. Thus, our generalised QFRs enable us to study a larger class of non-equilibrium processes, such as cyclic processes that include an intermediate thermalisation step where the system remains isolated and thus equilibrates to a GGE whose generalised temperatures are not fixed beforehand (see Supplementary Note 2 for more details). This opens the door to studying the thermalisation of an integrable system when perturbed away from integrability16,30,59. We thus expect our work will contribute to illuminate open fundamental questions on thermalisation, localisation and ergodicity, especially in the presence of integrals of motion60,61,62,63,64. Besides, due to the enhanced role of fluctuations in small systems, we expect our work will contribute to a better understanding and improved design of new micro- and nanometre-sized devices where the interplay of thermal and quantum effects is paramount54,65,66, and thus to address questions related to cyclic protocols and the efficiency of quantum heat engines54,55, thermometry of strongly correlated systems at ultra-low temperatures49,67 and novel quantum sensing applications based on quantum information theory and quantum thermodynamics50,68,69.

In summary, we have derived a set of generalised QFRs relevant to unitary non-equilibrium processes starting from states of the GGE, which correspond to equilibrium states of quantum system with charges. Based on these generalised QFRs, we have proposed a general method to address the question of identifying all charges relevant to the non-equilibrium dynamics of a quantum system17,18,19,51. We provided robust numerical evidence of the measurable impact that these theoretical findings can have in current studies with quantum simulators; in particular, we highlighted the importance of identifying all conserved charges to obtain unbiased estimates of their equilibrium properties, such as the temperature, through non-equilibrium measurements41,42,43,49. In addition, we put forward a scheme to determine whether an integral of motion is affected by a class of non-equilibrium processes, without measuring it.

## Methods

### Derivation of the generalised QFRs

To derive the TCR (4), let us introduce the shorthand notations $${\cal A}_{\vec i} = \beta E_{i_0} + \mathop {\sum}\nolimits_k {\kern 1pt} \beta _kM_{k,i_k}$$ and $${\cal A}_{\vec f}^\prime = \beta \prime E_{f_0}^\prime + \mathop {\sum}\nolimits_l {\kern 1pt} \beta _l' M_{l,f_l}'$$, with $$\left| {\vec i} \right\rangle$$ = $$\left| {i_0, \ldots ,i_{\cal N},\eta } \right\rangle$$ and $$\left| {\vec f\prime } \right\rangle$$ = $$\left| {f_0, \ldots ,i_{{\cal N}\prime },\eta \prime } \right\rangle$$. Then, the probability that a realisation of the protocol requires an amount $${\cal W}$$ of generalised work (2) reads

$${\cal P}_{{\mathrm{FW}}}({\cal W}) \equiv {\sum} _{\vec i,\vec f}{\kern 1pt} p_{\vec i}\pi _{\vec i \to \vec f}(\hat U)\delta \left[ {{\cal W} - \left( {{\cal A}\prime - {\cal A}} \right)} \right],$$
(8)

Here $$p_{\vec i} = {\mathrm{exp}}\left( { - {\cal A}_{\vec i}} \right){\mathrm{/}}{\cal Z}$$, $${\cal Z} = \mathop {\sum}\nolimits_{\vec i} {\kern 1pt} {\mathrm{exp}}\left( { - {\cal A}_{\vec i}} \right)$$, is the probability to find the system in state $$\left| {\vec i} \right\rangle$$ in the first projective measurement at t = 0, and $$\pi _{\vec i \to \vec f}\left( {\hat U} \right) = \left| {\left\langle {\vec f\prime } \right|\hat U\left| {\vec i} \right\rangle } \right|^2$$ is the probability that the system initially in state $$\left| {\vec i} \right\rangle$$ is found in state $$\left| {\vec f\prime } \right\rangle$$ after the protocol $$\hat U$$; finally, δ(0) = 1 and otherwise δ(x) = 0. The PDF (8) can be rewritten as

$$\begin{array}{l}{\cal P}_{{\mathrm{FW}}}({\cal W}) = \\ = {\sum} _{\vec i,\vec f}{\kern 1pt} \frac{{{\mathrm{exp}}\left( { - {\cal A}_{\vec i}} \right)}}{{\cal Z}}\left| {\left\langle {\vec f\prime } \right|U\left| {\vec i} \right\rangle } \right|^2\delta \left[ {{\cal W} - \left( {{\cal A}_{\vec f}^\prime - {\cal A}_{\vec i}} \right)} \right]\\ = {\sum} _{\vec i,\vec f}{\kern 1pt} \frac{{{\mathrm{exp}}\left( {{\cal W} - {\cal A}_{\vec f}^\prime } \right)}}{{\cal Z}}\left| {\left\langle {\vec f\prime } \right|U\left| {\vec i} \right\rangle } \right|^2\delta \left[ {{\cal W} - \left( {{\cal A}_{\vec f}^\prime - {\cal A}_{\vec i}} \right)} \right]\\ = \frac{{{\cal Z}\prime }}{{\cal Z}}{\sum} _{\vec i,\vec f}{\kern 1pt} \frac{{{\mathrm{exp}}\left( {{\cal W} - {\cal A}_{\vec f}^\prime } \right)}}{{{\cal Z}\prime }}\left| {\left\langle {\vec i} \right|U^{ - 1}\left| {\vec f\prime } \right\rangle } \right|^2\delta \left[ {{\cal W} + \left( {{\cal A}_{\vec i} - {\cal A}_{\vec f}^\prime } \right)} \right]\\ \equiv \frac{{{\cal Z}\prime }}{{\cal Z}}e^{\cal W}{\cal P}_{{\mathrm{BW}}}( - {\cal W}).\end{array}$$
(9)

In the first step we substituted $$p_{\vec i}$$ and $$\pi _{\vec i \to \vec f}$$, in the third step we applied that $$\hat U$$ is unitary and in the last step we identified the PDF corresponding to the time-reversed process. This completes the proof of Eq. (4), from which the generalised QJE (5) follows as discussed in the main text. The PDFs of standard (dimensionful) work, $$w = {\cal E}_{{\mathrm{fin}}}^\prime - {\cal E}_{{\mathrm{ini}}}$$, shown in Fig. 2, are defined analogously, e.g., $$P_{{\mathrm{FW}}}(w)$$ = $$\mathop {\sum}\nolimits_{\vec i,\vec f} {\kern 1pt} p_{\vec i}\pi _{\vec i \to \vec f}\delta \left[ {w - \left( {{\cal E}_{{\mathrm{fin}}}^\prime - {\cal E}_{{\mathrm{ini}}}} \right)} \right]$$, which follows from the standard situation with the same equilibrium conditions at the start of FW and BW processes, β′ = β. Finally, the marginal TCR (6) is derived in a manner analogous to (9) by defining the PDF of marginal work as $${\cal P}_{{\mathrm{FW}}}^{(m)}\left( {{\cal W}_m = x} \right)$$ ≡ $$\mathop {\sum}\nolimits_{\vec i,\vec f} {\kern 1pt} p_{\vec i}\pi _{\vec i \to \vec f}\delta \left[ {x - \left( {{\cal A}_f^{\prime (m)} - {\cal A}_{\vec i}^{(m)}} \right)} \right]$$ with $${\cal A}_{\vec i}^{(m)}$$ = $$\beta {\cal E}_{{\mathrm{ini}}} + \mathop {\sum}\nolimits_{k \ne m}^N {\kern 1pt} \beta _k{\cal M}_{k,{\mathrm{ini}}}$$ and $${\cal A}_{\vec f}^{\prime (m)}$$ = $$\beta \prime {\cal E}_{{\mathrm{fin}}}^\prime + \mathop {\sum}\nolimits_{l \ne m}^{{\cal N}\prime } {\kern 1pt} \beta _l^\prime M_{l,{\mathrm{fin}}}^\prime$$.

We remark that the fundamental assumptions underlying our generalised QFRs are (i) that the state of the system at the start of both FW and BW processes is of the GGE form, and (ii) the the corresponding driving protocols are time-reversed of each other.

### Dicke model with trapped ions

Consider N ions in an ion trap36. Each ion can be described as a two-level system (qubit) with internal states $$\left\{ {\left| \uparrow \right\rangle ,\left| \downarrow \right\rangle } \right\}$$ corresponding to two Zeeman levels within the ground 2S1/2 electronic state. Their energy splitting can be controlled by an external magnetic field, B, as ħωat = ΔμB, where Δμ is the difference in magnetic moments of the two internal states32, 33. The motional state of the ions in the trap is characterised by N − 1 collective modes in each direction36. Among these, the COM mode, with eigenfrequency ωCOM, is characterised by coupling identically to all ions. Internal and motional states can be coupled by radiation of frequency ω close to ωat ± ωCOM, the blue (red) motional sideband36.

The complete Hamiltonian describing the dynamics of the system reads H = H0 + HJC + HaJC with H0 = $$\hbar \omega _{{\mathrm{COM}}}\left( {\hat b^\dagger \hat b + 1{\mathrm{/}}2} \right)$$ + $$\mathop {\sum}\nolimits_{l = 1}^N {\kern 1pt} \hbar \omega _{{\mathrm{at}}}\sigma _z^{(l)}$$, where $$\hat b^\dagger$$ and $$\hat b$$ are the operators creating and annihilating excitations (phonons) in the COM mode and $$\sigma _z^{(l)}$$ = $$\left| \uparrow \right\rangle _{(l)}\left\langle \uparrow \right| - \left| \downarrow \right\rangle _{(l)}\left\langle \downarrow \right|$$ is the Pauli z operator for ion l = 1, …, N. The coupling between the ions’ internal state and the COM mode mediated by radiation is given by the Jaynes–Cummings (JC) and anti-JC Hamiltonians, HJC = $$\mathop {\sum}\nolimits_{l = 1}^N \left( {\hat b\sigma _ + ^{(l)} + \hat b^\dagger \sigma _ - ^{(l)}} \right)\hbar { {\Omega }}_{{\mathrm{rsb}}}{\mathrm{/}}2$$ and HaJC = $$\mathop {\sum}\nolimits_{l = 1}^N \left( {\hat b^\dagger \sigma _ + ^{(l)} + \hat b\sigma _ - ^{(l)}} \right)\hbar { {\Omega }}_{{\mathrm{bsb}}}{\mathrm{/}}2$$, with the raising (lowering) operators $$\sigma _ + ^{(l)} = \left| \uparrow \right\rangle _{(l)}\left\langle \downarrow \right|$$ and $$\sigma _ - ^{(l)} = \left[ {\sigma _ + ^{(l)}} \right]^\dagger$$. Ωbsb(rsb) is the Rabi frequency of the blue (red) motional sideband36.

The internal quantum state of a single ion can be mapped onto an effective spin-1/2 system. The full quantum state of the ions in the trap can then be expressed in the basis $$\left| {J,J_z,n} \right\rangle$$ = $$\left| {J,J_z} \right\rangle \otimes \left| n \right\rangle$$, where $$\left| n \right\rangle$$ is the Fock state with n = 0, 1, 2,… excitations in the COM mode, and $$\left| {J,J_z} \right\rangle$$ is an eigenstate of the collective Schwinger pseudo-spins $$\hat J_s = \mathop {\sum}\nolimits_{l = 1}^N {\kern 1pt} \sigma _s^{(l)}$$ (s = z, +, −), with J = N/2 and J z  = −J, −J + 1, …, J. Using the collective pseudo-spins and dropping constant terms, the Hamiltonian H can be conveniently rewritten as Eq. (7), with the coupling parameters given in terms of the Rabi frequencies within HJC and HaJC by g = (Ωrsb + Ωbsb)/2 and α = Ωbsb/(Ωrsb + Ωbsb).

### Numerical calculations

We solve the time evolution of the system with N = 7 ions by exact propagation with the full interacting Hamiltonian expressed in the basis of eigenstates $$\left| {J,J_z,n} \right\rangle$$ with J = 7/2, J z  = −7/2, …, 7/2, and n = 0, 1, …, nmax. We have verified that a maximum phonon occupation nmax = 800 is sufficient to faithfully simulate the evolution for the timescales of interest. To simulate the TPM protocol, we proceed in the following way. We start the process in a given eigenstate of the system, with definite eigenvalues of the Hamiltonian, $$\hat H$$, and the conserved charge, $$\hat M$$, $$\left| {E_n,M_m} \right\rangle$$. Then, we perform a sudden quench to the intermediate stage and, then, another quench to the final Hamiltonian. We calculate the probability of each transition $$\left| {E_n,M_m} \right\rangle$$ → $$\left| {E_p^\prime ,M_r^\prime } \right\rangle$$, involving a work $$w = E_p^\prime - E_n$$ and a change in the conserved charge, $$w_M = M_r^\prime - M_m$$; this probability is $$P\left( {w,w_M} \right)$$ = $$\left| {\left\langle {E_p^\prime ,M_r^\prime |E_n,M_m} \right\rangle } \right|^2$$. From this result, we obtain the marginal probabilities for the work, w, and the change in the charge, w M ; both values provide us the generalised work required by the transition, Eqs. (2) and (3)44,45,46. We repeat the same calculations for every eigenstate of the initial system, obtaining the corresponding marginal probability distributions. The final results follow by averaging the different initial states with the probability distribution given by the GGE, with the corresponding temperatures β and β M . Note that this procedure is totally equivalent to averaging over a large number of realisations consisting in: first selecting randomly an initial eigenstate $$\left| {E_n,M_m} \right\rangle$$, with the probability distribution given by the GGE (simulating the first projective measurement); and second, selecting randomly the final state as an eigenstate of the final Hamiltonian, with a probability distribution given by $$\left| {\left\langle {E_p^\prime ,M_r^\prime |E_n,M_m} \right\rangle } \right|^2$$ (simulating the second projective measurement). Moreover, this numerical procedure is in direct analogy with the implementation of the filtering method in ref. 34 to project the initial state onto a given eigenstate of the system.

In all the simulations shown, we use g(t < 0) = 2ε0, g(0 < t < τ) = 3ε0 and g(τ) = ε0. This choice entails that the coupling constant in the intermediate stage is above the critical coupling, gcr = $$\sqrt {\omega _{{\mathrm{COM}}}{\kern 1pt} \omega _{{\mathrm{at}}}} {\mathrm{/}}2\sim 2.74\varepsilon _0$$, for the transition from normal to super-radiant behaviour of the Dicke model (see Supplementary Note 3). Indeed, we have checked that the majority of the populated levels at the end of the protocol lays in the chaotic regime. Thus, we expect an effective breakdown of the conservation of $$\hat M_{}^{}$$, and a complete thermalisation for sufficiently large τ70.

### Data availability

The data that support the findings of this study are available from the corresponding author on request.

## References

1. 1.

Schilpp, P. A. (ed.) Albert Einstein, Philosopher-Scientist: The Library of Living Philosophers Vol. 7, 32–33 (Open Court Publishing, La Salle, 2000).

2. 2.

Carnot, S. Réflexions sur la puissance motrice du feu et sur les machines propres à développer cette puissance (Bachelier, Paris, 1824).

3. 3.

Liphardt, J., Dumont, S., Smith, S. B., Tinoco, I. & Bustamante, C. Equilibrium information from nonequilibrium measurements in an experimental test of Jarzynski’s equality. Science 296, 1832–1835 (2002).

4. 4.

Ritort, F. Nonequilibrium fluctuations in small systems: from physics to biology. Adv. Chem. Phys. 137, 31–123 (2008).

5. 5.

Esposito, M., Harbola, U. & Mukamel, S. Nonequilibrium fluctuations, fluctuation theorems, and counting statistics in quantum systems. Rev. Mod. Phys. 81, 1665–1702 (2009).

6. 6.

Scully, M. O., Zubairy, M. S., Agarwal, G. S. & Walther, H. Extracting work from a single heat bath via vanishing quantum coherence. Science 299, 862–864 (2003).

7. 7.

Abah, O. & Lutz, E. Efficiency of heat engines coupled to nonequilibrium reservoirs. Europhys. Lett. 106, 20001 (2014).

8. 8.

Roßnagel, J., Abah, O., Schmidt-Kaler, F., Singer, K. & Lutz, E. Nanoscale heat engine beyond the Carnot limit. Phys. Rev. Lett. 112, 030602 (2014).

9. 9.

Hänggi, P. & Talkner, P. The other QFT. Nat. Phys. 11, 108–110 (2015).

10. 10.

Jarzynski, C. Diverse phenomena, common themes. Nat. Phys. 11, 105–107 (2015).

11. 11.

Sutherland, B. Beautiful Models. 70 Years of Exactly Solved Quantum Many-Body Problems (World Scientific, London, 2004).

12. 12.

Essler, F. H. L., Frahm, H., Göhmann, F., Klümper, A. & Korepin, V. E. The One-Dimensional Hubbard Model (Cambridge Univ. Press, Cambridge, 2005).

13. 13.

Dicke, R. H. Coherence in spontaneous radiation processes. Phys. Rev. 93, 99–110 (1954).

14. 14.

Garraway, B. M. The Dicke model in quantum optics: Dicke model revisited. Philos. Trans. A Math. Phys. Eng. Sci. 369, 1137–1155 (2011).

15. 15.

Sutherland, B. Model for a multicomponent quantum system. Phys. Rev. B 12, 3795–3805 (1975).

16. 16.

Kinoshita, T., Wenger, T. & Weiss, D. S. A quantum Newton’s cradle. Nature 440, 900–903 (2006).

17. 17.

Prosen, T. Open XXZ spin chain: nonequilibrium steady state and a strict bound on ballistic transport. Phys. Rev. Lett. 106, 217206 (2011).

18. 18.

Prosen, T. & Ilievski, E. Families of quasilocal conservation laws and quantum spin transport. Phys. Rev. Lett. 111, 057203 (2013).

19. 19.

Ilievski, E. & Nardis, J. De Microscopic origin of ideal conductivity in integrable quantum models. Phys. Rev. Lett. 119, 020602 (2017).

20. 20.

Heidrich-Meisner, F., Honecker, A., Cabra, D. C. & Brenig, W. Zero-frequency transport properties of one-dimensional spin-1/2 systems. Phys. Rev. B 68, 134436 (2003).

21. 21.

Tasaki, H. Jarzynski relations for quantum systems and some applications. Preprint at http://arxiv.org/abs/cond-mat/0009244 (2000).

22. 22.

Tasaki, H. Statistical mechanical derivation of the second law of thermodynamics. Preprint at http://arxiv.org/abs/cond-mat/0009206 (2000).

23. 23.

Kurchan, J. A quantum fluctuation theorem. Preprint at http://arxiv.org/abs/cond-mat/0007360 (2000).

24. 24.

Yukawa, S. A quantum analogue of the Jarzynski equality. J. Phys. Soc. Jpn. 69, 2367–2370 (2000).

25. 25.

Jaynes, E. T. Information theory and statistical mechanics. Phys. Rev. 106, 620–630 (1957).

26. 26.

Rigol, M., Dunjko, V., Yurovsky, V. & Olshanii, M. Relaxation in a completely integrable many-body quantum system: an ab initio study of the dynamics of the highly excited states of 1D lattice hard-core bosons. Phys. Rev. Lett. 98, 050405 (2007).

27. 27.

Moreno-Cardoner, M. et al. Predicting spinor condensate dynamics from simple principles. Phys. Rev. Lett. 99, 020404 (2007).

28. 28.

Talkner, P., Lutz, E. & Hänggi, P. Fluctuation theorems: work is not an observable. Phys. Rev. E 75, 050102 (2007).

29. 29.

Gring, M. et al. Relaxation and prethermalization in an isolated quantum system. Science 337, 1318–1322 (2012).

30. 30.

Langen, T. et al. Experimental observation of a generalized Gibbs ensemble. Science 348, 207–211 (2015).

31. 31.

Ronzheimer, J. P. et al. Expansion dynamics of interacting bosons in homogeneous lattices in one and two dimensions. Phys. Rev. Lett. 110, 205301 (2013).

32. 32.

Benhelm, J., Kirchmair, G., Roos, C. F. & Blatt, R. Experimental quantum-information processing with 43Ca+ ions. Phys. Rev. A. 77, 062306 (2008).

33. 33.

Harty, T. P. et al. High-fidelity preparation, gates, memory, and readout of a trapped-ion quantum bit. Phys. Rev. Lett. 113, 220501 (2014).

34. 34.

An, S. et al. Experimental test of the quantum Jarzynski equality with a trapped-ion system. Nat. Phys. 11, 193–199 (2015).

35. 35.

Kienzler, D. et al. Quantum harmonic oscillator state control in a squeezed fock basis. Phys. Rev. Lett. 119, 033602 (2017).

36. 36.

Häffner, H., Roos, C. F. & Blatt, R. Quantum computing with trapped ions. Phys. Rep. 469, 155–203 (2008).

37. 37.

Emary, C. & Brandes, T. Quantum chaos triggered by precursors of a quantum phase transition: the Dicke model. Phys. Rev. Lett. 90, 044101 (2003).

38. 38.

Emary, C. & Brandes, T. Chaos and the quantum phase transition in the Dicke model. Phys. Rev. E 67, 066203 (2003).

39. 39.

Relaño, A., Bastarrachea-Magnani, M. A. & Lerma-Hernández, S. Approximated integrability of the Dicke model. EPL 116, 50005 (2016).

40. 40.

Huber, G., Schmidt-Kaler, F., Deffner, S. & Lutz, E. Employing trapped cold ions to verify the quantum Jarzynski equality. Phys. Rev. Lett. 101, 070403 (2008).

41. 41.

Dorner, R. et al. Extracting quantum work statistics and fluctuation theorems by single-qubit interferometry. Phys. Rev. Lett. 110, 230601 (2013).

42. 42.

Mazzola, L., De Chiara, G. & Paternostro, M. Measuring the characteristic function of the work distribution. Phys. Rev. Lett. 110, 230602 (2013).

43. 43.

Batalhão, T. B. et al. Experimental reconstruction of work distribution and study of fluctuation relations in a closed quantum system. Phys. Rev. Lett. 113, 140601 (2014).

44. 44.

Hickey, J. M. & Genway, S. Fluctuation theorems and the generalized Gibbs ensemble in integrable systems. Phys. Rev. E 90, 022107 (2014).

45. 45.

Guryanova, Y., Popescu, S., Short, A. J., Silva, R. & Skrzypczyk, P. Thermodynamics of quantum systems with multiple conserved quantities. Nat. Commun. 7, 12049 (2016).

46. 46.

Yunger Halpern, N., Faist, P., Oppenheim, J. & Winter, A. Microcanonical and resource-theoretic derivations of the non-Abelian thermal state. Nat. Commun. 7, 12051 (2016).

47. 47.

Gogolin, C. & Eisert, J. Equilibration, thermalisation, and the emergence of statistical mechanics in closed quantum systems. Rep. Prog. Phys. 79, 056001 (2016).

48. 48.

Lostaglio, M., Jennings, D. & Rudolph, T. Thermodynamic resource theories, non-commutativity and maximum entropy principles. New J. Phys. 19, 043008 (2017).

49. 49.

Johnson, T. H., Cosco, F., Mitchison, M. T., Jaksch, D. & Clark, S. R. Thermometry of ultracold atoms via nonequilibrium work distributions. Phys. Rev. A 93, 053619 (2016).

50. 50.

Streif, M., Buchleitner, A., Jaksch, D. & Mur-Petit, J. Measuring correlations of cold-atom systems using multiple quantum probes. Phys. Rev. A 94, 053634 (2016).

51. 51.

Ilievski, E., Medenjak, M., Prosen, T. & Zadnik, L. Quasilocal charges in integrable lattice systems. J. Stat. Mech. Theory Exp. 2016, 64008 (2016).

52. 52.

Chen, Y. et al. Emulating weak localization using a solid-state quantum circuit. Nat. Commun. 5, 5184 (2014).

53. 53.

Zou, L. J. et al. Implementation of the Dicke lattice model in hybrid quantum system arrays. Phys. Rev. Lett. 113, 023603 (2014).

54. 54.

Kosloff, R. & Levy, A. Quantum heat engines and refrigerators: continuous devices. Annu. Rev. Phys. Chem. 65, 365–393 (2014).

55. 55.

Parrondo, J. M. R., Horowitz, J. M. & Sagawa, T. Thermodynamics of information. Nat. Phys. 11, 131–139 (2015).

56. 56.

Eisert, J., Friesdorf, M. & Gogolin, C. Quantum many-body systems out of equilibrium. Nat. Phys. 11, 124–130 (2015).

57. 57.

Campisi, M., Hänggi, P. & Talkner, P. Colloquium: quantum fluctuation relations: foundations and applications. Rev. Mod. Phys. 83, 771–791 (2011).

58. 58.

Esposito, M., Ochoa, M. A. & Galperin, M. Nature of heat in strongly coupled open quantum systems. Phys. Rev. B 92, 235440 (2015).

59. 59.

Tang, Y. et al. Thermalization near integrability in a dipolar quantum Newton’s cradle. Phys. Rev. X 8, 021030 (2018) https://doi.org/10.1103/PhysRevX.8.021030.

60. 60.

Moeckel, M. & Kehrein, S. Interaction quench in the Hubbard model. Phys. Rev. Lett. 100, 175702 (2008).

61. 61.

Trotzky, S. et al. Probing the relaxation towards equilibrium in an isolated strongly correlated one-dimensional Bose gas. Nat. Phys. 8, 325–330 (2012).

62. 62.

Bertini, B., Essler, F. H. L., Groha, S. & Robinson, N. J. Prethermalization and thermalization in models with weak integrability breaking. Phys. Rev. Lett. 115, 180601 (2015).

63. 63.

Ros, V., Müller, M. & Scardicchio, A. Integrals of motion in the many-body localized phase. Nucl. Phys. B 891, 420–465 (2015).

64. 64.

D’Alessio, L., Kafri, Y., Polkovnikov, A. & Rigol, M. From quantum chaos and eigenstate thermalization to statistical mechanics and thermodynamics. Adv. Phys. 65, 239–362 (2016).

65. 65.

Pekola, J. P. Towards quantum thermodynamics in electronic circuits. Nat. Phys. 11, 118–123 (2015).

66. 66.

Bauer, G. E. W., Saitoh, E. & van Wees, B. J. Spin caloritronics. Nat. Mater. 11, 391–399 (2012).

67. 67.

Correa, L. A., Mehboudi, M., Adesso, G. & Sanpera, A. Individual quantum probes for optimal thermometry. Phys. Rev. Lett. 114, 220405 (2015).

68. 68.

Goold, J., Huber, M., Riera, A., del Rio, L. & Skrzypczyk, P. The role of quantum information in thermodynamics— a topical review. J. Phys. A Math. Theor. 49, 143001 (2016).

69. 69.

Cosco, F., Borrelli, M., Plastina, F. & Maniscalco, S. Momentum-resolved and correlations spectroscopy using quantum probes. Phys. Rev. A 95, 053620 (2017).

70. 70.

Neill, C. et al. Ergodic dynamics and thermalization in an isolated quantum system. Nat. Phys. 12, 1037–1041 (2016).

## Acknowledgements

We acknowledge useful discussions with B. Buča, J. Dukelsky, J. J. Garca-Ripoll, K. Hovhannisyan, D. Jennings, D. Lucas and K. Thirumalai. This work was supported by the EU H2020 Collaborative project QuProCS (Grant Agreement No. 641277); EU Seventh Framework Programme QMAC (Grant Agreement No. 319286); EPSRC Grant No. EP/P01058X/1; Spain’s MINECO/FEDER Grants Nos. FIS2015-70856-P, FIS2012-35316, FIS2015-63770-P and FIS2014-61633-EXP; and CAM research consortium QUITEMAD+ (S2013/ICE-2801). D.J. thanks the Graduate School of Excellence Material Science in Mainz for hospitality during part of this work.

## Author information

Authors

### Contributions

J.M.-P. envisioned the project, derived analytically the generalised QFRs and devised the implementation of the Dicke model with trapped ions. A.R. performed all numerical simulations. J.M.-P., A.M., R.A.M. and D.J. contributed to discussion and interpretation of the results, and to the final manuscript.

### Corresponding authors

Correspondence to J. Mur-Petit or A. Relaño.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Mur-Petit, J., Relaño, A., Molina, R.A. et al. Revealing missing charges with generalised quantum fluctuation relations. Nat Commun 9, 2006 (2018). https://doi.org/10.1038/s41467-018-04407-1

• Accepted:

• Published:


text:
# 10th Class Mathematics Statistics

Statistics

Category : 10th Class

Statistics

1. Mean of grouped data: It is the sum of the values of all the observations divided by the total number of observations.

1. The mean for grouped data can be found by

 i. The direct method $\overline{x}\,\,=\,\,\frac{\sum{{{f}_{i}}{{x}_{i}}}}{\sum{{{f}_{i}}}}$ ii. The assumed mean method =$\overline{x}\,\,=a\,\,+\,\,\frac{\sum{{{f}_{i}}{{d}_{i}}}}{\sum{{{f}_{i}}}}$ iii. The step deviation method $\overline{x}\,\,=a\,\,+\,\,\left( \frac{\sum{{{f}_{i}}{{u}_{i}}}}{\sum{{{f}_{i}}}} \right)\times h$

1. Mode: It is the variate which occurs most often, i.e. which has the maximum frequency.

1. The mode for grouped data can be found using the formula

Mode= $I+\left( \frac{{{f}_{1}}-{{f}_{0}}}{2{{f}_{1}}-{{f}_{0}}-{{f}_{2}}} \right)\,\times \,\,h$

1. Median: The median is a measure of the central tendency which gives the value of the middlemost observation in the data.

1. The median for grouped data can be found using the formula:

Median = $I+\left( \frac{\frac{n}{2}-cf}{f} \right)\,\times \,\,h$

1. Relationship among Mean, Median and Mode

$Mode=3\text{ }\left( Median \right)\text{ }-\text{ }2\text{ }\left( Mean \right)$

Snap Test

1. The mean of the following frequency distribution is 62.8. Find the missing frequency x.

 Class 0 - 20 20 - 40 40 - 60 60 - 80 80 - 100 100 - 120 Frequency 5 8 x 12 7 8

(a) 15                            (b) 20

(c) 10                            (d) 30

(e) None of these

Ans.     (c)

Explanation: According to the question:

 Class interval Frequency fi Mid-value xi (fi $\mathbf{\times }$ xi) 0 - 20 5 10 50 20 - 40 8 30 240 40 - 60 X 50 50x 60 - 80 12 70 840 80 - 100 7 90 630 100 - 120 8 110 880 $\sum{{{f}_{i}}\,\,=\,(40\,\,+\,\,x)}$ $({{f}_{i}}\,\,\times \,\,{{x}_{i}})\,=\,(2640\,\,+\,\,50x)$

$\therefore$      $Mean\text{ }\overline{x}\,\,=\,\,\frac{\sum{({{f}_{i}}\,\times \,{{x}_{i}})}}{\sum{{{f}_{i}}}}$                     $\Rightarrow \,\,\,\,\,\,\frac{2640\,+50x}{40\,+\,x}\,\,=\,\,62.8$

$\Rightarrow \,\,\,\,\,\,\frac{2640\,+50x}{40\,+\,x}\,\,=\,\,\frac{628}{10}$

$\Rightarrow \,\,\,\,\,\,\,\,26400\,\,+\,\,500x\,\,=\,\,25120\,\,+\,\,628x$

$\Rightarrow \,\,\,\,\,\,\,\,128x\,\,=\,\,1280\,\,\,\,\,\,\Rightarrow \,\,\,x\,\,=\,\,10$

2.         The mean of the following frequency table is 50. But the frequencies ${{\mathbf{f}}_{\mathbf{1}}}\text{ }\mathbf{and}\text{ }{{\mathbf{f}}_{\mathbf{2}}}$ in class 20 – 40 and 60 – 80 are missing frequencies.

 Class Interval 10 - 20 20 - 40 40 - 60 60 - 80 80 - 100 Total 17 ${{f}_{1}}$ 32 ${{f}_{2}}$ 19 120

(a) 28, 24                      (b) 26, 24

(c) 27, 20                       (d) 30, 28

(e) None of these

Ans.     (a)

Explanation: According to the question: $17\text{ }+\text{ }{{f}_{1}}+\text{ }32\text{ }+\text{ }{{f}_{2}}+\text{ }19\text{ }=\text{ }120\,\,\,\,\,\text{ }{{f}_{2}}=\text{ }\left( 52\text{ }\text{ }{{f}_{1}} \right).$

Now we may prepare the table given below:

 Class interval Frequency ${{\mathbf{f}}_{\mathbf{i}}}$ Class Mark ${{\mathbf{x}}_{\mathbf{i}}}$ $\begin{array}{*{35}{l}} \left( {{\mathbf{f}}_{\mathbf{i}}}\mathbf{\times }{{\mathbf{x}}_{\mathbf{i}}} \right) \\ \end{array}$ 0 - 20 17 10 170 20 ? 40 ${{f}_{1}}$ 30 $30{{f}_{1}}$ 40 - 60 32 50 1600 60 - 80 $52\text{ }-\text{ }{{f}_{1}}$ 70 $3640\text{ }-\text{ }70{{f}_{1}}$ 80 - 100 19 90 1710 $\sum{{{f}_{i}}\,\,=\,\,120}$ $\sum{({{f}_{i}}\,\,\times \,\,{{x}_{i}})\,\,\,=\,\,\,(7120\,\,-\,\,40{{f}_{1}})}$

$\therefore \,\,\,\,\,\,\,\,Mean\,\,\overline{x}\,\,=\,\,\frac{\sum{({{f}_{i}}\times {{x}_{i}})}}{\sum{{{f}_{i}}}}\,\,=\,\,\frac{(7120-40{{f}_{1}})}{120}\,\,\,=\,\,\,\frac{(178-{{f}_{1}})}{3}$

So, $\frac{178-{{f}_{1}}}{3}\,\,=\,\,50\,\,\,\Rightarrow \,\,178-{{f}_{1}}\,\,=\,\,150\,\,\,\Rightarrow \,\,{{f}_{1}}=28$

Thus, ${{f}_{1}}=\text{ }28\text{ }and\text{ }{{f}_{2}}=\text{ }\left( 52\text{ }-\text{ }28 \right)\text{ }=\text{ }24.$

1. Find the mean of the following data:

 Class Interval 0 - 10 10 - 20 20 - 30 30 - 40 40 - 50 Frequency 7 8 12 13 10

(a) 25.3                         (b) 27.2

(c) 20.23                        (d) 26.1

(e) None of these

Ans.     (b)

Explanation: We have:

 Class interval Frequency ${{\mathbf{f}}_{\mathbf{i}}}$ Class Mark ${{\mathbf{x}}_{\mathbf{i}}}$ $\begin{array}{*{35}{l}} \left( {{\mathbf{f}}_{\mathbf{i}}}\,\,\mathbf{\times }\,\,{{\mathbf{x}}_{\mathbf{i}}} \right) \\ \end{array}$ 0 - 10 7 5 35 10 - 20 8 15 120 20 - 30 12 25 300 30 - 40 13 35 455 40 - 50 10 45 450 $\sum{{{f}_{i}}\,\,=\,\,50}$ $\sum{({{f}_{i}}\,\,\times \,\,{{x}_{i}})\,\,=\,\,1360}$

$\therefore \,\,\,\,\,Mean\,\,=\,\,\frac{\sum{({{f}_{i}}\,\,\times \,\,{{x}_{i}})}}{\sum{{{f}_{i}}}}\,\,=\,\,\frac{1360}{50}\,\,=\,\,27.2$

4.         The arithmetic mean of the following frequency distribution is 25. Determine the value of p

 Class 0 - 10 10 - 20 20 - 30 30 - 40 40 - 50 Frequency 5 18 15 p 6

(a) 12                            (b) 14

(c) 10                            (d) 16

(e) None of these

Ans.     (d)

Explanation: We have:

 Class interval Frequency Mid-value $\left( {{\mathbf{f}}_{\mathbf{i}}}\,\,\mathbf{\times }\,\,{{\mathbf{x}}_{\mathbf{i}}} \right)$ 0 - 10 5 5 25 10 - 20 18 15 270 20 - 30 15 25 375 30 - 40 P 35 35p 40 - 50 6 45 270 $\sum{{{f}_{i}}\,\,=\,\,(44+p)}$ $\sum{({{f}_{i}}\,\,\times \,\,{{x}_{i}})\,\,=\,\,(940\,\,+\,\,35p)}$

$\therefore$      Mean $\overline{x}=\frac{\sum{({{f}_{i}}\,\,\times \,\,{{x}_{i}})}}{\sum{{{f}_{i}}}}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\Rightarrow \,\,\,\,\frac{(940+35p)}{(44+p)}\,\,\,=\,\,25$

$\Rightarrow$ $\left( 940\text{ }+\text{ }35p \right)\text{ }=\text{ }25\left( 44\text{ }+\text{ }p \right)$

$\Rightarrow$ $(35p-25p)\,\,=\,\,(1100-940)$

$\Rightarrow$ $10p\text{ }=\text{ }160~~\Rightarrow \,\,\,~p\text{ }=\text{ }16.$

Hence, $p\text{ }=\text{ }16.$

1. The following table gives the marks scored by 50 students in class test:

 Marks 0 - 100 100 - 200 200 - 300 300 - 400 400 - 500 500 - 600 No. of  students 2 8 12 20 5 3

Find the mean marks scored by a student in the class test.

(a) 304                          (b) 306

(c) 310                          (d) 308

(e) None of these

Ans.     (a)

Explanation: Here, $h=\text{ }100$. Thus, we have:

 Class interval Frequency ${{\mathbf{f}}_{\mathbf{i}}}$ Mid-value ${{\mathbf{x}}_{\mathbf{i}}}$ ${{\mathbf{u}}_{\mathbf{i}}}\mathbf{=}\frac{{{\mathbf{x}}_{\mathbf{i}}}\mathbf{-A}}{\mathbf{h}}$   $\mathbf{=}\,\,\frac{\mathbf{(}{{\mathbf{x}}_{\mathbf{i}}}\mathbf{-250)}}{\mathbf{100}}$ $\left( {{\mathbf{f}}_{\mathbf{i}}}\mathbf{\times }{{\mathbf{u}}_{\mathbf{i}}} \right)$ 0 - 100 2 50 -2 -4 100 - 200 8 150 -1 -8 200 - 300 12 $250\text{ }=\text{ }A$ 0 0 300 - 400 20 350 1 20 400 - 500 5 450 2 10 500 - 600 3 550 3 9 $\sum{{{f}_{i}}\,\,=\,\,50}$ $\sum{({{f}_{i}}\,\times \,{{u}_{i}})}\,=\,27$

Thus, A             = $250,\,\,\,h\,\,=\,\,100,\,\sum{{{f}_{1}}=50,\,\sum{({{f}_{i}}\,\,\times \,\,{{u}_{i}})=27.}}$

$\therefore \,\,\,\,Mean,\,\,\overline{x}\,\,\,\,\,\,\,\,\,\,\,\,=\,\,A\,+\,\left( h\times \,\,\frac{\sum{({{f}_{i}}\,\,\times \,\,{{u}_{i}})}}{\sum{{{f}_{i}}}} \right)$

$=250+\left( 100\,\,\times \,\,\frac{27}{50} \right)\,\,\,=\,250\,\,+\,\,54\,\,=\,\,304$

$Hence,\text{ }mean\text{ }marks=\text{ }304.$

#### Other Topics

##### 30 20

You need to login to perform this action.
You will be redirected in 3 sec

format: plain


text:
In Japan, 90-day securities have a 4% annualized return and 180-

# In Japan, 90-day securities have a 4% annualized return and 180-

365.9k points
1. In Japan, 90-day securities have a 4% annualized return and 180-day securities have a 5% annualized return. In the United States, 90-day securities have a 4% annualized return and 180-day securities have an annualized return of 4.5%. All securities are of equal risk, and Japanese securities are denominated in terms of the Japanese yen. Assuming that interest rate parity holds in all markets, which of the following statements is most CORRECT?

a. The yen-dollar spot exchange rate equals the yen-dollar exchange rate in the 90-day forward market.

b. The yen-dollar spot exchange rate equals the yen-dollar exchange rate in the 180-day forward market.

c. The yen-dollar exchange rate in the 90-day forward market equals the yen-dollar exchange rate in the 180-day forward market.

d. The spot rate equals the 90-day forward rate.

e. The spot rate equals the 180-day forward rate.

In Japan
JasonJones

365.9k points

#### Oh Snap! This Answer is Locked

Thumbnail of first page

Excerpt from file: 1. In Japan, 90-day securities have a 4% annualized return and 180-day securities have a 5% annualized return. In the United States, 90-day securities have a 4% annualized return and 180-day securities have an annualized return of 4.5%. All securities are of equal risk, and Japanese securities are

Filename: 171.docx

Filesize: 14.6K

Print Length: 1 Pages/Slides

Words: 142

Surround your text in *italics* or **bold**, to write a math equation use, for example, $x^2+2x+1=0$ or $$\beta^2-1=0$$

Use LaTeX to type formulas and markdown to format text. See example.


text:
# Biblioteca

Música » A Day to Remember »

## Holdin' It Down for the Underground

29 execuções | Ir para página da faixa

Faixas (29)
Faixa Álbum Duração Data
Holdin' It Down for the Underground 3:23 Jul 27 2012, 16h04
Holdin' It Down for the Underground 3:23 Abr 12 2011, 14h19
Holdin' It Down for the Underground 3:23 Jan 16 2011, 15h59
Holdin' It Down for the Underground 3:23 Jan 5 2011, 0h45
Holdin' It Down for the Underground 3:23 Dez 27 2010, 23h59
Holdin' It Down for the Underground 3:23 Dez 26 2010, 2h25
Holdin' It Down for the Underground 3:23 Dez 21 2010, 16h56
Holdin' It Down for the Underground 3:23 Nov 24 2010, 14h00
Holdin' It Down for the Underground 3:23 Nov 23 2010, 23h38
Holdin' It Down for the Underground 3:23 Nov 23 2010, 19h29
Holdin' It Down for the Underground 3:23 Nov 21 2010, 16h47
Holdin' It Down for the Underground 3:23 Nov 19 2010, 20h19
Holdin' It Down for the Underground 3:23 Nov 18 2010, 20h24
Holdin' It Down for the Underground 3:23 Nov 16 2010, 19h24
Holdin' It Down for the Underground 3:23 Nov 15 2010, 20h49
Holdin' It Down for the Underground 3:23 Nov 15 2010, 14h31
Holdin' It Down for the Underground 3:23 Nov 15 2010, 11h28
Holdin' It Down for the Underground 3:23 Nov 15 2010, 8h39
Holdin' It Down for the Underground 3:23 Nov 15 2010, 5h51
Holdin' It Down for the Underground 3:23 Nov 15 2010, 1h04
Holdin' It Down for the Underground 3:23 Nov 12 2010, 0h29
Holdin' It Down for the Underground 3:23 Nov 11 2010, 22h24
Holdin' It Down for the Underground 3:23 Nov 11 2010, 19h55
Holdin' It Down for the Underground 3:23 Out 14 2010, 20h19
Holdin' It Down for the Underground 3:23 Fev 10 2010, 20h13
Holdin' It Down for the Underground 3:23 Dez 24 2009, 11h26
Holdin' It Down for the Underground 3:23 Dez 18 2009, 0h03
Holdin' It Down for the Underground 3:23 Ago 2 2009, 8h53
Holdin' It Down for the Underground 3:23 Ago 1 2009, 21h37


text:
# Marginal models for longitudinal count data with Generalized Estimating Equations¶

Key ideas: Gaussian GEE, Poisson GEE, score testing, offsets

The CBPP (Contagious bovine pleuropneumonia) dataset (part of the R LMER library) contains data on the incidence of new cases of CBPP in 15 herds of cattle. Each herd is assessed for CBPP during four time periods. This is a longitudinal data set, since the same herds are observed in the four time periods. In this notebook we use generalized estimating equations (GEE) to compare the CBP incidence rates among the time periods, while accounting for the possibility that there is dependence within herds across time.

In [1]:
import numpy as np
import pandas as pd
import statsmodels.api as sm

We begin by constructing a variable that contains the naive estimate of the incidence rate (the number of incident cases divided by the herd size).

In [2]:
data = pd.read_csv("cbpp.csv")
data["rate"] = data["incidence"] / data["size"].astype(np.float64)

## Gaussian approach¶

A basic approach is to model the naive incidence rates as Gaussian, with an exchangeable within-herd dependence structure (i.e. the covariance matrix of the 4 observations for one herd has constant off-diagonal elements). We also allow the mean to vary with period (the time variable). We treat period as a categorical variable, so each of the four time periods has its own mean value.

In [3]:
ga = sm.families.Gaussian()
ex = sm.cov_struct.Exchangeable()

model1 = sm.GEE.from_formula("rate ~ 0 + C(period)", groups="herd",
data=data, family=ga, cov_struct=ex)
result1 = model1.fit()
print result1.summary()

                               GEE Regression Results
===================================================================================
Dep. Variable:                        rate   No. Observations:                   56
Model:                                 GEE   No. clusters:                       15
Method:                        Generalized   Min. cluster size:                   1
Estimating Equations   Max. cluster size:                   4
Family:                           Gaussian   Mean cluster size:                 3.7
Dependence structure:         Exchangeable   Num. iterations:                     4
Date:                     Sat, 18 Oct 2014   Scale:                           0.016
Covariance type:                    robust   Time:                         22:29:51
================================================================================
coef    std err          z      P>|z|      [95.0% Conf. Int.]
--------------------------------------------------------------------------------
C(period)[1]     0.2198      0.042      5.206      0.000         0.137     0.303
C(period)[2]     0.0741      0.020      3.714      0.000         0.035     0.113
C(period)[3]     0.0894      0.037      2.401      0.016         0.016     0.162
C(period)[4]     0.0413      0.019      2.133      0.033         0.003     0.079
==============================================================================
Skew:                          1.1918   Kurtosis:                       1.4013
Centered skew:                 0.5332   Centered kurtosis:              0.6795
==============================================================================

We see that after the first period, the incidence rate drops substantially. We don't have a lot of background information about this data set, but for the sake of discussion we can treat this as a hypothesis that can be studied as if it were pre-specified (rather than one that was discovered using the data). If we reparameterize the model in terms of deviations from the first period, we see that there is statistical evidence that periods 2-4 have lower incidence rates than period 1 (due to the Z-scores for periods 2-4 being rather large in magnitude).

In [4]:
model2 = sm.GEE.from_formula("rate ~ C(period)", groups="herd",
data=data, family=ga, cov_struct=ex)
result2 = model2.fit()
print result2.summary()

                               GEE Regression Results
===================================================================================
Dep. Variable:                        rate   No. Observations:                   56
Model:                                 GEE   No. clusters:                       15
Method:                        Generalized   Min. cluster size:                   1
Estimating Equations   Max. cluster size:                   4
Family:                           Gaussian   Mean cluster size:                 3.7
Dependence structure:         Exchangeable   Num. iterations:                     2
Date:                     Sat, 18 Oct 2014   Scale:                           0.016
Covariance type:                    robust   Time:                         22:29:51
==================================================================================
coef    std err          z      P>|z|      [95.0% Conf. Int.]
----------------------------------------------------------------------------------
Intercept          0.2198      0.042      5.206      0.000         0.137     0.303
C(period)[T.2]    -0.1457      0.051     -2.855      0.004        -0.246    -0.046
C(period)[T.3]    -0.1304      0.054     -2.396      0.017        -0.237    -0.024
C(period)[T.4]    -0.1785      0.046     -3.870      0.000        -0.269    -0.088
==============================================================================
Skew:                          1.1918   Kurtosis:                       1.4013
Centered skew:                 0.5332   Centered kurtosis:              0.6795
==============================================================================

We also see that there is very little evidence of within-herd correlation.

In [5]:
print ex.summary()

The correlation between two observations in the same cluster is 0.004

The weak dependence is corroborated by the following dependence plot, however the sample size of this data set is too small to learn much about the covariance structure.

In [6]:
fig = result2.plot_isotropic_dependence(min_n=1)

### Score test comparing periods 2-4 to period 1¶

We can test the hypothesis that time periods 2-4 have a common mean value using a score test. This involves fitting the model under a linear constraint in which the mean parameters for periods 2-4 are held equal to each other. Currently, this cannot be done using the GEE.from_formula method, so we specify endog, exog, and the constraints explicitly. First we construct the data as numpy arrays.

In [7]:
endog = data["rate"]
period = data["period"]
groups = data["herd"]

n = len(endog)
exog = [np.ones(n), 1*(period == 2), 1*(period == 3), 1*(period == 4)]
exog = np.array(exog).T

Next we specify the constraints that define the null hypothesis that we are testing. We are testing params[1] = params[2] = params[3], or equivalently, params[1] - params[2] = 0 and params[2] - params[3] = 0. This can be expressed as a matrix equation of the form L*params = R (where R = 0 in this case).

In [8]:
L = np.zeros((2,4))
L[0,:] = [0, 1, -1, 0]
L[1,:] = [0, 0, 1, -1]
R = np.zeros(2)

Now we are ready to fit the model:

In [9]:
model3 = sm.GEE(endog, exog, groups=groups, family=ga, cov_struct=ex,
constraint=(L, R))
result3 = model3.fit()
print result3.summary()

                               GEE Regression Results
===================================================================================
Dep. Variable:                        rate   No. Observations:                   56
Model:                                 GEE   No. clusters:                       15
Method:                        Generalized   Min. cluster size:                   1
Estimating Equations   Max. cluster size:                   4
Family:                           Gaussian   Mean cluster size:                 3.7
Dependence structure:         Exchangeable   Num. iterations:                     4
Date:                     Sat, 18 Oct 2014   Scale:                           0.015
Covariance type:                    robust   Time:                         22:29:51
==============================================================================
coef    std err          z      P>|z|      [95.0% Conf. Int.]
------------------------------------------------------------------------------
const          0.2198      0.042      5.206      0.000         0.137     0.303
x1            -0.1510      0.046     -3.273      0.001        -0.241    -0.061
x2            -0.1510      0.046     -3.273      0.001        -0.241    -0.061
x3            -0.1510      0.046     -3.273      0.001        -0.241    -0.061
==============================================================================
Skew:                          1.2807   Kurtosis:                       1.6141
Centered skew:                 0.5474   Centered kurtosis:              0.7898
==============================================================================

The score statistic tells us how fast the likelihood increases if we did not impose the constraint that the rates at time points 2-4 are equal. Based on the score test, there is no statistical evidence that periods 2-4 are different from each other.

In [10]:
print model3.score_test_results

{'df': 2, 'p-value': 0.57225449912148196, 'statistic': 1.1163429160392608}

Alternatively, we can use Patsy to process the formulas and constraints for us.

In [11]:
import patsy
dmat = patsy.dmatrix("C(period)", data=data)
di = dmat.design_info
lc = di.linear_constraint("C(period)[T.2] = C(period)[T.3] = C(period)[T.4]")

constraint = (np.asarray(lc.coefs), np.asarray(lc.constants))

model4 = sm.GEE(np.asarray(data["rate"]), np.asarray(dmat), groups=np.asarray(groups), family=ga, cov_struct=ex,
constraint=constraint)
result4 = model4.fit()
print result4.summary()
print model4.score_test_results

                               GEE Regression Results
===================================================================================
Dep. Variable:                           y   No. Observations:                   56
Model:                                 GEE   No. clusters:                       15
Method:                        Generalized   Min. cluster size:                   1
Estimating Equations   Max. cluster size:                   4
Family:                           Gaussian   Mean cluster size:                 3.7
Dependence structure:         Exchangeable   Num. iterations:                     2
Date:                     Sat, 18 Oct 2014   Scale:                           0.015
Covariance type:                    robust   Time:                         22:29:51
==============================================================================
coef    std err          z      P>|z|      [95.0% Conf. Int.]
------------------------------------------------------------------------------
const          0.2198      0.042      5.206      0.000         0.137     0.303
x1            -0.1510      0.046     -3.273      0.001        -0.241    -0.061
x2            -0.1510      0.046     -3.273      0.001        -0.241    -0.061
x3            -0.1510      0.046     -3.273      0.001        -0.241    -0.061
==============================================================================
Skew:                          1.2807   Kurtosis:                       1.6141
Centered skew:                 0.5474   Centered kurtosis:              0.7898
==============================================================================
{'df': 2, 'p-value': 0.57225449912621951, 'statistic': 1.1163429160227036}

## Poisson approach¶

There isn't a lot of data for assessing the link function, but we can still check the fitted values on residuals plot, shown below. There is some evidence for an increasing mean/variance relationship.

In [12]:
plt.plot(result1.fittedvalues, result1.resid, 'o', alpha=0.6)
plt.xlabel("Fitted values", size=17)
plt.ylabel("Residuals", size=17)
plt.xlim(0, 0.25)

Out[12]:
(0, 0.25)

To address this, we can model the number of transmission events as following a Poisson distribution. This is based on a conceptual model in which there is a fixed transmission probability, and every transmission event is independent of the others. We use an offset to account for differences in the herd sizes.

In [13]:
po = sm.families.Poisson()
ex = sm.cov_struct.Exchangeable()
size = np.log(np.asarray(data["size"]))

model5 = sm.GEE.from_formula("incidence ~ C(period)", groups=groups,
data=data, offset=size, family=po, cov_struct=ex)
result5 = model5.fit(cov_type='naive')
print result5.summary()
print ex.summary()

                               GEE Regression Results
===================================================================================
Dep. Variable:                   incidence   No. Observations:                   56
Model:                                 GEE   No. clusters:                       15
Method:                        Generalized   Min. cluster size:                   1
Estimating Equations   Max. cluster size:                   4
Family:                            Poisson   Mean cluster size:                 3.7
Dependence structure:         Exchangeable   Num. iterations:                    11
Date:                     Sat, 18 Oct 2014   Scale:                           8.248
Covariance type:                     naive   Time:                         22:29:52
==================================================================================
coef    std err          z      P>|z|      [95.0% Conf. Int.]
----------------------------------------------------------------------------------
Intercept         -1.5176      0.368     -4.126      0.000        -2.239    -0.797
C(period)[T.2]    -0.9982      0.777     -1.285      0.199        -2.521     0.525
C(period)[T.3]    -1.1174      0.839     -1.331      0.183        -2.762     0.528
C(period)[T.4]    -1.5641      1.129     -1.385      0.166        -3.778     0.650
==============================================================================
Skew:                          2.3583   Kurtosis:                       5.5733
Centered skew:                 1.5871   Centered kurtosis:              4.0577
==============================================================================
The correlation between two observations in the same cluster is 0.028

The dependence is still weak. The scale factor is quite large, indicating that there is a lot of heterogeneity among the herds in CBPP transmission.

## Negative binomial approach¶

Below we fit a negative binomial model to the counts.

In [14]:
nb = sm.families.NegativeBinomial(alpha=1.)
ex = sm.cov_struct.Exchangeable()
size = np.log(np.asarray(data["size"]))

model6 = sm.GEE.from_formula("incidence ~ C(period)", groups=groups,
data=data, offset=size, family=nb, cov_struct=ex)
result6 = model6.fit()
print result6.summary()
print ex.summary()

                               GEE Regression Results
===================================================================================
Dep. Variable:                   incidence   No. Observations:                   56
Model:                                 GEE   No. clusters:                       15
Method:                        Generalized   Min. cluster size:                   1
Estimating Equations   Max. cluster size:                   4
Family:                   NegativeBinomial   Mean cluster size:                 3.7
Dependence structure:         Exchangeable   Num. iterations:                    11
Date:                     Sat, 18 Oct 2014   Scale:                           4.201
Covariance type:                    robust   Time:                         22:29:52
==================================================================================
coef    std err          z      P>|z|      [95.0% Conf. Int.]
----------------------------------------------------------------------------------
Intercept         -1.5163      0.199     -7.625      0.000        -1.906    -1.127
C(period)[T.2]    -1.0196      0.349     -2.922      0.003        -1.704    -0.336
C(period)[T.3]    -0.9816      0.430     -2.281      0.023        -1.825    -0.138
C(period)[T.4]    -1.6129      0.359     -4.497      0.000        -2.316    -0.910
==============================================================================
Skew:                          2.3583   Kurtosis:                       5.5741
Centered skew:                 1.5874   Centered kurtosis:              4.0588
==============================================================================
The correlation between two observations in the same cluster is 0.015


text:
# Gnanesh Kunal

y² mod p = ⟮x³ +7⟯ mod p

# Numpy vs. Python Lists

While I was learning Machine Learning, I made my mind not to use any of the third-party-libraries (including numpy and Pandas) until I got to know what happened in the background and feel okay to use libraries.

It was a bit harder to write everything from scratch. Even the dot product must be written, cause python doesn't have that inbuilt.

Finally, I've felt comfortable and could clearly understand what is happening in the background (cause, Machine Learning is all about Math).

Stochastic gradient descent is actually scanning through the training examples, and then it'll take a little gradient descent step with respect to the cost function of just that training example.

The cost function measures how well the hypothesis is doing on a single example.

${cost( \Theta, (x^{(i)}, y^{(i)})) = \dfrac{1}{2}(h_\Theta(x^{(i)}) - y^{(i)})^2}$

${J_{train}(\Theta) = \dfrac{1}{m} \sum_{i=1}^{m} cost( \Theta, (x^{(i)}, y^{(i)}))}$

### A dumb Stochastic Gradient Descent Implementation

#### Using Lists:

def dot(v, w):
return sum(v_i * w_i for v_i, w_i in zip(v, w))

def predict_multi(x_i, beta):
return dot(x_i, beta)

def error_multi(beta, x, y):
return y - predict_multi(x, beta)

for _ in range(1500):
for x_i, y_i in zip(x, y):
i = 0
for x_ii, theta_i in zip(x_i, theta):
theta[i] = theta_i - learning_rate * (-error_multi(theta, x_i, y_i)) * x_ii
i += 1
return theta

So, the benchmark results

%timeit stochastic_gradient_descent(multi_data, daily_minutes_good, theta)
1.85 s ± 21.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

#### Using Numpy:

import numpy as np

for _ in range(1500):
for x_i, y_i in zip(x, y):
theta = theta - learning_rate * (np.sum(x_i * theta) - y_i) * x_i
return theta

That's it, boom. The Numpy implementation of Gradient Descent actually uses a vectorized implementation.

Benchmark using Numpy:

%timeit stochastic_gradient_descent_np(np_multi_data, np_daily, np_theta)
1.96 s ± 7.53 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

Using Numpy doesn't just make the implementation simpler but also faster.