Preliminaries

We consider a quantum system in contact with a thermal bath of inverse temperature β associated with a Hilbert space \({{\mathcal{H}}}\), which does not have to be finite-dimensional, and a Hamiltonian H on \({{\mathcal{H}}}\).

When the \({{\mathcal{H}}}\) is infinite-dimensional, we restrict our attention to the Hilbert space spanned by the energy eigenstates \({\left\{\left|i\right\rangle \right\}}_{i\in {\mathbb{N}}}\) of the Hamiltonian \(H={\sum }_{i}{E}_{i}\left|i\right\rangle \left\langle i\right|\). Without loss of generality, we can rearrange the order of the energy eigenvalues so that Ei≤Ei+1 holds for any \(i\in {\mathbb{N}}\). We assume that the Hamiltonian satisfies the Gibbs hypothesis \({{\rm{Tr}}}[{e}^{-\beta H}] < \infty\) so that the partition function is well-defined.

We employ the resource-theoretic approach, which has recently made significant progress in investigating the thermodynamic features of quantum systems1,2,3,4,5,6,19,20,21,22,23,24,25, to analyze the work extraction. Quantum resource theory is characterized by the set of states prepared without any cost in the setting (called free states) and the class of operations that can be applied easily (called free operations). In the context of quantum thermodynamics, the Gibbs thermal state defined as \(\tau :={e}^{-\beta H}/{{\rm{Tr}}}[{e}^{-\beta H}]\) is the only free state. We consider the class of operations called the thermal operations1, which is considered a physically implementable class of operations. Let \({{\mathcal{D}}}({{\mathcal{H}}})\) denote the set of density operators acting on the Hilbert space \({{\mathcal{H}}}\). A completely positive trace preserving (CPTP) map \({{\mathcal{E}}}:{{\mathcal{D}}}({{{\mathcal{H}}}}_{A})\to {{\mathcal{D}}}({{{\mathcal{H}}}}_{B})\) is called a thermal operation if there exists an ancillary system E with the Hamiltonian HE such that \({{\mathcal{E}}}\) can be dilated as

$${{\mathcal{E}}}({\rho }_{A})={{{\rm{Tr}}}}_{A+E-B}\left[U({\rho }_{A}\otimes {\tau }_{E}){U}^{{\dagger} }\right],$$

(1)

where U is the unitary operator that conserves the energy of the composite system A + E, that is, satisfies [U, HA ⊗ IE + IA ⊗ HE] = 0. We remark that any thermal operation \({{\mathcal{E}}}\) is Gibbs-preserving, i.e., it holds that \({{\mathcal{E}}}({\tau }_{A})={\tau }_{B}\).

When we consider the multi-copies of the systems, we assume that the Hamiltonian of each system is the same, and there are no interactions between the systems, that is, the Hamiltonian of the n systems are represented as \({H}^{\times n}:={\sum }_{i=1}^{n}{I}^{\otimes (i-1)}\otimes H\otimes {I}^{\otimes (n-i)}\). The thermal state of the whole system is described as τ⊗n.

The work that can be extracted from the input state is measured with the energy gap of another system called the work storage1, a qubit system \({{{\mathcal{H}}}}_{W}={{\rm{Span}}}\left\{\left|0\right\rangle,\left|W\right\rangle \right\}\) with Hamiltonian \({H}_{W}=W\left|W\right\rangle \left\langle W\right|\). Starting from a given input state ρ and the ground state \(\left|0\right\rangle \left\langle 0\right|\) of the work storage, if there exists a free operation Λ which can output the state \(\left|W\right\rangle \left\langle W\right|\) with a target fidelity error ε, i.e., \(\Lambda (\rho \otimes \left|0\right\rangle \left\langle 0\right|){\approx }^{\varepsilon }\left|W\right\rangle \left\langle W\right|\) holds, we can conclude that the work W is extracted from ρ with error ε. The optimal one-shot extractable work from the state ρ in the state-aware scenario is defined as

$$ {W}_{{{\rm{aware}}}}^{\varepsilon }(\rho )\\ : = \max \left\{W\in {\mathbb{R}}\,| \,\mathop{\sup }_{\Lambda \in {{\rm{TO}}}}F(\Lambda (\rho \otimes \left|0\right\rangle \left\langle 0\right|),\left|W\right\rangle \left\langle W\right|)\ge 1-\varepsilon \right\},$$

(2)

where the supremum is taken over all possible work extraction protocols that are thermal operations. This definition is legitimate in the sense that thermal operation does not require any additional work cost to apply. What is crucial in the context of the following discussion is that the optimal protocol Λ that achieves the maximum work extraction can generally depend on the input state ρ.

To see the correspondence between the framework of quantum thermodynamics and thermodynamics in the macroscopic regime, it is important to evaluate the performance of the work extraction task in the multi-copy limit. (See Fig. 1.) The asymptotic extractable work rate is defined as

$${W}_{{{\rm{aware}}}}^{\infty }(\rho )=\mathop{\lim}_{\varepsilon \to 0}\mathop{{{\rm{limsup}}}}_ {n\to \infty }\frac{1}{n}{W}_{{{\rm{aware}}}}^{\varepsilon }({\rho }^{\otimes n})$$

(3)

In ref. 15, they showed that the upper bound on the extractable work extraction rate is given by

$$\beta {W}_{{{\rm{aware}}}}^{\infty }(\rho )\le D(\rho \parallel \tau )$$

(4)

even in the situation where the Hilbert space under consideration is infinite-dimensional. Here, D(ρ∥τ) is the Umegaki relative entropy defined as \(D(\rho \parallel \tau ):={{\rm{Tr}}}[\rho \log \rho -\rho \log \tau ]\)26. Umegaki’s relative entropy plays a pivotal role in quantum thermodynamics because it connects to Helmholtz’s free energy. However, whether this limit is achievable in the infinite-dimensional case was unknown.

Fig. 1: Schematic figure of the universal work extraction protocol.figure 1

The work extraction protocol discussed in the previous results (left) is tailored according to the information of the initial state, and the optimal extractable work rate is shown to be characterized by the Helmholtz free energy. The universal work extraction protocol introduced in our result (right) is independent of the input state but achieves the same extractable rate as the state-dependent protocol in the asymptotic limit.

A series of papers have found that this bound is tight in the finite-dimensional system, i.e., the optimal rate of extractable work from an i.i.d. state in the finite-dimensional system per the number of copies by the thermal operation is characterized as3,6

$$\beta {W}_{{{\rm{aware}}}}^{\infty }(\rho )=D(\rho \parallel \tau ).$$

(5)

Universal work extraction

Since we do not know the input state in the state-agnostic scenario, we also do not know how much work is supposed to be extracted, and how large the energy gap the work storage should have. To avoid this problem, we extend the work storage as follows. First, we define a set \({\mathbb{W}}\) as

$${\mathbb{W}}=\left\{\mathop{\sum }_{i=1}^{d}{N}_{i}{E}_{i}\ge 0\,| \,\mathop{\sum }_{i}{N}_{i}=0,\,\,{N}_{i}\in {\mathbb{Z}}\right\}.$$

(6)

This set includes all the possible work extracted from the system, which can be seen from the construction of the protocol. The Hamiltonian of work storage is defined as

$${H}_{W}=\mathop{\sum }_{W\in {\mathbb{W}}}W\left|W\right\rangle {\left\langle W\right|}_{W}.$$

(7)

Thanks to this definition, the work storage can admit any possible amount of work.

The difference between state-aware and agnostic work extraction is whether the distillation process can depend on the given state. To formalize this, we define one-shot extractable work of the input state ρ with error ε > 0 enabled by the thermal operation Λ as

$$ {W}^{\varepsilon }(\rho,\Lambda )\\ =\max \left\{W\in {\mathbb{W}}\,| \,F(\Lambda ({\rho }\otimes \left|0\right\rangle {\left\langle 0\right|}_{W}),\left|W\right\rangle {\left\langle W\right|}_{W})\ge 1-\varepsilon \right\}.$$

(8)

We then define the asymptotic extractable work rate of the sequence of states \({\left\{{\rho }^{\otimes n}\right\}}_{n\in {\mathbb{N}}}\) enabled by the protocol \({\left\{{\Lambda }_{n}\right\}}_{n\in {\mathbb{N}}}\) as

$${W}^{\infty }({\left\{{\rho }^{\otimes n}\right\}}_{n},{\left\{{\Lambda }_{n}\right\}}_{n})=\mathop{\lim}_{\varepsilon \to+0}\mathop{{{\rm{limsup}}}}_{n\to \infty }\frac{1}{n}{W}^{\varepsilon }({\rho }^{\otimes n},{\Lambda }_{n}).$$

(9)

If the series \({\{{\Lambda }_{n}\}}_{n}\) of the protocol can be optimally chosen depending on the state ρ, this recovers the state-aware work extraction, i.e.,

$${W}_{{{\rm{aware}}}}^{\infty }(\rho ):=\mathop{\sup }_{{\{{\Lambda }_{n}\}}_{n}\subset {{\rm{TO}}}}{W}^{\infty }\left({\left\{{\rho }^{\otimes n}\right\}}_{n},{\left\{{\Lambda }_{n}\right\}}_{n}\right),$$

(10)

which is characterized by the free energy of ρ as in (5).

On the other hand, state-agnostic work extraction requires us to fix the protocol first and see how well it works for different input states. Therefore, the notion of state-agnostic extractable work should be considered as the function of all quantum states such that there is a fixed protocol that works for all states with that performance.

Definition 1

Fix a set \(S\subset {{\mathcal{D}}}({{\mathcal{H}}})\) of states. If there exists a series \({\{{\Lambda }_{n}\}}_{n}\) of thermal operations \({\Lambda }_{n}:{{\mathcal{D}}}({{{\mathcal{H}}}}^{\otimes n}\otimes {{{\mathcal{H}}}}_{W})\to {{\mathcal{D}}}({{{\mathcal{H}}}}_{W})\) such that

$${W}^{\infty }\left({\left\{{\rho }^{\otimes n}\right\}}_{n},{\left\{{\Lambda }_{n}\right\}}_{n}\right)={W}_{{{\rm{agnostic}}}}^{\infty }(\rho ),\,\forall \rho \in S,$$

(11)

we say that the function \({W}_{{{\rm{agnostic}}}}^{\infty }:S\to {\mathbb{R}}\) is a S-achievable state-agnostic work extraction rate. When we take \(S={{\mathcal{D}}}({{\mathcal{H}}})\), we say that \({W}_{{{\rm{agnostic}}}}^{\infty }\) is the achievable state-agnostic work extraction rate.

S represents the possible candidates for the given state, and the condition \(S={{\mathcal{D}}}({{\mathcal{H}}})\) implies that we cannot utilize any information of the given state to tailor the work extraction protocol. We remark that this notion of state-agnostic (or interchangeably, universal) protocols was previously considered in the context of quantum source compression27,28,29 and entanglement distillation18,30, in which the partial information of the given state may be provided.

Because of the result for state-aware work extraction (5) for finite dimensions, any achievable state-agnostic work extraction rate Wagnostic for finite dimensions satisfies

$$\beta {W}_{{{\rm{agnostic}}}}^{\infty }(\rho )\le D(\rho \parallel \tau ),\,\forall \rho \in {{\mathcal{D}}}({{\mathcal{H}}}).$$

(12)

Therefore, the best we can hope for is to have an achievable \({W}_{{{\rm{agnostic}}}}^{\infty }\) such that the equality holds for an arbitrary state ρ. Our main result is that this is indeed the case.

Theorem 2

The state-agnostic work extraction rate \({W}_{{{\rm{agnostic}}}}^{\infty }\) such that \(\beta {W}_{{{\rm{agnostic}}}}^{\infty }(\rho )=D(\rho \parallel \tau )\) for all state ρ in the finite-dimensional system is achievable.

The main idea behind our protocol is to utilize the permutational symmetry of the given copies of the unknown states, which allows us to circumvent learning the full description of the given quantum state. More details are given in the next section and Section III in the Supplementary Information.

Let us also remark on the relationship between the universal work extraction and Maxwell’s demon. In the standard setting of Maxwell’s demon thought experiments, we assume that the experimenter knows the probability distribution of the system, but does not know which state is actually realized. Maxwell’s demon is a hypothetical agent that acquires knowledge of which state is realized, enabling it to apply a feedback protocol and extract some amount of work from an equilibrium system, seemingly violating the second law of thermodynamics. This thought experiment shows that knowledge of the state increases the performance of work extraction, which apparently contradicts our result. However, these two results do not contradict each other. Our setting is one in which the experimenter does not even know the density matrix, whereas the state-aware scenario involves prior knowledge of it. Thus, the object to which the word “prior knowledge” refers differs between Maxwell’s demon setting and the state-agnostic work extraction in our result.

Let us discuss a relation with the recent result in ref. 14, which discussed the state-agnostic work extraction by introducing the black box work extraction, where the worst-case extractable work among all states in the given set of states is considered. They found that, when the black box only contains a finite number of states, the performance of the black box work extraction under thermal operations is characterized by the minimum free energy of the states in the box. Our result extends this to an arbitrary black box composed of i.i.d. states, solving the open problem raised in ref. 14.

Furthermore, our result enables us to analyze the performance of state-agnostic work extraction from any given state, which is not possible in the framework of black box work extraction because it always considers the worst-case performance. Specifically, the extractable work from any black boxes containing the thermal state is always zero, because no work can be extracted from the thermal state. Thus, this does not reflect the properties of all the states in the black box that might be given to us. On the other hand, our new result fully characterizes the performance of the work extraction protocol for any given state.

Note that we cannot know the amount of extractable work from the state after we apply this protocol. When we utilize the work storage for some practical tasks, we need to perform the projective measurement with the set of the projectors \({\left\{\left|W\right\rangle {\left\langle W\right|}_{W}\right\}}_{W\in {\mathbb{W}}}\). This process is considered beyond the framework of thermal operations, as it could generally change the energy of the work storage. Nevertheless, it only changes the energy of the final state by a small amount because the final state is sufficiently close to the energy eigenstate.

We also remark that the universal resource distillation is tied to the notion called pseudo-resource states30,31,32,33—state ensembles that cannot be efficiently distinguished from more resourceful ones—because a state-agnostic resource distillator could be used as a state distinguisher. Therefore, our protocol could provide useful insights in investigating the pseudo-resource in the framework of quantum thermodynamics. (See Section III. F of the Supplementary Information for more discussions.)

Let us now discuss the performance of the work extraction task for infinite-dimensional systems. The following results show that, when the system is associated with an infinite-dimensional Hilbert space, one can still construct a work extraction protocol that does not depend on the full details of the given input state, while achieving the optimal work extraction rate.

Theorem 3

Let \(S\subset {{\mathcal{D}}}({{\mathcal{H}}})\) be a set of states that contains a finite number of states. Furthermore, we assume that all the states have finite energy and free energy, and, for any ρ ∈ S, there exists a positive number ε > 0 such that the diagonal elements of ρ satisfy \({\rho }_{ii}={{\mathcal{O}}}({i}^{-(2+\varepsilon )})\). Then, the state-agnostic work extraction rate \({W}_{{{\rm{agnostic}}}}^{\infty }\) such that \(\beta {W}_{{{\rm{agnostic}}}}^{\infty }(\rho )=D(\rho \parallel \tau )\) in the infinite-dimensional system is S-achievable.

Several remarks are in order. We first would like to clarify that our result can only be applied to the case when the number of candidate states is finite. In this sense, this protocol can be seen as a semi-universal work extraction protocol, which functions universally for a limited set of states. Whether one can extend this to a continuous set of input states (e.g., the set of all density matrices) is an interesting open problem. We also remark that we used an additional assumption on the scaling behavior of the diagonal elements of the input state. Although this limits the scope of the universality of the protocol compared to the finite-dimensional cases, our protocol still does not depend on most of the information about the input state, such as actual values of the diagonals or its eigenbasis.

We stress that Theorem 3 offers a novel result even if we take the simplest case \(S=\left\{\rho \right\}\), i.e., S is a singleton, which corresponds to the state-aware scenario. This, together with the converse bound in Eq. (4), gives us the complete characterization of the optimal extractable work rate for the states in the infinite-dimensional system satisfying the condition, i.e., the optimal extractable work can be characterized by

$$\beta {W}_{{{\rm{aware}}}}^{\infty }(\rho )=D(\rho \parallel \tau ).$$

(13)

Theorem 3 then further shows that this optimal rate can be achieved in a state-agnostic manner if we know that the state is taken from a finite number of candidates.

Let us remark on the assumption made here. If we take the Hamiltonian as the harmonic oscillator, the condition \({\rho }_{ii}={{\mathcal{O}}}({i}^{-(2+\varepsilon )})\) is almost equivalent to the condition of finite energy. If the energy spectrum grows superlinearly Ei = Ω(iα), (α > 1), the condition \({\rho }_{ii}={{\mathcal{O}}}({i}^{-(2+\varepsilon )})\) is ensured by the finite-energy condition.

Our results particularly apply to bosonic systems, one of the most essential ones toward realizing quantum computing that involves an infinite-dimensional Hilbert space. When we analyze the quantum thermodynamic properties of the states in the bosonic system, what matters is not only the nonequilibriumness, but also the non-Gaussianity, which serves as another important resource in the bosonic system34,35,36,37,38,39. Motivated by this observation, previous works introduced the framework of Gaussian thermal operations40,41,42, which is the intersection of Gaussian and thermal operations. (See also ref. 43 for the analysis of the extractable work from the bosonic system using Gaussian unitaries in the sense of the ergotoropy.) It is then natural to ask whether our optimal rate could be realized by Gaussian thermal operations.

Interestingly, the semiuniversal work extraction protocol needs to be non-Gaussian if the set S includes a Gaussian state, no matter what Fock state we take for the initial work storage state. Such a semiuniversal work extraction needs to convert the input Gaussian non-thermal state and the initial Fock state in the work storage to the target Fock state. However, we can see that this cannot be achieved by Gaussian operation by looking at a measure of non-Gaussianity. In particular, the negativity of the Wigner function44 was shown to be a valid non-Gaussianity measure, which cannot increase under Gaussian operations (in fact, under a more general class called Gaussian protocols)38,39. Since the negativity of the Wigner function of Fock states monotonically increases with energy, the output state of the work extraction protocol has higher non-Gaussianity than the initial state, excluding the possibility of Gaussian thermal operations.

Sketch of construction

Let us briefly overview the construction of our universal work extraction protocol. The state-aware work extraction protocol in ref. 4, which is also explained in detail in Section II of the Supplementary Information, goes as follows: Apply the pinching channel, which corresponds to taking the time-average, apply the energy-conserving unitary to diagonalize the input state with a fixed energy eigenbasis, which enables us to apply the energy-conserving unitary to extract work. Here, the state-dependent steps in this protocol are diagonalization and the appropriate choice for the unitary to extract work. Our proof strategy is to convert these steps to state-independent procedures.

The overview of the universal work extraction protocol functions in the following steps. These steps are also exhibited in Fig. 2.

1.

(Diagonalization step) Given n copies of ρ, we apply the channel called Schur pinching channel, which is explained in the following discussion, to each k copies.

2.

(Learning step) Estimate the relative entropy of the pinched state with the incoherent measurement. As explained below, this procedure, combined with the execution step, can be done solely by the thermal operations.

3.

(Execution step) According to the information about the relative entropy, we apply the state-aware work extraction protocol constructed in ref. 4.

Fig. 2: Overview of the universal work extraction protocol for finite-dimensional systems.figure 2

First, we apply the channel called Schur pinching to obtain the state diagonalized with a specific energy eigenbasis that also respects the permutation symmetry. After that, we apply a thermal operation that simulates the type measurement on a sublinear number of subsystems and the work extraction protocol conditioned on the measurement outcomes. Since the projector corresponding to the measurement is the projector onto the energy eigenspace, we can realize the same action solely by a thermal operation.

Since all the steps can be done by thermal operations, the concatenation of these procedures is also a thermal operation.

Let us first consider the diagonalization part. The most naive idea to obtain a state diagonalized with a fixed energy eigenbasis is to choose an arbitrary energy eigenbasis \({\left\{\left|i\right\rangle \right\}}_{i=1}^{{d}^{n}}\), and apply the completely decohering map \(\Delta ({\rho }_{n}):={\sum }_{i=1}^{{d}^{n}}\left|i\right\rangle \left\langle i\right|{\rho }_{n}\left|i\right\rangle \left\langle i\right|\). However, the decohering map might lose too much free energy. For instance, if we choose the energy eigenbasis as the tensor products \(\{|{E}_{{i}_{1}}\rangle \otimes \cdots \otimes |{E}_{{i}_{n}}\rangle \}\) of the energy eigenvectors of each subsystem, we have \(\Delta(\rho^{\otimes n})=(\Delta(\rho))^{\otimes n}\). Since the performance of the state-agnostic work extraction is always upper bounded by that of state-aware protocol, the extractable work from this system is at most \(\frac{1}{\beta }D(\Delta (\rho )\parallel \tau )\), which is smaller than the optimal extractable work \(\frac{1}{\beta }D(\rho \parallel \tau )\) in general. This is due to the nondiagonal entries of the density matrix that involve energetic coherence. Thus, we need to find some way to obtain the diagonalized state without losing too much coherence.

To this end, we utilize the permutation symmetry of the system and the input state. First, we consider the Hilbert space \({{{\mathcal{H}}}}^{\otimes k}\) of k systems. Due to the Schur-Weyl duality, this Hilbert space can be decomposed as follows.

$${{{\mathcal{H}}}}^{\otimes k}=\mathop{\bigoplus} _{\lambda \in {Y}_{d}^{k}}{{{\mathcal{W}}}}_{\lambda }\otimes {{{\mathcal{U}}}}_{\lambda }.$$

(14)

Here, \({Y}_{d}^{k}\) is the set of the Young diagrams of k blocks with depth at most d, and \({{{\mathcal{W}}}}_{\lambda }\) and \({{{\mathcal{U}}}}_{\lambda }\) are the representation spaces of Weyl representation of the general linear group \({{\rm{GL}}}(d,{\mathbb{C}})\) and the irreducible representation (irrep) of the symmetric group \({{\mathfrak{S}}}_{k}\) respectively, corresponding to the Young diagram λ. Here, we denote the dimension of the representation spaces as \({m}_{\lambda }=\dim {{{\mathcal{U}}}}_{\lambda },\,{n}_{\lambda }=\dim {{{\mathcal{W}}}}_{\lambda }\).

Since H×k is permutationally invariant, it can be decomposed as

$${H}^{\times k}=\mathop{\bigoplus }_{\lambda \in {Y}_{d}^{k}}{H}_{\lambda }\otimes {I}_{{\lambda }}.$$

(15)

Since Hλ is Hermitian for any \(\lambda \in {Y}_{d}^{k}\), each Hλ can be diagonalized by some orthogonal basis. This forms the energy eigenbasis of H×k (Fig. 3). ρ⊗k can also be represented as

$${\rho }^{\otimes k}=\mathop{\bigoplus }_{\lambda \in {Y}_{d}^{k}}{\rho }_{\lambda }\otimes {I}_{{\lambda }}.$$

(16)

The explicit form of ρ⊗k is exhibited as Fig. 4.

Fig. 3: The structure of the Hamiltonian with the Schur basis.figure 3

Due to the Schur-Weyl duality, the Hamiltonian H×k of k systems is block-diagonalized as above. Since all Hλ are Hermitian, we can find an orthonormal basis of the whole Hilbert space that diagonalizes Hλ in each block.

Fig. 4: The matrix representation of ρ⊗k.figure 4

The blocks indicate each direct sum element \({{{\mathcal{W}}}}_{\lambda }\otimes {{{\mathcal{U}}}}_{\lambda }\). Each block consists of nλ × nλ blocks \({({\rho }_{\lambda })}_{ij}{I}_{{m}_{\lambda }}\), where \({m}_{\lambda }=\dim {{{\mathcal{U}}}}_{\lambda }\) and \({n}_{\lambda }=\dim {{{\mathcal{W}}}}_{\lambda }\).

We then apply the pinching channel defined as

$$\widetilde{{{\mathcal{P}}}}(\cdot )=\mathop{\sum }_{\lambda \in {Y}_{d}^{k}}\mathop{\sum }_{{E}_{{i}_{\lambda }}}{\Pi }_{{E}_{{i}_{\lambda }}}(\cdot ){\Pi }_{{E}_{{i}_{\lambda }}}.$$

(17)

This channel—which we call Schur pinching—removes the terms in the off-diagonal blocks in the structure induced by the Schur basis (Fig. 4). Here, \({\Pi }_{{E}_{{i}_{\lambda }}}\) is the projector onto the eigenspace of \({H}_{\lambda }\otimes {I}_{{\lambda }}\) which corresponds to the energy eigenvalue \({E}_{{i}_{\lambda }}\). Lemma S.1 in Section I of the Supplementary Information ensures that this channel is a thermal operation. This channel corresponds to the procedure to remove all the non-diagonal blocks within each irrep \({{{\mathcal{W}}}}_{\lambda }\otimes {{{\mathcal{U}}}}_{\lambda }\). The output state after applying this channel is the diagonal state with the fixed Schur basis. We provide an explicit construction of Schur pinching in the 3-qubit case in Section III.B.

Analysis in Section III of the Supplementary Information reveals that, if we take sufficiently large k, The relative entropy \(\frac{1}{k}D(\widetilde{{{\mathcal{P}}}}({\rho }^{\otimes k})\parallel {\tau }^{\otimes k})\) of the pinched state can be arbitrary close to the relative entropy D(ρ∥τ) of the input state. Therefore, if we can design the universal work extraction protocol for the classical state that can achieve the relative entropy of the input state, we can take k sufficiently large so that we achieve the extractable work rate D(ρ∥τ).

We can now concentrate on designing the universal work extraction protocol for classical states. As also mentioned in the previous discussion, it is nontrivial to choose the right unitary to extract work from classical states in the state-agnostic scenario. From the design of the work extraction protocol in ref. 4, it is sufficient to have the knowledge of the relative entropy of the state with respect to the thermal state to choose the appropriate protocol.

However, the class of thermal operations does not contain any measurement, preventing us from performing tomography. To avoid this problem, we consider a slightly larger class of operations called conditioned thermal operations45, which consists of the measurement on the subsystem and the thermal operation conditioned by the measurement outcome. Although the conditioned thermal operations outperform the thermal operations, it is shown in ref. 14 that when the measurement is restricted to the incoherent projective measurement, i.e., the projective measurement whose POVM elements M satisfy \({{\mathcal{P}}}(M)=M\), the class of conditioned thermal operations coincides with the class of thermal operations. The idea of implementation is to convert the incoherent measurement and the following energy-conserving unitary conditioned on the estimation to a controlled energy-conserving unitary gate. Since we convert the input state to the classical state \(\widetilde{{{\mathcal{P}}}}({\rho }^{\otimes k})\), which is diagonalized with the fixed energy eigenbasis, we can apply the incoherent measurement to extract sufficient information to estimate the relative entropy.

Now, the whole description of the protocol is the following. Given n copies of the unknown state ρ, we apply the Schur pinching to k copies. After this, we obtain \(q:=\lfloor \frac{n}{k}\rfloor\) copies of the classical state \(\widetilde{{{\mathcal{P}}}}({\rho }^{\otimes k})\). We discard the remaining r ≔ n − kq systems. Out of q copies of \(\widetilde{{{\mathcal{P}}}}({\rho }^{\otimes k})\), pick up m = o(q) copies and apply the type measurement on them. We estimate the relative entropy according to the measurement outcome and apply the work extraction protocol in ref. 4.

The parameters k and m can depend on the total number of input copies n. In Section III of the Supplementary Information, we show that we can tune these parameters kn, mn so that this work extraction protocol can achieve the extractable work rate \(\frac{1}{\beta }D(\rho \parallel \tau )\) in the asymptotic limit.

One might not be convinced to call the protocol constructed in our paper “universal” since our protocol contains the learning process that extracts information about the relative entropy of the input state. We first stress that, although our protocol involves conditional processes, the quantum channel that describes the whole process, transforming the initial states ρ⊗n to the work state \(\left|W\right\rangle \left\langle W\right|\), is chosen independently of the initial state ρ. This means that our protocol can be universally applied to any i.i.d. input states, hence the name. (See Definition 1 and Eqs. (8) and (9).)

Nevertheless, the incorporation of the learning process does not make our universal work extraction protocol trivial, due to the tradeoff relation between the copies of states for tomography and the accuracy of the estimation. To achieve the optimal work extraction rate, we can only consume a sublinear amount of input states for the state tomography, and thus we can never obtain the information of the input state with arbitrary accuracy. On the other hand, the execution protocol subsequently applied after learning might need more accuracy than that ensured by performing tomography on a sublinear number of subsystems. In that case, the fidelity error might grow up to 1 in the limit n → ∞. Whether this issue arises or not depends on the specifics of the protocol and its performance analysis, and what our result shows precisely is that one can design a work extraction protocol that can avoid this problem.

We also exhibit two alternative constructions of the universal work extraction protocol: one based on the measure-and-prepare strategy and the other on a more naive tomography-based strategy, in Section III.D in the Supplementary information.

Let us briefly remark on the performance of the universal work extraction protocol from the finite number of input states, i.e., how fast the work extraction rate approaches to the optimal rate with respect to the number of input-state copies. (See Section III.E in the Supplementary Information for details.) We find that our universal protocol entails a difference from the state-aware protocol in this regime, where the former shows a much slower convergence than the latter. On the other hand, consider a slightly relaxed scenario where we are informed of the relative entropy of the input state, while not knowing the other description of the desnity matrix. This assumption, where one is given the entropic quantity of given quantum states or channels, is often made in the context of the universal protocols in quantum Shannon theory46,47. In this setting, we find that our universal protocol with Schur pinching achieves the convergence speed that coincides with that of the state-aware protocol. This is made possible because the Schur pinching allows one to entirely skip the estimation process, showcasing the operational capability of exploiting the inherent symmetry in the setting.

We also comment on the relationship to a seemingly related protocol for the universal pure-state entanglement distillation proposed in ref. 18. Their protocol also employs the Schur-Weyl duality based on the permutation symmetry of the input state. However, the idea of utilizing the Schur-Weyl duality is different with each other. One reason why this difference happens is that the conditions for the conversion in the quantum thermodynamics and the framework of the bipartite entanglement are opposite in the sense of majorization, and thus the properties of the maximally resourceful state of each theory are different. Therefore, although our protocol might look simiar to the one in ref. 18, the entire construction and how we utilize the symmetry is different to a large extent, reflecting on the different structure of each theory. (See Section IV of the Supplementary Information for more details.)

Next, we briefly describe the construction of the work extraction protocol in infinite-dimensional systems. Details of the construction are provided in Section V of the Supplementary Information. The key idea is to apply the work extraction protocol to the finite-dimensional subspace \({{{\mathcal{H}}}}_{d}:=\left\{\left|1\right\rangle,\ldots,\left|d\right\rangle \right\}\), where we call d the cutoff dimension. Since the support supp(ρ) of the input state ρ might not be included by the subspace \({{{\mathcal{H}}}}_{d}\), the work extraction protocol succeeds probabilistically. If we fix d as a constant, the success probability decays exponentially as the number of subsystems involved in the protocol increases. Thus, we need to take an appropriate sequence \({\left\{{d}_{n}\right\}}_{n}\) of the cutoff dimensions depending on the number n of copies. Indeed, there exists a nice choice of such a sequence that the success probability of the work extraction converges to 1.

The construction of the semiuniversal work extraction protocol in infinite-dimensional systems goes as follows. As mentioned in the previous discussion, we can consider the thermal operation conditioned by the incoherent measurement because we can implement the action solely for the thermal operation. Since there are at most a finite number of candidates for the initial state, we can perform the state tomography to identify the given state. Here, note that the incoherent measurement is not informationally complete, and thus we never obtain the full description of the input state from the measurement outcome. Nevertheless, we can obtain sufficient information to identify the input state by consuming a constant number of states. We then apply the work extraction protocol tailored to the identified state, which can be achieved by taking an appropriate series of cutoff dimensions.