# Landau theory for finite-time dynamical phase transitions

Jan Meibohm1,2, Massimiliano Esposito1 1Complex Systems and Statistical
Mechanics, Department of Physics and Materials Science, University of
Luxembourg, L-1511 Luxembourg, Luxembourg  2Department of Mathematics, King’s
College London, London WC2R 2LS, United Kingdom

###### Abstract

We study the time evolution of thermodynamic observables after an
instantaneous temperature quench. Combining tools from stochastic
thermodynamics and large-deviation theory, we develop a powerful theory for
computing the large-deviation statistics of such observables. Our method
naturally leads to a description in terms of a dynamical Landau theory, a
versatile tool for the analysis of finite-time dynamical phase transitions.
The topology of the associated Landau potential allows for an unambiguous
identification of the dynamical order parameter and of the phase diagram. As
an immediate application, we show that the probability distribution of the
heat exchanged between a mean-field spin model and the environment exhibits a
singularity, a kink, caused by a finite-time dynamical phase transition. Using
our Landau theory, we conduct a detailed study of the phase transition.
Although the manifestation of the new transition is similar to that of a
previously found finite-time transition in the magnetisation, the properties
and the dynamical origins of the two turn out to be very different.

##  1 Introduction

Thermal relaxation is a fundamental process in statistical mechanics, with
numerous applications in Nature and industry. Nonetheless, the kinetics of
relaxation is well understood only close to equilibrium: within the
quasistatic approximation [1] and in the linear response regime [2, 3, 4, 5].
Far-from-equilibrium relaxation, by contrast, is a genuinely non-equilibrium
problem that offers fascinating open questions, and a variety of unexpected
phenomena.

A famous example of a relaxation anomaly is the Mpemba effect [6], i.e., the
faster cooling of an initially hotter system [7, 8, 9, 10]. Other examples
include asymmetries in the rates of heating and cooling [11, 12, 13, 14], as
well as coarsening [15, 16, 17], ergodicity breaking [18], and ageing [19] in
glassy [20] or phase-ordering [15, 17] dynamics.

Often, but not always, anomalous relaxation phenomena are associated with the
presence of equilibrium phase transitions, i.e., qualitative changes of the
equilibrium state of a system under slow variation of the external parameter
[21, 22]. For example, in its original formulation [6], the Mpemba effect
corresponds to the (shorter) time it takes hot water to freeze, compared to
cold water. Similarly, phase-ordering describes how a system condenses into
its ordered phase starting in a disordered initial configuration [15, 17]. The
abrupt state changes associated with equilibrium phase transitions manifest
themselves in singularities of thermodynamic observables such as the free
energy [21, 22].

The analysis of equilibrium phase transitions has led to the development of
powerful methods, such as Landau theory [23] or the renormalisation group [24,
25, 26], that are nowadays standard in statistical mechanics. In particular at
mean-field level, Landau theory provides a universal, widely model-independent
picture of both continuous and first-order phase transitions in terms of
minima of a potential function, the so-called Landau potential. Although the
importance of these methods in equilibrium statistical mechanics can hardly be
overstated, their generalisation to non-equilibrium systems is not
straightforward.

In the past decades, remarkable developments [27, 28, 29, 30, 31, 32] in non-
equilibrium statistical mechanics have led to conceptual generalisations of
phase transitions to systems in non-equilibrium steady states [33, 34, 35, 36,
37, 38, 39, 40] and to dynamic observables [41, 42, 43, 44, 45, 46, 47, 48,
49, 50], generating a pressing need for adequate theoretical tools to describe
them. This demand has partly been met by a surge of new methods, based on,
e.g., linear-response [51, 52, 53], optimal-control techniques [54, 55] and
machine learning [56, 57, 58], but also on dynamical versions of Landau theory
[59, 60, 61].

In a recent Letter [62], we reported another surprising relaxation phenomenon,
a finite-time dynamical phase transition. This transition manifests itself in
a finite-time singularity [63, 64] of the probability distribution of the
magnetisation of a mean-field magnet after an instantaneous quench of the
temperature. In contrast to conventional phase transitions, this finite-time
transition is induced by a change of the typical dynamics under variation of
the observation time. In other words, time takes the role of a control
parameter, analogous to, e.g., the pressure in an equilibrium phase
transition. Although unfamiliar in classical systems, similar finite-time
transitions are well-known to exist in conservative quantum systems as
singularities of the Loschmidt echo [65, 66].

Unsurprisingly, the specifics of finite-time transitions require again
distinct methods that give access to the time-dependent statistics of
observables in the thermodynamic limit. Existing non-equilibrium tools [59,
54, 60, 55, 56, 57, 58] are typically tailored for steady states, while the
finite-time approach in Ref. [62] is limited to phase transitions associated
with the state of the system. In an effort to bridge this gap, we combine in
this paper methods from stochastic thermodynamics [30, 67, 32] and large-
deviation theory [29, 68, 69] to develop a new and effective approach for
analysing the finite-time statistics of thermodynamic observables [70, 71]
after a temperature quench. In particular, we show that such observables
naturally lend themselves to a description in terms of a dynamical Landau
theory. The corresponding Landau potential is most useful in the presence of a
dynamical phase transition because its topology unambiguously identifies the
dynamical phase diagram, and its minima determine the dynamical order
parameter.

As an immediate application of our theory, we show that the heat exchanged
between a mean-field magnet and the bath exhibits a finite-time dynamical
phase transition after an instantaneous temperature quench. Although the setup
and the manifestation of this new transition are somewhat similar to those in
Ref. [62], its properties and the mechanism that drives it are very different.
In a regard we shall describe in more detail, the two transitions are
complementary: the absence of one enables the presence of the other. By means
of our Landau theory, we conduct a detailed study of the transition, determine
its phase diagram and classify the transition as continuous with mean-field
critical exponents. At the trajectory level, we show that the transition is
caused by a sudden switch of an optimal fluctuation with constrained initial
and final points.

More generally, our analysis reveals that finite-time dynamical phase
transitions may be generated in a variety of ways, hinting towards their
existence in a much wider range of systems and observables than previously
thought. Our dynamical Landau theory provides an effective and versatile tool
for their study, that is applicable to systems whose dynamics admit well-
defined thermodynamic or weak-noise limits.

The paper is organised as follows: In Sec. 2 we summarise the relevant
background, including a brief review some of the results of Ref. [62]. Section
3 contains a detailed description of our theory, which we then apply to the
heat exchange of a mean-field magnet in Sec. 4. Finally, in Sec. 5, we draw
our conclusions and describe future applications as well as open questions.

##  2 Background

We begin our exposition with a discussion of the relevant background for our
analysis. To be concrete, we explain our approach in the context of the Curie-
Weiss model, a mean-field version of the Ising model, that exhibits an
equilibrium phase transition. The theory we develop, however, is generally
applicable to systems with well-defined thermodynamic or weak-noise limits
[62].

The Curie-Weiss model is a simple caricature of a magnet where $N\to\infty$
Ising spins $\sigma_{i}=\pm 1$ at sites $i=1,\ldots,N$ are coupled by an
infinite-range, ferromagnetic interaction of strength $J/(2N)>0$. The spins
are immersed in heat baths at inverse temperatures $\beta=1/(k_{\text{B}}T)$
and $\beta_{\text{q}}=1/(k_{\text{B}}T_{\text{q}})$, before and after an
instantaneous temperature quench $T\to T_{\text{q}}$ at time $t=0$. Due to the
mean-field nature of the interaction, we can write all microstates with equal
numbers $N_{\pm}$ of spins in the states $\pm 1$ in terms of the total
magnetisation $M=N_{+}-N_{-}$. Prior to the quench, the free energy $F$ for
the system reads as a function of $M$ [22]

$\displaystyle F(M)=E(M)-\beta^{-1}S^{\text{int}}(M)\,,$ (1)

where $E$ the denotes internal energy

$\displaystyle E(M)=-\frac{J}{2N}\left(M^{2}-N\right)\,.$ (2)

An additional coupling $-HM$ to an external field $H$ is omitted here. In this
field-free version of the model, the internal energy $E(M)$ is entirely due to
the ferromagnetic interaction between the spins.

The dimensionless internal entropy $S^{\text{int}}(M)=\ln\Omega(M)$ in (1)
originates from the microscopic degeneracy of $M$:

$\displaystyle\Omega(M)=\frac{N!}{[(N+M)/2]![(N-M)/2]!}\,.$ (3)

State changes of the system are induced by thermal fluctuations of the heat
bath, which we model by a stochastic dynamics for $M$. An arbitrary spin flip
leads to a change $M\to M_{\pm}\equiv M\pm 2$ in the magnetisation. The
probability $P(M,t)$ for finding the system in state $M$ at time $t$ obeys the
evolution equation

$\displaystyle\dot{P}(M,t)=\sum_{\eta=\pm}\left[W_{\eta}(M_{-\eta})P(M_{-\eta},t)-W_{\eta}(M)P(M,t)\right]\,,$
(4)

with Arrhenius-type rates $W_{\pm}(M)$ for the transitions $M\to M_{\pm}$,
given by

$\displaystyle W_{\pm}(M)=\frac{N\mp M}{2\tau}\exp\left[-\beta
E_{\pm}(M)/2\right]\,.$ (5)

Here, $\tau$ denotes the microscopic relaxation time for a single spin flip
and $E_{\pm}(M)=E(M_{\pm})-E(M)=-2J(\pm M+1)/N$ is the change of internal
energy $E$ during the transition $M\to M_{\pm}$. The algebraic prefactor
$(N\mp M)/2=N_{\mp}$ in (5) reflects that all $N_{\mp}$ microscopic
transitions $\mp 1\to\pm 1$ are equivalent. Furthermore, the transition rates
obey the spin-flip symmetry $W_{\pm}(M)=W_{\mp}(-M)$ and the detailed-balance
condition [72]

$\displaystyle\frac{W_{\pm}(M)}{W_{\mp}(M_{\pm})}=\frac{P^{\text{eq}}(M_{\pm})}{P^{\text{eq}}(M)}=\exp\left[-\beta
F_{\pm}(M)\right]\,,$ (6)

where

$\displaystyle P^{\text{eq}}(M)=Z(\beta)^{-1}\exp\left[-\beta F(M)\right]\,,$
(7)

denotes the equilibrium distribution with partition function $Z(\beta)$. In
(6), the free energy change $F_{\pm}(M)$ due to the transition $M\to M_{\pm}$
reads $F_{\pm}(M)=F(M_{\pm})-F(M)$.

###  2.1 Thermodynamic equilibrium prior to quench

We now take the thermodynamic limit $N\to\infty$. To this end, we define the
intensive magnetisation $m\equiv M/N$ per spin and the free-energy density

$\displaystyle\mathscr{F}(\beta,m)\equiv\lim_{N\to\infty}F(Nm)/N=\mathscr{E}(m)-\beta^{-1}\mathscr{S}^{\text{int}}(m),$
(8)

with internal energy density

$\displaystyle\mathscr{E}(m)=-Jm^{2}/2\,,$ (9)

and internal entropy per spin,

$\displaystyle\mathscr{S}^{\text{int}}(m)=-\sum_{\eta=\pm}\frac{1+\eta
m}{2}\ln\left(\frac{1+\eta m}{2}\right)\,.$ (10)

The equilibrium distribution in (7), written as a function of $m=M/N$, takes
the large-deviation form [29, 68, 69]

$\displaystyle
P^{\text{eq}}(m)\smilefrown\exp\left[-N\mathscr{V}^{\text{eq}}(m)\right]\,,$
(11)

with equilibrium rate function [62]

$\displaystyle\mathscr{V}^{\text{eq}}(m)=\beta\left[\mathscr{F}(\beta,m)-\mathscr{\bar{F}}(\beta)\right]\,.$
(12)

Here, the equilibrium free energy

$\displaystyle\mathscr{\bar{F}}(\beta)=\lim_{N\to\infty}\frac{1}{\beta N}\ln
Z(\beta)=\min_{m}\mathscr{F}(\beta,m)\,,$ (13)

arises as a consequence of the normalisation of $P^{\text{eq}}(M)$ in (7),
which ensures that $\mathscr{V}^{\text{eq}}(m)$ vanishes at its minima
$\pm\bar{m}(\beta)$, i.e., $\mathscr{V}^{\text{eq}}[\bar{m}(\beta)]=0$. The
magnetisation $\bar{m}(\beta)$ at the minima reflects the typical, most
likely, magnetisation that occurs at inverse temperature $\beta$ in the
thermodynamic limit. According to (11), the probability of fluctuations of $m$
away from $\pm\bar{m}(\beta)$ are exponentially suppressed in $N$ at a rate
given by $\mathscr{V}^{\text{eq}}(m)$.

Upon increasing $\beta$, $\mathscr{V}^{\text{eq}}(m)$ passes from a single
well into a symmetric double-well at the critical inverse temperature
$\beta_{\text{c}}=1/J$, reflecting a continuous equilibrium phase transition
[23]. Importantly, the changing topology of $\mathscr{V}^{\text{eq}}(m)$
distinguishes the different phases of the model.

Figure 1(a) shows the phase diagram of the Curie-Weiss model at vanishing
external field, as determined by the different topologies of
$\mathscr{V}^{\text{eq}}(m)$ as $\beta$ is varied.

Figure 1: (a) Phase diagram for the Curie-Weiss model at vanishing external
field, featuring the SM (solid, black line) and CE (dotted line) phases,
separated by the phase boundary at $\beta_{\text{c}}$. The equilibrium rate
functions $\mathscr{V}^{\text{eq}}$ in the two phases are shown in red and
blue. The orange arrow indicates the direction of the disordering quench. (b)
Spontaneous magnetisation $\bar{m}(\beta)$ in the SM and CE phases.

The phase diagram exhibits two distinct phases: a single-mode (SM) phase
(solid, black line) for $\beta<\beta_{\text{c}}$, where
$\mathscr{V}^{\text{eq}}$ [red in Figure 1(a)] has a unique minimum (white
bullet), and a coexistence (CE) phase (dotted line) for
$\beta>\beta_{\text{c}}$, where two degenerate, finite minima
$\pm\bar{m}(\beta)$ (black bullets) of $\mathscr{V}^{\text{eq}}$ (blue)
coexist.

In the CE phase, the system is said to be ordered, because $\bar{m}(\beta)>0$
implies that a large fraction of spins are aligned in either direction. In the
SM phase, the spontaneous magnetisation vanishes, $\bar{m}(\beta)=0$, meaning
that the contributions of up and down spins cancel each other, and the system
is said to be disordered. Close to $\beta_{\text{c}}$, the order parameter
$\bar{m}(\beta)$, given by the minima of $\mathscr{F}$ and
$\mathscr{V}^{\text{eq}}$, changes continuously from $\bar{m}(\beta)=0$
(disordered) to finite $\bar{m}(\beta)$ (ordered), as shown in Figure 1(b).

Objects like $\mathscr{V}^{\text{eq}}(m)$ or $\mathscr{F}(\beta,m)$, whose
minima $\pm\bar{m}(\beta)$ specify the order (or disorder) of the system, are
crucial tools for identifying equilibrium phase transitions, and are often
summarised under the term “Landau potentials” [21, 22]. The corresponding
Landau theory [23], aims at describing phase transitions by postulating a
phenomenological Landau potential solely based on the underlying, microscopic
symmetries of the problem. For the simple model we describe here, the Landau
potential can be derived explicitly.

The concept of Landau theory has proven useful also in non-equilibrium
contexts [59, 60, 61, 62], where it serves to identify different non-
equilibrium behaviours and dynamical order parameters. In Ref. [62], we
derived a dynamical Landau potential for a finite-time dynamical phase
transition in the magnetisation $m$ of the Curie-Weiss and other parity-
symmetric models. We briefly review this transition in the next section. In
Sec. 4 of this paper, we exploit the same idea for finite-time dynamical phase
transition of a thermodynamic observable, for which the corresponding
dynamical Landau potential has a different shape and behaviour.

###  2.2 Post-quench dynamics

At time $t<0$ we initialise the system in the CE phase at inverse temperature
$\beta>\beta_{\text{c}}$. Now, at $t=0$, we impose an instantaneous
temperature quench $\beta\to\beta_{\text{q}}$ into the SM phase, i.e.,
$\beta_{\text{q}}<\beta_{\text{c}}$. Such a quench is said to be “disordering”
as it forces the system to cross the phase boundary between the SM and CE
phases [orange arrow in Figure 1(a)], inducing an order-to-disorder phase
transition in the long-time limit [62]. Ergodicity ensures that $P(m,t)\to
P^{\text{eq}}_{q}(m)\smilefrown\exp[-N\mathscr{V}^{\text{eq}}_{\text{q}}(m)]$
as $t\to\infty$, where $\mathscr{V}^{\text{eq}}_{\text{q}}(m)$ is the
equilibrium rate function given in (12), but at final inverse temperature
$\beta_{\text{q}}$.

For $t>0$, the evolution of $P(m,t)$ is given by an appropriate thermodynamic
limit of (4). Due to the large-deviation form (11) before the quench and in
the long-time limit, we write the probability distribution as
$P(m,t)\smilefrown\exp[-NV(m,t)]$, with time-dependent rate function $V(m,t)$.
When the transition rates $W_{\pm}$ admit a well-defined thermodynamic limit

$\displaystyle w_{\pm}(q)=\lim_{N\to\infty}\frac{W_{\pm}(Nq)}{N}\,,\qquad
0<w_{\pm}(q)<\infty\,,$ (14)

then (4) transforms into a Hamilton-Jacobi equation for $V(m,t)$ [73, 74, 75,
62]:

$\displaystyle 0=\partial_{t}V(m,t)+\mathscr{H}[m,\partial_{m}V(m,t)]\,,$ (15)

in the large-$N$ limit. For the Curie-Weiss model, the dynamical Hamiltonian
$\mathscr{H}$ reads

$\displaystyle\mathscr{H}(q,p)$
$\displaystyle=w_{+}(q)\left(\text{e}^{2p}-1\right)+w_{-}(q)\left(\text{e}^{-2p}-1\right)\,,$
(16)

including the $N$-scaled transition rates

$\displaystyle w_{\pm}(q)=\frac{1\mp
q}{2\tau}\exp\left[\mp\beta_{\text{q}}\mathscr{E}^{\prime}(q)\right]=\frac{1\mp
q}{2\tau}\exp\left(\pm\beta_{\text{q}}Jq\right)\,.$ (17)

The initial condition of (15) is given by the equilibrium rate function
$\mathscr{V}^{\text{eq}}$ before the quench,

$\displaystyle V(m,0)=\mathscr{V}^{\text{eq}}(m)\,.$ (18)

Because of the parity symmetry $m\to-m$ of the problem, the dynamical
Hamiltonian $\mathscr{H}$ is invariant under inversion
$\mathscr{H}(q,p)=\mathscr{H}(-q,-p)$ of $q$ and $p$. Furthermore,
$\mathscr{H}$ satisfies a shift-inversion symmetry in $p$, with respect to the
equilibrium rate function $\mathscr{V}^{\text{eq}}_{\text{q}}$ at inverse
temperature $\beta_{\text{q}}$:

$\displaystyle\mathscr{H}(q,p)=\mathscr{H}\left[q,-p+\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}_{\text{q}}(q)\right]\,,$
(19)

which implies
$\mathscr{H}(q,0)=\mathscr{H}[q,\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}_{\text{q}}(q)]=0$.

Solutions to the Hamilton-Jacobi equation (15) are expressed in terms of the
characteristics $q(s)$ and $p(s)=\partial_{m}V[q(s),s]$, $0\leq s\leq t$, that
solve the Hamilton equations [76]

$\displaystyle\dot{q}(s)=\partial_{p}\mathscr{H}(q,p)\,,\quad\dot{p}(s)=-\partial_{q}\mathscr{H}(q,p)\,.$
(20)

For quenches into the SM phase, the Hamilton equations have a single fixed
point at

$\displaystyle q_{\text{FP}}=p_{\text{FP}}=0\,,$ (21)

where $\dot{q}=\dot{p}=0$. Trajectories may approach the fixed point
asymptotically (as $t\to\infty$) along the stable manifold

$\displaystyle p_{\text{s}}(q)=0\,.$ (22)

Asymptotic escape away from the fixed point, by contrast, must occur along the
unstable manifold

$\displaystyle
p_{\text{u}}(q)=\tfrac{\text{d}}{\text{d}m}\mathscr{V}_{\text{q}}^{\text{eq}}(q)=-\beta_{\text{q}}q+\frac{1}{2}[\log(1+q)-\log(1-q)]\,.$
(23)

Figure 2(a) shows a phase portrait of the Hamiltonian dynamics (20). The
stable and unstable manifolds, $p_{\text{s}}(q)$ and $p_{\text{u}}(q)$, are
shown in black, with arrow heads pointing toward and away from the fixed point
(white bullet), respectively. The initial condition for $p$,

$\displaystyle p(0)=$
$\displaystyle\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}[q(0)]\,,$
(24a) [solid gray line in Figure 2(a)] follows from (18), while the final
condition $\displaystyle q(t)=$ $\displaystyle m\,,$ (24b)

[dotted gray line in Figure 2(a)] ensures that the rate function $V(m,t)$ is
obtained as

$\displaystyle
V(m,t)=\int_{0}^{t}\text{d}s\left[p\dot{q}-\mathscr{H}(q,p)\right]+\mathscr{V}^{\text{eq}}[q(0)]\,.$
(25)

In case there are multiple pairs $[q(s),p(s)]_{0\leq s\leq t}$ of
characteristics that solve (20) with boundary conditions (24), one must pick
the pair that minimises $V(m,t)$, since the probabilities of all other
solutions are exponentially suppressed [62]. The minimising characteristic
$q(s)$ represents the most probable way to realise the magnetisation $q(t)=m$
at time $t$, called the optimal fluctuation for the event. In particular,
$q(0)=m_{0}(m,t)$ denotes the optimal initial magnetisation, which is a
function of $m$ and $t$. In Ref. [62], $m_{0}(m,t)$ was shown to take the role
of a dynamical order parameter for a finite-time dynamical phase transition in
the magnetisation $m$.

At small times $t\ll\tau$ the optimal fluctuation is given by the inactivity
solution $q(s)=p(s)=0$ which resides at the fixed point (21) [white bullet in
Figure 2(a)] of the dynamics. However, when $t$ exceeds a critical time
$t_{\text{c}}$, non-trivial optimal fluctuations (coloured lines) occur. For
times slightly above $t_{\text{c}}$, they remain close to
$(q_{\text{FP}},p_{\text{FP}})$, but depart more and more from the fixed point
as $t$ increases further, with their initial points eventually approaching the
minima (black bullets) of the initial equilibrium rate function
$\mathscr{V}^{\text{eq}}$. As $t\to\infty$, the dynamics moves entirely on the
stable manifold (black line with inward pointing arrows) of the fixed point.

The switch of the optimal fluctuation at $t=t_{\text{c}}$ from the inactivity
solution [white bullet in Figure 2(a)] for $t\leq t_{\text{c}}$ to non-trivial
trajectories (coloured lines) for $t>t_{\text{c}}$ gives rise to a finite-time
cusp singularity in $V(m,t)$ at $m=0$ for $t>t_{\text{c}}$, shown in Figure
2(b). In close analogy with the equilibrium transition of the model, this cusp
can be interpreted as a continuous, finite-time dynamical phase transition,
with dynamical order parameter $m_{0}(m,t)$, the optimal initial magnetisation
[62]. Figure 2(c) shows how $m_{0}(0,t)$ transitions from zero to a finite
value at the critical time $t_{\text{c}}$. The time-dependent, optimal initial
magnetisation $m_{0}(0,t)$ represents the dynamical analogue of
$\bar{m}(\beta)$ at equilibrium [see Figure 1(b)]. The dynamical order
parameter $m_{0}$ is given by the minimum of a dynamical Landau potential
$\mathscr{L}^{m,t}(m_{0})$, the analogue of $\mathscr{V}^{\text{eq}}$ for this
transition, that passes from a single into a double well at the critical time
$t_{\text{c}}$ [62].

Figure 2: (a) Phase portrait of the Hamilton equations (20) featuring the
fixed point (white bullet), the stable and unstable manifolds (black lines),
and the level lines of $\mathscr{H}$ (light brown lines). Gray solid and
dotted lines show the initial and final conditions in (24), respectively.
Coloured lines show optimal fluctuations for $t>t_{\text{c}}$, with arrows
indicating the evolution in time, for $t/\tau=0.55$ (blue), $0.57$ (magenta),
$0.7$ (red), $1$ (orange), $1.75$ (yellow), and $5$ (green). (b) Rate function
$V(m,t)$ after disordering quench. The initial equilibrium rate function
$\mathscr{V}^{\text{eq}}$ (solid black line) evolves into $V(m,t)$ at
$t/\tau=0.5$ (blue), $0.8$ (red), and $1.5$ (yellow), toward the final
equilibrium rate function $\mathscr{V}^{\text{eq}}_{\text{q}}$ (dotted line).
Arrows indicate the time evolution. (c) Dynamical order parameter $m_{0}(m,t)$
as function of $t$ at $m=0$.

###  2.3 Thermodynamic observables

Since no work is performed on the system during the temperature quench, its
stochastic thermodynamics [30, 32] is determined by the statistics of the heat
per spin $\mathscr{Q}$ exchanged between the system and the bath, and the
entropy $\Sigma$ produced (per spin) in the relaxation process.

In our dimensionless formulation, $\mathscr{Q}$ is equal to the negative
entropy flow per spin, $\mathscr{Q}=-\mathscr{S}^{\text{e}}$, given by the
negative energy change of the system, multiplied by $\beta_{\text{q}}$:

$\displaystyle\mathscr{Q}(m,m^{\prime})=-\beta_{\text{q}}[\mathscr{E}(m)-\mathscr{E}(m^{\prime})]\,.$
(26)

Here $m^{\prime}$ and $m$ denote two magnetisations before and after the
quench, respectively. Both $m^{\prime}$ and $m$ are random variables which
depend on the thermal fluctuations of the heat baths before and after the
quench. The probability distribution $P(\mathscr{Q},t)$ of $\mathscr{Q}$ is
constrained by a detailed fluctuation relation [77, 30]

$\displaystyle\frac{P(\mathscr{Q},t)}{P(-\mathscr{Q},t)}=\exp\left[-N(\beta/\beta_{\text{q}}-1)\mathscr{Q}\right]\,,$
(27)

which relates the negative and positive branches of $P(\mathscr{Q},t)$. We
prove (27) for the present setup in A.

The entropy generated during the relaxation, again for an initial
magnetisation $m^{\prime}$ and a final magnetisation $m$ at time $t$, is then
given by

$\displaystyle\Sigma(m,m^{\prime},t)=V(m,t)-\mathscr{V}^{\text{eq}}(m^{\prime})-\beta_{\text{q}}[\mathscr{F}(m)-\mathscr{F}(m^{\prime})]\,.$
(28)

The last two terms correspond the negative change in free energy density after
the quench. The first two terms constitute the entropy change related to the
probabilities of the states $m^{\prime}$ and $m$ [78].

##  3 Statistics of thermodynamic observables

The instantaneous nature of the temperature quench $\beta\to\beta_{\text{q}}$
at $t=0$ leads to expressions for observables such as $\mathscr{Q}$ and
$\Sigma$ in terms of differences of state functions, i.e.,
$-\beta_{\text{q}}\mathscr{E}$ and $V-\beta_{\text{q}}\mathscr{F}$ in (26) and
(28), respectively, evaluated at $(m,t)$ and $(m^{\prime},0)$. As such,
$\mathscr{Q}$ and $\Sigma$ depend only on the initial and final states,
$m^{\prime}$ and $m$, and on time $t$, but are otherwise independent of the
specific path $m(t)$ taken by the dynamics. For observables of this kind, it
turns out convenient to use generating functions to compute their probability
distributions.

Based on this idea, we now develop a general theory the large-deviation
statistics of such observables that applies to systems subject to quenches of
the temperature or of another external parameters. This includes, but is not
limited to, the thermodynamic observables $\mathscr{Q}$ and $\Sigma$.

We define the moment-generating function $G(k,t)$ of an intensive state-
variable difference

$\displaystyle\Delta\mathscr{A}=\mathscr{A}(m,t)-\mathscr{A}(m^{\prime},0)\,,$
(29)

by

$\displaystyle G(k,t)=\langle\text{e}^{Nk\Delta\mathscr{A}}\rangle\,.$ (30)

Note that the explicit time dependence of $\mathscr{A}$ in (29) is absent for
$\mathscr{Q}$ but present in $\Sigma$. Conditioning (30) on the initial and
final magnetisations $m^{\prime}$ and $m$, we write

$\displaystyle
G(k,t)=\sum_{m,m^{\prime}}\langle\text{e}^{Nk\Delta\mathscr{A}}|m,t;m^{\prime},0\rangle
P(m,t;m^{\prime},0)\,,$ (31)

where $P(m,t;m^{\prime},0)$ denotes the joint probability of observing $m$ at
time $t$ and $m^{\prime}$ at vanishing initial time. Because the observable
$\Delta\mathscr{A}$ in (31) depends only on $m$, $m^{\prime}$, and $t$, the
conditioning renders $\Delta\mathscr{A}$ deterministic, so that
$\langle\text{e}^{Nk\Delta\mathscr{A}}|m,t;m^{\prime},0\rangle=\text{e}^{Nk\Delta\mathscr{A}}$.
Furthermore, we write the joint probability in (31) as
$P(m,t;m^{\prime},0)=P_{\text{q}}(m,t|m^{\prime},0)P^{\text{eq}}(m^{\prime})$,
where $P_{\text{q}}(m,t|m^{\prime},0)$ denotes the probability of observing
magnetisation $m$ at time $t$ conditional on starting with $m^{\prime}$ at
time $t=0$. The subscript $q$ emphasises that the dynamics is due to the heat
bath at quenched inverse temperature $\beta_{\text{q}}$. After these
manipulations, (31) reads

$\displaystyle
G(k,t)=\sum_{m,m^{\prime}}\text{e}^{Nk[\mathscr{A}(m,t)-\mathscr{A}(m^{\prime},0)]}P_{\text{q}}(m,t|m^{\prime},0)P^{\text{eq}}(m^{\prime})\,,$
(32)

We now define the “$k$-tilted” initial probability distribution

$\displaystyle P_{k}(m^{\prime},0)\equiv
Z_{k}^{-1}\text{e}^{-Nk\mathscr{A}(m^{\prime},0)}P^{\text{eq}}(m^{\prime})\,,$
(33)

with $Z_{k}$ obtained from normalisation. Summing over $m^{\prime}$ in (32) we
then arrive at

$\displaystyle G(k,t)=Z_{k}\langle\text{e}^{Nk\mathscr{A}}\rangle_{k}\,,$ (34)

where $\langle\ldots\rangle_{k}$ denotes the average with respect to the time-
evolved, $k$-tilted distribution

$\displaystyle
P_{k}(m,t)=\sum_{m^{\prime}}P_{\text{q}}(m,t|m^{\prime},0)P_{k}(m^{\prime},0)\,.$
(35)

Equation (34) has the advantage that the observable $\mathscr{A}(m,t)$ is
independent of the initial state $m^{\prime}$, in distinction to
$\Delta\mathscr{A}$ in (30), which depends on both $m^{\prime}$ and $m$.

###  3.1 Thermodynamic limit

In the thermodynamic limit $N\to\infty$, the probability distribution of an
intensive observable $\Delta\mathscr{A}$ typically takes a large-deviation
form [29, 68, 69]

$\displaystyle
P(\Delta\mathscr{A},t)\smilefrown\text{e}^{-NI(\Delta\mathscr{A},t)}\,,$ (36)

with non-negative rate function $I(\Delta\mathscr{A},t)\geq 0$. The location
of the vanishing minimum of $I(\Delta\mathscr{A},t)$ is given by the typical,
most probable value of $\Delta\mathscr{A}$, which coincides with its mean
$\langle\Delta\mathscr{A}\rangle$, i.e.,
$I(\langle\Delta\mathscr{A}\rangle,t)=0$, in the thermodynamic limit. Away
from this minimum, the rate function quantifies the exponentially suppressed
probabilities of deviations from the typical behaviour, thus generalising the
central-limit theorem [29, 68, 69]. In other words, the rate function
$I(\Delta\mathscr{A},t)$ provides us with the time-dependent statistics of
$\Delta\mathscr{A}$, to leading exponential order, in the thermodynamic limit.

It is convenient to use the scaled cumulant-generating function

$\displaystyle\Lambda(k,t)\equiv\lim_{N\to\infty}\frac{1}{N}\ln G(k,t)\,,$
(37)

to obtain $I(\Delta\mathscr{A},t)$ by Legendre transform [29, 68, 69]

$\displaystyle
I(\Delta\mathscr{A},t)=\max_{k}\\{k\Delta\mathscr{A}-\Lambda(k,t)\\}\,.$ (38)

The scaled cumulants of $\Delta\mathscr{A}$ are given by the derivatives of
$\Lambda(k,t)$, evaluated at $k=0$. In particular, the mean is given by the
slope at $k=0$,

$\displaystyle\langle\Delta\mathscr{A}\rangle=\partial_{k}\Lambda(0,t)\,.$
(39)

For $\Delta\mathscr{A}=\mathscr{Q}$, the detailed fluctuation relation (27)
implies a symmetry for $\Lambda(k,t)$ about the inflection point
$k_{0}=(\beta/\beta_{\text{q}}-1)/2$:

$\displaystyle\Lambda(k+k_{0},t)=\Lambda(-k+k_{0},t)\,.$ (40)

In order to derive an expression for $\Lambda(k,t)$, we take the thermodynamic
limit of (34) using the large-deviation form

$\displaystyle P_{k}(m,t)\smilefrown\text{e}^{-NV_{k}(m,t)}\,,$ (41)

for the $k$-tilted probability distribution, with $k$-tilted rate function
$V_{k}(m,t)$. In the limit $N\to\infty$, the sum in (34) turns into an
integral that we evaluate by a saddle-point approximation. We collect the
exponential terms and substitute them into (37), which yields

$\displaystyle\Lambda(k,t)=-\min_{m}\left\\{W_{k}(m,t)\right\\}\,,$ (42)

where

$\displaystyle W_{k}(m,t)=-k\mathscr{A}(m,t)+V_{k}(m,t)-\zeta_{k}\,.$ (43)

Equation (42) expresses $\Lambda(k,t)$ as the negative minimum of the
potential function $W_{k}(m,t)$, that we identify as a dynamical Landau
potential in Sec. 4. The $k$-dependent constant

$\displaystyle\zeta_{k}=\lim_{N\to\infty}\frac{1}{N}\ln Z_{k}\,,$ (44)

in (43) originates from the normalisation of the tilted rate function
$V_{k}(m,t)$, but cancels in the expressions of $W_{k}(m,t)$ and
$\Lambda(k,t)$, as we shall see.

From (35), we observe that the $k$-tilted rate function $V_{k}(m,t)$ obeys, up
to different boundary conditions, the same Hamilton-Jacobi equation (15) as
the “untilted” magnetisation rate function $V(m,t)=V_{k=0}(m,t)$, so that the
time-evolution of $W_{k}(m,t)$ is dictated by (15) through (43). The initial
condition for $V_{k}(m,t)$ follows from the large-deviation form of
$P_{k}(m,0)$

$\displaystyle
V_{k}(m,0)=k\mathscr{A}(m,0)+\mathscr{V}^{\text{eq}}(m)+\zeta_{k}\,,$ (45)

see (33).

We find it instructive to compute $I(\Delta\mathscr{A},t)$ at $t=0$ with what
we have derived so far. Substituting the boundary condition (45) into (42) at
$t=0$, we find $W_{k}(m,0)=\mathscr{V}^{\text{eq}}(m)$. Equation (42) then
gives $\Lambda(k,0)=0$ for all $k$. Performing the Legendre transform (38), we
find $P(\Delta\mathscr{A},0)=\delta(\Delta\mathscr{A})$ which reflects that
the state-difference observable $\Delta\mathscr{A}$ in (29) is initially
identically zero, as expected.

###  3.2 Post-quench dynamics of $W_{k}(m,t)$

At finite time $t>0$ after the quench, $V_{k}(m,t)$ is the solution of the
Hamilton-Jacobi equation (15) with initial condition (45). Equation (15) is
solved by a $k$-dependent family of characteristics
$[q_{k}(s),p_{k}(s)]_{0\leq s\leq t}$ that are solutions to the Hamilton
equations (20) with $k$\- and $m$-dependent boundary conditions:

$\displaystyle
p_{k}(0)=k\partial_{m}\mathscr{A}[q_{k}(0),0]+\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}[q_{k}(0)]\,,\quad
q_{k}(t)=$ $\displaystyle m\,.$ (46)

An expression for $V_{k}(m,t)$ is then given by the $k$-tilted analogue of
(25),

$\displaystyle
V_{k}(m,t)=\int_{0}^{t}\text{d}s\left[p_{k}\dot{q}_{k}-\mathscr{H}(q_{k},p_{k})\right]+V_{k}[q_{k}(0),0]\,.$
(47)

Using (43), we can now write $W_{k}(m,t)$ in terms of the characteristics
$[q_{k}(s),p_{k}(s)]_{0\leq s\leq t}$ as

$\displaystyle
W_{k}(m,t)=\int_{0}^{t}\text{d}s\left[p_{k}\dot{q}_{k}-\mathscr{H}(q_{k},p_{k})\right]+\mathscr{V}^{\text{eq}}[q_{k}(0)]-k\\{\mathscr{A}[q_{k}(t),t]-\mathscr{A}[q_{k}(0),0]\\}\,.$
(48)

In order to obtain $\Lambda(k,t)$ from (48) and (42) one must solve the
Hamilton equations (20) with boundary conditions (46) on a two-dimensional
grid in both $k$ and $m$. In the next section, we derive a direct method for
computing $\Lambda(k,t)$ that requires only a one-dimensional $k$ grid.

###  3.3 Post-quench dynamics of $\Lambda(k,t)$

Equation (48) provides an expression for $W_{k}(m,t)$ for given $m$ and $t$.
The scaled cumulant-generating function $\Lambda(k,t)$ in (42), however,
requires only the value $W_{k}(m^{*}_{k},t)$ where $W_{k}(m,t)$ acquires its
minimum, i.e., $\partial_{m}W_{k}(m^{*}_{k},t)=0$. The minimum value
$W_{k}(m^{*}_{k},t)$ can be obtained directly by imposing
$\partial_{m}W_{k}(m^{*}_{k},t)=0$ as a boundary condition, in addition to
(45). Written as a condition for $V_{k}(m,t)$, one finds

$\displaystyle\partial_{m}V_{k}(m_{k}^{*},t)=k\partial_{m}\mathscr{A}(m_{k}^{*},t)\,,$
(49)

at time $t$. This boundary condition leads to yet another family of
characteristics $[q^{*}_{k}(s),p^{*}_{k}(s)]_{0\leq s\leq t}$, which, again,
obey the Hamilton equations (20), but now with $m$-independent boundary
conditions

$\displaystyle p^{*}_{k}(0)=$ $\displaystyle
k\partial_{m}\mathscr{A}[q^{*}_{k}(0),0]+\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}[q^{*}_{k}(0)]\,,$
(50a) $\displaystyle p^{*}_{k}(t)=$ $\displaystyle
k\partial_{m}\mathscr{A}[q_{k}^{*}(t),t]\,.$ (50b)

These boundary conditions ensure that $q_{k}^{*}(t)=m_{k}^{*}$ is an extremum
of $W_{k}(m,t)$. Using the set of characteristics
$[q^{*}_{k}(s),p^{*}_{k}(s)]_{0\leq s\leq t}$, we directly express
$\Lambda(k,t)$ as

$\displaystyle\Lambda(k,t)=-\int_{0}^{t}\text{d}s\left[p^{*}_{k}\dot{q}^{*}_{k}-\mathscr{H}(q^{*}_{k},p^{*}_{k})\right]-\mathscr{V}^{\text{eq}}[q^{*}_{k}(0)]+k\\{\mathscr{A}[q^{*}_{k}(t),t]-\mathscr{A}[q^{*}_{k}(0),0]\\}\,.$
(51)

In the particular case $\Delta\mathscr{A}=\mathscr{Q}$, the shift-inversion
symmetry (19) of $\mathscr{H}$, combined with the boundary conditions (50),
implies a time-reversal symmetry for characteristics below and above $k_{0}$,

$\displaystyle q^{*}_{k+k_{0}}(s)=q^{*}_{-k+k_{0}}(t-s)\,,\qquad
p^{*}_{k+k_{0}}(s)=-p^{*}_{-k+k_{0}}(t-s)+\mathscr{V}^{\text{eq}}_{\text{q}}[q^{*}_{-k+k_{0}}(t-s)]\,.$
(52)

This is a generalisation of the detailed fluctuation relation (40) to the
level of optimal fluctuations, which can be seen by recovering (40) from (51)
and (52).

Depending on whether we intend to compute $W_{k}(m,t)$ or $\Lambda(k,t)$, we
solve the Hamilton equations (20) with either boundary conditions, (46) or
(50), by a shooting method [62]. This returns families of characteristics on a
grid of $k$ (and $m$) values, enabling us to evaluate either $W_{k}(m,t)$ in
(43), or $\Lambda(k,t)$ in (51) on this grid.

###  3.4 Rate function

Finally, we compute the rate function $I(\Delta\mathscr{A},t)$ from
$\Lambda(k,t)$ using the Legendre transform in (38). To this end, we evaluate

$\displaystyle\Delta\mathscr{A}(k^{*})=\partial_{k}\Lambda(k^{*},t)=\mathscr{A}[q^{*}_{k^{*}}(t),t]-\mathscr{A}[q^{*}_{k^{*}}(0),0]\,,$
(53)

which gives an implicit equation for the value $k^{*}$ where the right-hand
side of (38) acquires its maximum. The second equality in (53) follows by
taking a $k$ derivative of (51),

$\displaystyle\partial_{k}\Lambda(k,t)=\mathscr{A}[q^{*}_{k}(t),t]-\mathscr{A}[q^{*}_{k}(0),0]+\int_{0}^{t}\text{d}s\left[\frac{\delta\Lambda}{\delta
p^{*}_{k}}\frac{\partial p^{*}_{k}}{\partial k}+\frac{\delta\Lambda}{\delta
q^{*}_{k}}\frac{\partial q^{*}_{k}}{\partial k}\right]\,.$ (54)

The integral in (54) vanishes due to the variational principle
$\delta\Lambda=0$, which implies $\delta\Lambda/\delta
q_{k}^{*}=\delta\Lambda/\delta p_{k}^{*}=0$, see B.

By inverting (53) we obtain the function $k^{*}(\Delta\mathscr{A},t)$ and
express (38) as

$\displaystyle
I(\Delta\mathscr{A},t)=k^{*}(\Delta\mathscr{A},t)\Delta\mathscr{A}-\Lambda[k^{*}(\Delta\mathscr{A},t),t]\,.$
(55)

Equation (55) is the sought-after expression for the rate function
$I(\Delta\mathscr{A},t)$. The outlined method works for arbitrary
$\Delta\mathscr{A}$, as long as it can be written as a difference of state
functions. For the post-quench dynamics we analyse here, the thermodynamic
observables $\mathscr{Q}$ and $\Sigma$ fall into this category.

We note that since our method uses generating functions and the Legendre
transform, $I(\Delta\mathscr{A},t)$ obtained from (55) is always convex. In
cases where the underlying rate function has a non-convex part, such as e.g.,
$V(m,t)$ in Figure 2(b), (55) returns only its convex hull, and the
information stored in the non-convex part is lost. Non-convex parts in rate
functions are signalled by non-differentiable points [69] in the scaled-
cumulant generating function $\Lambda(k,t)$ in (37).

For the thermodynamic observables of the Curie-Weiss model, $\Lambda(k,t)$
turns out to be differentiable in its domain, and (55) returns the exact rate
function. As a simple but non-trivial example of $\Delta\mathscr{A}$ where
non-convexity does play a role, one may consider the magnetisation itself,
$\Delta\mathscr{A}=m$, so that $\mathscr{A}(m,t)=m$ and
$\mathscr{A}(m^{\prime},0)=0$. In this case, the scaled cumulant generating
function $\Lambda(k,t)$ has a sharp kink at $k=0$, because the magnetisation
rate function $V(m,t)$ is non-convex between its minima for all finite times,
see Figure 2(b). The rate function $I(m,t)$ obtained from (55) then gives the
convex hull of $V(m,t)$, which, in particular, misses the kink of $V(m,t)$ at
the origin.

###  3.5 Long-time limit

In the long-time limit, the evaluation of $\Lambda(k,t)$ simplifies
considerably. This is seen most directly by taking the long-time limit of
$G(k,t)$ in (32), where the conditional probability converges to the
equilibrium probability distribution $P^{\text{eq}}_{\text{q}}$ at the
quenched inverse temperature $\beta_{\text{q}}$,
$\lim_{t\to\infty}P_{\text{q}}(m,t|m^{\prime},0)=P^{\text{eq}}_{\text{q}}(m)$.
We can then write the limit $G_{\infty}(k)\equiv\lim_{t\to\infty}G(k,t)$ as

$\displaystyle
G_{\infty}(k)=\langle\text{e}^{Nk\mathscr{A}_{\infty}(m)}\rangle^{\text{eq}}_{q}\langle\text{e}^{-Nk\mathscr{A}(m^{\prime},0)}\rangle^{\text{eq}}\,,$
(56)

where $\mathscr{A}_{\infty}(m)\equiv\lim_{t\to\infty}\mathscr{A}(m,t)$;
$\langle\ldots\rangle^{\text{eq}}$ and
$\langle\ldots\rangle^{\text{eq}}_{\text{q}}$ denote averages with respect to
the equilibrium distributions $P^{\text{eq}}$ and $P^{\text{eq}}_{\text{q}}$,
respectively. Taking the thermodynamic limit, we use the large-deviation forms
of these distributions and evaluate the integrals over $m$ and $m^{\prime}$ in
the saddle-point approximation. This leads us to an expression for
$\Lambda_{\infty}(k)\equiv\lim_{t\to\infty}\Lambda(k,t)$ in terms of a
maximisation over initial and final states $m$ and $m^{\prime}$, given by

$\displaystyle\Lambda_{\infty}(k)=\max_{m}\\{k\mathscr{A}_{\infty}(m)-\mathscr{V}^{\text{eq}}_{q}(m)\\}+\max_{m^{\prime}}\\{-k\mathscr{A}(m^{\prime},0)-\mathscr{V}^{\text{eq}}(m^{\prime})\\}\,.$
(57)

To connect this to our previous results, we write (57) as a function of the
initial and final points, $q_{k}^{*}(0)$ and $q_{k}^{*}(\infty)$, of an
infinite-time optimal fluctuation:

$\displaystyle\Lambda_{\infty}(k)=k\mathscr{A}_{\infty}[q_{k}^{*}(\infty)]-\mathscr{V}^{\text{eq}}_{\text{q}}[q_{k}^{*}(\infty)]-k\mathscr{A}[q_{k}^{*}(0),0]-\mathscr{V}^{\text{eq}}[q_{k}^{*}(0)]\,.$
(58)

In order for the optimal fluctuation to fulfil the boundary conditions (50) in
infinite time, it must initiate on the stable manifold, pass through the fixed
point at $(q_{\text{FP}},p_{\text{FP}})=(0,0)$, and either stay there [when
$q_{k}^{*}(\infty)=0$], or end on the unstable manifold [when
$q_{k}^{*}(\infty)\neq 0$]. Combining (22) with (50a) at $q=q_{k}^{*}(0)$ and
(23) with (50b) at $q=q_{k}^{*}(\infty)$, we find that the initial and end
points must satisfy

$\displaystyle 0=$ $\displaystyle
k\partial_{m}\mathscr{A}[q_{k}^{*}(0),0]+\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}[q_{k}^{*}(0)]\,,$
(59a) $\displaystyle 0=$ $\displaystyle
k\partial_{m}\mathscr{A}_{\infty}[q_{k}^{*}(\infty)]-\tfrac{\text{d}}{\text{d}m}\mathscr{V}^{\text{eq}}_{\text{q}}[q_{k}^{*}(\infty)]\,.$
(59b)

In case there are several solutions to (59), we must pick the combination of
$q_{k}^{*}(0)$ and $q_{k}^{*}(\infty)$ for which the right-hand side of (58)
takes its maximum value. This approach leads to explicit expressions for the
scaled cumulant-generating function $\Lambda_{\infty}(k)$ and for the initial
and final points of $q_{k}^{*}(s)_{0\leq s\leq\infty}$ in the infinite-time
limit.

##  4 Finite-time dynamical phase transition

We now apply the theory developed in the previous section to the time-
dependent large-deviation statistics of $\mathscr{Q}$ in the Curie-Weiss
model.

In order to compute $\Lambda(k,t)$ at finite time $t$, we solve the
Hamiltonian equations (20) with boundary conditions (50) to obtain
$[q^{*}_{k}(s),p^{*}_{k}(s)]_{0\leq s\leq t}$ for a grid of $k$ values, and
evaluate (51) on this grid.

Figure 3: Post-quench evolution of scaled-cumulant generating function
$\Lambda(k,t)$ for $\beta=5/(4J)$ and $\beta_{\text{q}}=1/(2J)$. Arrows
indicate changes in time. (a) $\Lambda(k,t)$ for $t/\tau=0.25$ (blue), $0.5$
(red), $1$ (yellow), $1.5$ (green), and $\infty$ (dotted). (b) Magnified view
of the flat region in Figure 3(a), including $\Lambda(k,t)$ for $t/\tau=0.75$
(orange). (c)–(d) Initial and final magnetisations $q^{*}_{k}(0)$ and
$q^{*}_{k}(t)$ for $t/\tau=0.25$ (blue), $0.5$ (red), $1$ (orange), $1.25$
(yellow), $2$ (green), and $\infty$ [dotted, obtained from (59)].

Figure 3(a) shows $\Lambda(k,t)$ at different times $t>0$ after the quench. We
observe that $\Lambda(k,t)$ has an initially parabolic shape, but develops a
flat region around its inflection point $k_{0}=(\beta/\beta_{\text{q}}-1)/2$
at a finite, critical time $t^{\mathscr{Q}}_{\text{c}}$. This critical time is
of the order of the microscopic relaxation time $\tau$, and is specified in
Sec. 4.1.2. For $t/\tau>1$, we observe quick convergence towards the long-time
limit $\Lambda_{\infty}(k)$ (dotted line), obtained from (57). Figure 3(b)
shows a magnification of the flat region in Figure 3(a); the arrows indicate
the evolution in time.

Figures 3(c) and (d) show the optimal initial and final magnetisations
$q^{*}_{k}(0)$ and $q^{*}_{k}(t)$ at different times. Note that there exists
an equivalent, negative pair $-q^{*}_{k}(0)$ and $-q^{*}_{k}(t)$, due to the
parity symmetry $m\to-m$ of the problem. Furthermore, the time-reversal
symmetry (52), evaluated at $s=0$, relates the initial and end points of the
optimal fluctuations in Figures 3(c) and (d).

At short times when $\Lambda(k,t)$ is parabolic, both $q^{*}_{k}(0)$ and
$q^{*}_{k}(t)$ are finite. For $t>t^{\mathscr{Q}}_{\text{c}}$, by contrast,
$q^{*}_{k}(0)=q^{*}_{k}(t)=0$ in the finite $k$ region around $k_{0}$ where
$\Lambda(k,t)$ is flat. This indicates that the inactivity solution
$q^{*}_{k}(s)=p^{*}_{k}(s)=0$ is the optimal fluctuation within this $k$
interval, leading to the flat region in $\Lambda(k,t)$. Substituting this
solution into (51), we find the constant value
$\Lambda(k,t)=-\mathscr{V}^{\text{eq}}(0)=\ln(2)+\beta\mathscr{\bar{F}}(\beta)\approx-0.0359$
within the flat region. For longer times, we observe convergence, indicated by
the black arrows, of the initial and end points $q^{*}_{k}(0)$ and
$q^{*}_{k}(t)$ toward the asymptotic, long-time solution (dotted lines),
obtained from (59). From (57) we obtain the asymptotic boundaries
$k_{\text{min}}$ and $k_{\text{max}}$ of the flat interval as

$\displaystyle
k_{\text{min}}=\frac{\beta-\beta_{\text{c}}}{\beta_{\text{q}}}\,,\qquad
k_{\text{max}}=\frac{\beta_{\text{c}}-\beta_{\text{q}}}{\beta_{\text{q}}}\,,$
(60)

which evaluate to $k_{\text{min}}=1/2$ and $k_{\text{max}}=1$ for the
parameters of Figure 3.

Figure 4: Post-quench evolution of rate function $I(\mathscr{Q},t)$ for
$\beta=5/(4J)$ and $\beta_{\text{q}}=1/(2J)$. Arrows indicate changes in time.
(a) $I(\mathscr{Q},t)$ for $t/\tau=0.25$ (blue), $0.5$ (red), $1$ (orange),
$2$ (green) and $\infty$ (dotted). (b) Derivative
$\partial_{\mathscr{Q}}I(\mathscr{Q},t)$ in small interval around kink.
(c)–(d) Initial and final magnetisations $q^{*}_{k^{*}}(0)$ and
$q^{*}_{k^{*}}(t)$ for times $t/\tau=0.25$ (blue), $0.5$ (red), $1$ (orange),
$1.5$ (green) and $\infty$ (dotted).

By the Legendre transform (38) of $\Lambda(k,t)$, we obtain the rate function
$I(\mathscr{Q},t)$, shown in Figure 4(a). At the critical time
$t^{\mathscr{Q}}_{\text{c}}$ when $\Lambda(k,t)$ starts developing the flat
region, $I(\mathscr{Q},t)$ acquires a kink around vanishing $\mathscr{Q}$. The
location $\mathscr{Q}=0$ of the kink is determined by the vanishing slope of
the flat $k$-interval in $\Lambda(k,t)$. At the kink, the derivative
$\partial_{\mathscr{Q}}I(\mathscr{Q},t)$ attains a finite jump, centered at
$k_{0}$ [see Figure 4(b)], whose magnitude, in turn, corresponds to the width
of the flat $k$-interval in $\Lambda(k,t)$.

The minimum of the rate function represents the typical, average, amount of
heat $\langle\mathscr{Q}\rangle$ exchanged between the system and the bath. As
time evolves, $\langle\mathscr{Q}\rangle$ takes increasingly negative values,
because the bath transfers heat into the spin system to increase its
temperature, $\beta\to\beta_{\text{q}}$. For $t\gg\tau$,
$\langle\mathscr{Q}\rangle$ settles at a finite value while the spins
equilibrate with the bath. During this process, the value $I(0,t)$ of the rate
function at the kink increases, which implies that the event $\mathscr{Q}=0$
becomes less typical, i.e., less probable, at larger times.

Figures 4(c) and (d) show the (positive) initial and final magnetisations
$q^{*}_{k^{*}}(0)$ and $q^{*}_{k^{*}}(t)$ as functions of the heat
$\mathscr{Q}$ they generate. As the critical time $t^{\mathscr{Q}}_{\text{c}}$
is approached, both $q^{*}_{k^{*}}(0)$ and $q^{*}_{k^{*}}(t)$ develop a cusp
at $\mathscr{Q}=0$, the location of the kink in $I(\mathscr{Q},t)$. The cusp
is sharp and non-differentiable for $t\geq t^{\mathscr{Q}}_{\text{c}}$, and
arises because the Legendre transform (38) contracts the finite, flat
$k$-interval in Figures 3(c) and (d) where $q^{*}_{k}(0)=q^{*}_{k}(t)=0$ to
the single point $\mathscr{Q}=0$. Consequently, for $t\geq
t^{\mathscr{Q}}_{\text{c}}$, $q^{*}_{k^{*}}(0)$ and $q^{*}_{k^{*}}(t)$ vanish
at $\mathscr{Q}=0$ but are otherwise finite. As function of $\mathscr{Q}$, the
symmetry (52) implies, that the optimal fluctuations for $\mathscr{Q}$ and
$-\mathscr{Q}$ are related by time reversal, so that their initial and end
points in Figures 4(c) and (d) swap places for $\mathscr{Q}\to-\mathscr{Q}$.
In the long-time limit, we observe asymptotic convergence towards the long-
time limit (dotted lines), obtained from (59).

In the spirit of the equilibrium analysis of Sec. 2.1, we interpret the
development of the flat region in the scaled cumulant-generating function
$\Lambda(k,t)$, and the kink in the rate function $I(\mathscr{Q},t)$, as a
finite-time dynamical phase transition. This transition appears similar to the
finite-time cusp singularity in $V(m,t)$ discussed in Ref. [62] and shown in
Figure 2(b), but its properties turn out to be very different. To proceed, we
first identify the optimal, final magnetisation $m_{t}=q^{*}_{k}(t)$ as the
dynamical order parameter. This is a convenient choice, because within the
flat region in $\Lambda(k,t)$, and at the kink of $I(\mathscr{Q},t)$,
$q^{*}_{k}(t)$ is finite for $t<t^{\mathscr{Q}}_{\text{c}}$, and vanishes
otherwise, indicating the existence of different dynamical phases. Since $\pm
q^{*}_{k}(t)$ are the minima of $W_{k}(m,t)$, see (42), $W_{k}(m,t)$ takes the
role of a dynamical Landau potential, in close analogy with
$\mathscr{V}^{\text{eq}}(m)$ at equilibrium.

The dynamical phases of the transition are associated with the shape of
$W_{k}(m,t)$ in the $t$-$k$ (and $t$-$\mathscr{Q}$) parameter plane. The
number of minima $\pm q^{*}_{k}(t)$ suggests two extended phases, shown in
Figure 5(a). In the dynamical coexistence (DCE) phase (white region),
$W_{k}(m,t)$ has two minima at $\pm q^{*}_{k}(t)$ and the dynamical order
parameter $m_{t}=q^{*}_{k}(t)$ is finite. In the dynamical single mode (DSM)
phase [lined region in Figure 5(a)], $W_{k}(m,t)$ has a vanishing unique
minimum, so that $m_{t}=0$. The two phases are separated by a phase boundary
(solid line) that emerges from the critical point
$(t^{\mathscr{Q}}_{\text{c}},k_{0})$ (orange bullet).

Figure 5: (a) Phase diagram for the finite-time dynamical phase transition of
$\mathscr{Q}$ in the $t$-$k$ plane, featuring the DSM phase (lined) and the
DCE phase (white), separated by a phase boundary (black line) that emerges
from the critical point $(t^{\mathscr{Q}}_{\text{c}},k_{0})$ (orange bullet).
The extended DSM phase corresponds to the flat region in $\Lambda(k,t)$. (b)
Phase diagram in the $t$-$\mathscr{Q}$ plane after Legendre transform, with
DSM phase contracted to the dashed line.

Comparing Figures 3(c)–(d) with Figures 4(c)–(d), we observe that due to the
nature of the Legendre transform (38), the extended DSM phase in the $t$-$k$
plane contracts to a line at $\mathscr{Q}=0$, in the $t$-$\mathscr{Q}$
parameter space. Hence, the phase diagram transforms into a cut plane, with
respect to the physical parameters $t$ and $\mathscr{Q}$. This is shown in
Figure 5(b), where the DSM phase is given by the dashed line.

The cut-plane topology of the phase diagram provides an intuitive explanation
of the formation of the kink in $I(\mathscr{Q},t)$ at ${Q}=0$ for
$t>t^{\mathscr{Q}}_{\text{c}}$: When $\mathscr{Q}=0$ is crossed for
$t<t^{\mathscr{Q}}_{\text{c}}$, i.e., without crossing the DSM phase, the
order parameter remains finite and $I(\mathscr{Q},t)$ is smooth. For
$t>t^{\mathscr{Q}}_{\text{c}}$, however, $I(\mathscr{Q},t)$ must cross the DSM
phase at $\mathscr{Q}=0$. At the crossing, $m_{t}$ becomes zero and bounces
back non-differentiably, see the green line in Figure 4(d), resulting in the
kink in $I(\mathscr{Q},t)$.

###  4.1 Characterisation of phase transition

We now give a more detailed characterisation of the dynamical phase transition
in terms of the dynamical Landau potential $W_{k}(m,t)$. This allows us to
establish the continuous nature of the transition, to obtain an explicit
expression for the critical time $t^{\mathscr{Q}}_{\text{c}}$ and the critical
exponent, and to provide an intuitive explanation for the occurrence of the
transition in terms of a switch in the optimal fluctuations.

To get started, we first establish a connection between the locations of the
kink in the $k$ and $\mathscr{Q}$ spaces. We take a $k$ derivative of the
detailed fluctuation relation (40), and evaluate at $k=0$:

$\displaystyle\partial_{k}\Lambda(k_{0},t)=-\partial_{k}\Lambda(k_{0},t)=0\,.$
(61)

By (53), the derivative at $k_{0}$ is connected to the value of the observable
$\mathscr{Q}$ at generated by the $k$-tilted dynamics as

$\displaystyle\partial_{k}\Lambda(k_{0},t)=\mathscr{Q}(k_{0},t)=0\,.$ (62)

Inverting this equation, we find
$k^{*}(0,t)=k_{0}=(\beta/\beta_{\text{q}}-1)/2$, establishing that
$q^{*}_{k_{0}}(s)_{0\leq s\leq t}$ is the optimal fluctuation that generates
$\mathscr{Q}=0$ for all times $t$. In particular, this means that we can write
the dynamical order parameter $m_{t}(\mathscr{Q})$ for $\mathscr{Q}=0$, as
$m_{t}(0)=q^{*}_{k_{0}}(t)$, and that the dynamical Landau potential of the
transition at $\mathscr{Q}=0$ is given by $W_{k_{0}}(m,t)$.

After identifying $W_{k_{0}}(m,t)$ as our object of study, we compute it with
the method described in Sec. 3.2: We solve the Hamilton equations (20) with
boundary conditions (46) to obtain a one-parameter family of characteristics
on a fine $m$-grid. From (47) we then evaluate $V_{k_{0}}(m,t)$ on this grid.
In the last step, we compute $W_{k_{0}}(m,t)$ using (43).

Figure 6(a) shows $W_{k_{0}}(m,t)$ for different $t$ after a quench with the
same parameters as in Figure 3 and Figure 4. As expected from the previous
discussion, $W_{k_{0}}(m,t)$ is initially of double-well shape but transitions
into a single well at $t=t^{\mathscr{Q}}_{\text{c}}\sim\tau$ (coloured lines).
At the same time, the dynamical order parameter $m_{t}$ (bullets), passes from
finite to vanishing.

Figure 6(b) shows $W_{k_{0}}(m,t)$ after a quench with a different set of
parameters. In this case, we observe that $W_{k_{0}}(m,t)$ retains its double-
well shape at all times, so that the order parameter $m_{t}$ remains finite,
$m_{t}>0$. In other words, although the second quench also crosses the phase
boundary in Figure 1(a) (orange arrow), it does not induce a finite-time
dynamical phase transition for $\mathscr{Q}$. This shows that the requirement
that the quench be disordering does not ensure that the phase transition in
$\mathscr{Q}$ takes place. This is in contrast to the transition in $m$ [62],
which occurs for all disordering quenches.

Furthermore, as shown in the magnified view in Figure 6(c), for this second
set of parameters, the dynamical Landau potential $W_{k_{0}}(m,t)$ develops a
singularity (a kink) at the origin that persists for all finite times, but
vanishes in the long-time limit. Through (43), this kink is traced back to a
singularity of $V_{k_{0}}(m,t)$ at $m=0$, which has the same origin as the
kink in the (untilted) magnetisation rate function $V_{k=0}(m,t)$ [62], shown
in Figure 2(b). This suggests that the finite-time dynamical phase transitions
of the magnetisation $m$ and of the exchanged heat $\mathscr{Q}$ are
complementary phenomena: The transition in $\mathscr{Q}$ is present only when
the phase transition in $m$ is absent in $V_{k_{0}}(m,t)$.

####  4.1.1 Occurrence and continuity of transition

We explain our previous observations by analysing the phase transition for
small $m_{t}$. In particular, we show that the transition is continuous and
determine the $\beta$-$\beta_{\text{q}}$ parameter space where it occurs. Our
main strategy for this section is to assume a continuous transition of
$W_{k_{0}}(m,t)$ at $t^{\mathscr{Q}}_{\text{c}}$ and to justify this
assumption a posteriori.

Figure 6: Dynamical Landau potential $W_{k_{0}}(m,t)$ at different times for
varying quench parameters (coloured lines). Bullets show the minima $\pm
m_{t}$. (a) For $\beta=5/(4J)$ and $\beta_{\text{q}}=1/(2J)$ at times
$t/\tau=0$ (black), $0.25$ (red), $1$ (yellow), $1.5$ (green) and $\infty$
(dotted). (b) For $\beta=5/(4J)$ and $\beta_{\text{q}}=4/(5J)$ at times
$t/\tau=0$ (black), $1$ (red), $2$ (yellow), $4$ (green) and $\infty$
(dotted). (c) Magnification of the local maximum of $W_{k_{0}}$ around $m=0$
in Figure 6(b), including $W_{k_{0}}(m,t)$ for $t/\tau=6$ (orange).

Since $m_{t}=0$ for $t>t^{\mathscr{Q}}_{\text{c}}$, all continuous transitions
occur at small $m$. Expanding $W_{k_{0}}(m,t)$ around $m=0$ gives

$\displaystyle W_{k_{0}}(m,t)\sim
W_{k_{0}}(0,t)+\partial_{m}^{2}W_{k_{0}}(0,t)\frac{m^{2}}{2}+\partial^{4}_{m}W_{k_{0}}(0,t)\frac{m^{4}}{4!}\,.$
(63)

A continuous dynamical phase transitions at time $t^{\mathscr{Q}}_{\text{c}}$
requires that $\partial_{m}^{2}W_{k_{0}}(0,t)$ changes sign, while
$\partial^{4}_{m}W_{k_{0}}(0,t)$ remains positive. This ensures that
$W_{k_{0}}(0,t)$ passes from a single into a double-well.

To show that this is the case, we again recall that $W_{k_{0}}(m,t)$ is a
function of the tilted rate function $V_{k_{0}}(m,t)$ through (43), and that
$V_{k_{0}}(m,t)$ obeys the Hamilton-Jacobi equation (15) with initial
condition (45). Taking partial derivatives of (15) with respect to $m$, and
evaluating at $m=0$, we find an exact, closed set of evolution equations for
the derivatives of $V_{k_{0}}(m,t)$,
$z_{k_{0}}(t)\equiv\partial_{m}^{2}V_{k_{0}}(0,t)$ and
$w_{k_{0}}(t)\equiv\partial_{m}^{4}V_{k_{0}}(0,t)$, that we later relate to
(63). The equations read

$\displaystyle\tau\dot{z}_{k_{0}}$
$\displaystyle=4z_{k_{0}}J(\beta_{\text{c}}-\beta_{\text{q}})-4z_{k_{0}}^{2}\,,$
(64a) $\displaystyle\tau\dot{w}_{k_{0}}$
$\displaystyle=4w_{k_{0}}[\tfrac{\text{d}}{\text{d}t}\log
z_{k_{0}}-2J(\beta_{\text{c}}-\beta_{\text{q}})]+\dot{z}_{k_{0}}\left\\{\dot{z}_{k_{0}}-2[(\beta_{\text{q}}J-2)\beta_{\text{q}}J-2]\right\\}-16z_{k_{0}}\,,$
(64b) with initial conditions following from (45), $\displaystyle
z_{k_{0}}(0)=J[\beta_{\text{c}}-(\beta+\beta_{\text{q}})/2]\,,\quad
w_{k_{0}}(0)=2\,.$ (64c)

For later reference, we note that when

$\displaystyle\bar{\beta}<\beta_{\text{c}}\,,$ (65)

then $z_{k_{0}}(0)>0$, and $z_{k_{0}}(0)\leq 0$ otherwise. Here, $\bar{\beta}$
denotes the arithmetic mean $\bar{\beta}\equiv(\beta+\beta_{\text{q}})/2$ of
$\beta$ and $\beta_{\text{q}}$. The evolution equations (64) can be solved
explicitly, leading to a complicated expression for $w_{k_{0}}$ that we find
unenlightening. However, the dynamics is easily understood qualitatively, by
considering the phase portrait of the flow (64).

Figure 7: (a) Phase portrait of the $z_{k_{0}}-w_{k_{0}}$ dynamics (64),
featuring the unstable (red bullet) and stable (green bullet) fixed points.
Sample trajectories shown in different colours with arrow heads indicating the
direction of the flow. (b) $\partial_{m}^{2}W_{k_{0}}(0,t)$ (blue and green)
and $\partial_{m}^{4}W_{k_{0}}(0,t)-2$ (orange and magenta) for different
$\beta_{\text{q}}=1/(2J)$, and $4/(5J)$, respectively, and fixed
$\beta=5/(4J)$. (c) Occurrence of the finite-time dynamical phase transition
in the $\beta$-$\beta_{\text{q}}$ parameter space. Bullet colours indicate the
parameter values of the $z_{k_{0}}$ and $w_{k_{0}}$ trajectories in Figure
7(b).

Figure 7(a) shows the phase portrait of (64), featuring an unstable fixed
point (red bullet) at $(z_{k_{0}},w_{k_{0}})=(0,0)$ and a stable fixed point
(green bullet) at
$(z_{k_{0}},w_{k_{0}})=[(\beta_{\text{c}}-\beta_{\text{q}})J,2]$. The arrow
heads indicate the time direction of the flow. We observe that all initial
conditions with $z_{k_{0}}(0)>0$ are attracted by the stable fixed point. This
is shown by the orange and yellow example trajectories. By contrast, initial
conditions with $z_{k_{0}}(0)<0$ escape to infinity
$(z_{k_{0}},W_{k_{0}})\to(-\infty,\infty)$ in finite time, exemplified by the
red trajectory in Figure 7(a).

Returning to (63), we express the derivatives of $W_{k_{0}}(m,t)$ in terms of
$z_{k_{0}}$ and $w_{k_{0}}$:

$\displaystyle\partial_{m}^{2}W_{k_{0}}(0,t)=$ $\displaystyle
z_{k_{0}}(t)-(\beta-\beta_{\text{q}})J/2\,,$ (66a)
$\displaystyle\partial_{m}^{4}W_{k_{0}}(0,t)=$ $\displaystyle w_{k_{0}}(t)\,.$
(66b)

When $\partial_{m}^{4}W_{k_{0}}(0,t)>0$ and $\partial_{m}^{2}W_{k_{0}}(0,t)$
changes sign, from negative to positive, say, then $W_{k_{0}}(m,t)$
transitions from a double to a single well, marking a continuous finite-time
dynamical phase transition. To understand for which parameters this happens,
it is convenient to introduce the distances

$\displaystyle\Delta\bar{\beta}\equiv\beta_{\text{c}}-\bar{\beta}\,,\qquad\Delta\beta_{\text{q}}\equiv\beta_{\text{c}}-\beta_{\text{q}}\,.$
(67)

For the disordering quenches ($\beta>\beta_{\text{c}}$,
$\Delta\beta_{\text{q}}>0$) we consider here, $\partial_{m}^{2}W_{k_{0}}(0,t)$
is initially negative,
$\partial_{m}^{2}W_{k_{0}}(0,0)=-(\beta-\beta_{\text{c}})J<0$. This means that
for any continuous transition, $\partial_{m}^{2}W_{k_{0}}(0,t)$ must evolve
from negative to positive. When $\Delta\bar{\beta}>0$, then $z_{k_{0}}(0)>0$
[recall (65)], so that $z_{k_{0}}(t)$ approaches the stable fixed point,
leading to a positive
$\partial_{m}^{2}W_{k_{0}}(0,\infty)=\Delta\bar{\beta}>0$ in the long-time
limit. This is the case for $W_{k_{0}}(m,t)$ in Figure 6(a), where
$\Delta\bar{\beta}=1/(8J)>0$.

For $\Delta\bar{\beta}\leq 0$, $z_{k_{0}}(t)$ and $w_{k_{0}}(t)$ run into a
finite-time divergence and no transition occurs, which is the case in Figure
6(b), where $\Delta\bar{\beta}=-1/(40J)<0$. The finite-time divergences of
$z_{k_{0}}(t)$ and $w_{k_{0}}(t)$ reflect the formation of the kink in
$W_{k_{0}}(m,t)$ at $m=0$, depicted in Figure 6(c).

Figure 7(b) shows the time evolution of $\partial_{m}^{2}W_{k_{0}}(0,t)$ and
$\partial_{m}^{4}W_{k_{0}}(0,t)$ for disordering quenches with the parameter
sets from Figure 6(a) and Figure 6(b). For the first set (green and orange
lines, $\Delta\bar{\beta}>0$), $\partial_{m}^{2}W_{k_{0}}(0,t)$ is initially
negative, but changes sign at $t^{\mathscr{Q}}_{\text{c}}$. Because of the
structure of the initial and final equilibrium rate functions of the model,
given in (12) and (8), $\partial_{m}^{4}W_{k_{0}}(0,t)=2$ for $t=0$ and as
$t\to\infty$. Nontrivially, however, $\partial_{m}^{4}W_{k_{0}}(0,t)\geq 2$
during the entire time evolution. This ensures that, close to
$t^{\mathscr{Q}}_{\text{c}}$, the finite-time dynamical phase transition is
completely characterised by the expansion in (63), and justifies our initial
assumption that the phase transition is continuous.

For the second set of parameters in Figure 7(b) (blue and magenta,
$\Delta\bar{\beta}<0$), by contrast, $\partial_{m}^{2}W_{k_{0}}(0,t)$ remains
negative, and both $\partial_{m}^{2}W_{k_{0}}(0,t)$ and
$\partial_{m}^{4}W_{k_{0}}(0,t)$ diverge in finite time, when the kink in
Figure 6(c) forms. In this case, the finite-time dynamical phase transition is
absent.

From our small-$m_{t}$ analysis, we conclude that the dynamical phase
transition is continuous and that it requires quenches with
$\Delta\bar{\beta}>0$. The coloured region in Figure 7(c) shows where in the
$\beta$-$\beta_{\text{q}}$ parameter space the finite-time dynamical phase
transition occurs, i.e., where $\Delta\bar{\beta}>0$. The bullets correspond
to the parameter values of the plots in Figure 7(b): While the phase
transition occurs for the first set of parameters (orange and green), it is
absent for the second set (blue and magenta).

####  4.1.2 Critical time

With all necessary methods in place, we now compute the critical time
$t^{\mathscr{Q}}_{\text{c}}$ for the finite-time dynamical phase transition.
When $\partial_{m}^{4}W_{k_{0}}(0,t)>0$, as we observed, the critical time
$t^{\mathscr{Q}}_{\text{c}}$ for disordering quenches is determined by the
time at which $\partial_{m}^{2}W_{k_{0}}(0,t)$ changes sign, i.e.,
$\partial_{m}^{2}W_{k_{0}}(0,t^{\mathscr{Q}}_{\text{c}})=z_{k_{0}}(t)-(\beta-\beta_{\text{q}})J/2=0$.
The solution of (64a) is given explicitly by

$\displaystyle
z_{k_{0}}(t)=\frac{J\Delta\beta_{\text{q}}\Delta\bar{\beta}}{\Delta\bar{\beta}+\Delta\beta_{\text{q}}e^{-4J\Delta\beta_{\text{q}}\frac{t}{\tau}}/2}\,.$
(68)

The critical time $t^{\mathscr{Q}}_{\text{c}}$ follows from (68) by setting
$z_{k_{0}}(t^{\mathscr{Q}}_{\text{c}})=(\beta-\beta_{\text{q}})J/2$. Solving
for $t^{\mathscr{Q}}_{\text{c}}$ gives

$\displaystyle
t^{\mathscr{Q}}_{\text{c}}=\frac{\tau}{2J\Delta\beta_{\text{q}}}\log\left|\frac{\bar{\beta}}{\Delta\bar{\beta}}\right|\,.$
(69)

For the parameter values in Figures 3 and 4, we have
$t^{\mathscr{Q}}_{\text{c}}/\tau=\ln(3)\approx 1.0986$, in excellent agreement
with the numerics.

Our analysis shows in particular, that $t^{\mathscr{Q}}_{\text{c}}$ is
different from the critical time [62, 64]

$\displaystyle
t_{\text{c}}=\frac{\tau}{4J\Delta\beta_{\text{q}}}\log\left(\frac{\Delta\beta_{\text{q}}}{\beta-\beta_{\text{c}}}\right)\,,$
(70)

for the finite-time dynamical phase transition in the magnetisation $m$. Note
also that $t^{\mathscr{Q}}_{\text{c}}$ in (69) diverges both when
$\Delta\beta_{\text{q}}\to 0$ and when $\Delta\bar{\beta}\to 0$, which mark
the boundaries of the coloured region in Figure 7(c)

####  4.1.3 Dynamical order parameter

We now discuss the behaviour of the dynamical order parameter in the vicinity
of the transition, derive the dynamical critical exponent $=1/2$, and compare
our results to direct numerical simulations of (4).

Close to $t^{\mathscr{Q}}_{\text{c}}$, the order parameter becomes small,
$m_{t}\ll 1$, and the expansion in (63) is exact. Hence, we may compute
$m_{t}$ as the minimum of (63). This gives

$\displaystyle
m_{t}\sim\begin{cases}\pm[-z_{k_{0}}(t)+J(\beta-\beta_{\text{q}})]^{1/2}[w_{k_{0}}(t)]^{-1/2}\,,&t<t^{\mathscr{Q}}_{\text{c}}\\\
0\,,&t\geq t^{\mathscr{Q}}_{\text{c}}\end{cases}\,,$ (71)

i.e., a continuous, finite-time dynamical phase transition characterised by
$m_{t}$. Close to criticality, for $|t-t^{\mathscr{Q}}_{\text{c}}|/\tau\ll 1$
and $t<t^{\mathscr{Q}}_{\text{c}}$, we have
$-z_{k_{0}}(t)+J(\beta-\beta_{\text{q}})\propto(t^{\mathscr{Q}}_{\text{c}}-t)$.
We therefore find $m_{t}\propto|t-t^{\mathscr{Q}}_{\text{c}}|^{1/2}$, i.e., a
dynamical critical exponent of mean-field type, the same as for $m_{0}$ in
Ref. [62].

As explained previously, $m_{t}=q^{*}_{k_{0}}(t)$ represents the most likely
final magnetisation that realises $\mathscr{Q}=0$ in time $t$. This allows us
to get an independent numerical estimate of $m_{t}$ by means of direct
numerical simulations of (4) at large but finite $N$. To this end, we generate
a large number $\sim 10^{8}$ of trajectories, and condition them on
$\mathscr{Q}=0$ at different times $t$. We then collect the histograms of the
final magnetisations $m_{t}$ for each $t$ and join them into one plot such
that the maximum in each time slice is normalised to unity.

Figure 8: (a) Order parameter for $\Delta\bar{\beta}>0$ with $\beta=5/(4J)$
and $\beta_{\text{q}}=1/(2J)$. Density from numerical simulation (heat map,
$N=250$, $10^{8}$ trajectories) and $m_{t}$ from theory (solid line). The
dotted line shows the inactivity solution (sub-leading for
$t<t^{\mathscr{Q}}_{\text{c}}$), the bullets are the same as in Figure 6(a).
(b) Order parameter for $\Delta\bar{\beta}<0$ with $\beta=5/(4J)$ and
$\beta_{\text{q}}=4/(5J)$. Density from numerical simulation (heat map,
$N=250$, $10^{8}$ trajectories) and $m_{t}$ from theory (solid line). The
dotted line shows the sub-leading inactivity solution, the bullets are the
same as in Figure 6(b).

Figure 8(a) shows the so-obtained order parameter density for
$\Delta\bar{\beta}>0$ as a heat map. The theoretical prediction
$m_{t}=q^{*}_{k_{0}}(t)$ is shown as the solid line. The dashed, blue line
shows (71), which coincides with the exact $m_{t}$ close to
$t^{\mathscr{Q}}_{\text{c}}$, but deviates for short times. The bullets
correspond to the minima of the Landau potentials $W_{k_{0}}$ in Figure 6(a).
We observe good agreement between the yellow regions of high order parameter
density with $m_{t}$ calculated from the optimal fluctuations. The transition
between finite $m_{t}$ at $t\leq t^{\mathscr{Q}}_{\text{c}}$ and $m_{t}=0$ for
$t>t^{\mathscr{Q}}_{\text{c}}$ is clearly visible. Note that the transition is
inverted (finite to zero) compared to the transitions of $\bar{m}$ and $m_{0}$
shown in Figures 1(b) and 2(c) (zero to finite), respectively. Close to
$t^{\mathscr{Q}}_{\text{c}}$, we observe strong fluctuations of $m_{t}$, and a
high order-parameter density at $m_{t}\approx 0$ (black dotted line) even for
$t\approx 0.7\tau<t^{\mathscr{Q}}_{\text{c}}$. This is a finite-$N$ effect, as
we explain in more detail in the next section.

Figure 8(b) shows the same as Figure 8(a) but now for a parameter set with
$\Delta\bar{\beta}>0$. Here, the bullets correspond to the minima of
$W_{k_{0}}$ in Figure 6(b). We observe no phase transition, as the order
parameter remains finite at all times and approaches zero asymptotically.

In both Figure 8(a) and Figure 8(b), the numerical data turns noisier for
increasing $t$, because the event $\mathscr{Q}=0$ becomes less typical as the
spin system equilibrates with the environment. Consequently, less trajectories
remain after conditioning on $\mathscr{Q}=0$, resulting in an increased
statistical error.

####  4.1.4 Optimal fluctuations

Finally, the origin of the dynamical phase transition can be viewed from the
perspective of the optimal fluctuations that generate $\mathscr{Q}=0$. To
improve our intuition for these fluctuations, it is useful to consider how the
condition $\mathscr{Q}=0$ constrains their dynamics.

According to (53), the optimal fluctuation $q^{*}_{k_{0}}(s)_{0\leq s\leq t}$
for $\mathscr{Q}=0$ must satisfy

$\displaystyle\mathscr{E}[q^{*}_{k_{0}}(t)]=\mathscr{E}[q^{*}_{k_{0}}(0)]\,,$
(72)

i.e., the internal energy before the quench and at time $t$ must coincide. For
$\mathscr{E}(m)=-\beta_{\text{q}}Jm^{2}/2$, (72) translates into

$\displaystyle q^{*}_{k_{0}}(t)=\pm q^{*}_{k_{0}}(0)\,.$ (73)

Hence, the requirement that $\mathscr{Q}=0$ forces the initial and end points
of the optimal fluctuations to agree up to a sign.

At finite $N$, the variable sign in (73) gives rise to the premature
transition observed in the numerics in Figure 8(a). This is, because at any
finite $N$, trajectories that initiate close to $m=0$ have two possibilities
that occur with similar probability: At time $t$ they may end up at either the
positive or negative value of their initial magnetisation. Trajectories that
initiate far away from the origin, close to the initial minima of
$\mathscr{V}^{\text{eq}}(m)$, say, have effectively only one possibility,
$q^{*}_{k_{0}}(t)=q^{*}_{k_{0}}(0)$, because the probability of trajectories
crossing the origin and ending up at their negative initial magnetisation,
$q^{*}_{k_{0}}(t)=-q^{*}_{k_{0}}(0)$, is exponentially low. As a result, the
probability to start and end close to the origin is enhanced at finite $N$.

This effect becomes smaller as $N$ increases, since trajectories for which
both possibilities in (73) are of similar probability, recide closer and
closer to the origin. In the thermodynamic limit, only the $+$ constraint in
(73) survives, so that the optimal fluctuations always obey
$q^{*}_{k_{0}}(t)=q^{*}_{k_{0}}(0)$, see (52). Based on this argument, we have
checked that the premature transition in Figure 8(a) is absent when we enforce
$q^{*}_{k_{0}}(t)=q^{*}_{k_{0}}(0)$ also at finite $N$.

From our direct numerical simulations for $\Delta\bar{\beta}>0$, we visualise
the optimal fluctuations by conditioning the trajectories on $\mathscr{Q}=0$
at times smaller and larger than $t^{\mathscr{Q}}_{\text{c}}$. In order to
emulate the thermodynamic limit, we now enforce
$q^{*}_{k_{0}}(t)=q^{*}_{k_{0}}(0)$, instead of admitting both signs in (73).
Tracking the entire history of the conditioned trajectories provides us with a
numerical estimate of the conditioned trajectory density in the thermodynamic
limit, before and after the phase transition. The resulting trajectory
densities, normalised to unity for each time slice, are shown in Figure 9.

Figure 9: Optimal trajectories for $\mathscr{Q}(t)=0$ with $\beta=5/(4J)$ and
$\beta_{\text{q}}=1/(2J)$, constrained by (73) with only the $+$ sign. (a)
Trajectory density from simulation (heat map, $N=250$, $10^{8}$ trajectories)
and optimal fluctuation (red line) from theory for
$t=0.8\tau<t^{\mathscr{Q}}_{\text{c}}$. The dashed line shows the sub-leading
fluctuation. (b) Same as in Figure 9(a) but with
$t=1.2\tau>t^{\mathscr{Q}}_{\text{c}}$.

Figure 9(a) shows the trajectory density (heat map) for
$t<t^{\mathscr{Q}}_{\text{c}}$, together with the corresponding optimal
fluctuation $q^{*}_{k_{0}}(s)_{0\leq s\leq t}$ (red line). The dotted line
shows the sub-leading fluctuation $q(s)=0$. Although the numerical data is
noisy for the reasons mentioned previously, we observe good agreement between
the yellow streak of high trajectory density and the theoretical curve. Note
that there is a negative, but otherwise identical optimal fluctuation, not
shown in Figure 9, that starts and ends at a finite negative magnetisation.
For $t>t^{\mathscr{Q}}_{\text{c}}$ shown in Figure 9(b), by contrast, the
optimal fluctuation remains zero at all times, reflected in both the numerics
and the theory.

The constraint (73) on the optimal fluctuation gives a simple qualitative
explanation of why the dynamical phase transition occurs at a finite time, by
considering the most likely ways to achieve $\mathscr{Q}=0$ at short and long
times: For short times $t\ll\tau$, the most likely way is to start and end
close to the most likely initial condition
$q^{*}_{k_{0}}(0)\approx\bar{m}(\beta)>0$, because the relaxation dynamics can
be sustained for short times at low probabilistic cost. For long times
$t\gg\tau$ and $\Delta\bar{\beta}>0$, by contrast, the system is more likely
to start at vanishing magnetisation, at high initial probabilistic cost,
because it is also the most likely final magnetisation, i.e.,
$\bar{m}(\beta_{\text{q}})=0$. In other words, although the initial
probabilistic cost of $q^{*}_{k_{0}}(0)\approx 0$ is high, the system may then
stay close to the origin for an arbitrary amount of time at no additional
cost.

According to this argument one expects different optimal fluctuations for
short and long times, implying a transition between the two behaviours at some
intermediate time, given by the critical time $t^{\mathscr{Q}}_{\text{c}}$.

For $\Delta\bar{\beta}<0$, the probability of initiating (and staying) at
$m=0$ is always too low, compared to starting (and ending) somewhere in the
middle ground between to a likely initial condition and an unlikely final
condition.

##  5 Conclusions

Combining elements from stochastic thermodynamics and large-deviation theory,
we derived a powerful theory for computing the time-dependent statistics of
thermodynamic observables after an instantaneous temperature quench. The
approach proves particularly effective for the analysis of finite-time
dynamical phase transitions, as it naturally gives rise to a dynamical
generalisation of Landau theory. The corresponding dynamical Landau potential
allows for an unambiguous identification of the dynamical order parameter, and
of the associated dynamical phases in the phase diagram. Our theory applies to
systems with underlying stochastic dynamics that admit well-defined
thermodynamic or weak-noise limits.

We introduced our approach using the Curie-Weiss spin model as a concrete,
non-trivial example of a system with an equilibrium phase transition. For
disordering quenches across the phase boundary, the magnetisation $m$ of this
system was shown to exhibit a finite-dynamical phase transition in Ref. [62].
Using our new method, we conducted a detailed analysis of the statistics of
the heat exchange $\mathscr{Q}$ between the system and the environment in
response to such a disordering quench.

In a finite region of the parameter space, our investigation revealed a
finite-time dynamical phase transition also for this observable. The
transition manifests itself in a finite-time kink in the probability
distribution of $\mathscr{Q}$, and classifies as continuous, with mean-field
critical exponent, similar to the transition described in Ref. [62]. Apart
from these similarities, however, the two transitions exhibit very different,
complementary properties: The two transitions occur in reverse order and one
transition is present only when the other is absent.

On the trajectory level, we showed that finite-time dynamical phase transition
is related to a constraint on the initial and end points of individual
trajectories. The most likely ways to satisfy the constraint differ in the
short- and long-time limits. This implies the occurrence of a sudden switch in
the optimal, most likely fluctuation at finite time and thus provides a
qualitative explanation for the occurrence of the phase transition. At finite
$N$, we argued that the constraint posed on the fluctuations is effectively
weaker for trajectories that reside close to $m=0$, which explains a premature
phase transition at $t<t^{\mathscr{Q}}_{\text{c}}$ observed our direct
numerical simulations.

In conclusion, the present paper opens the door to a complete, finite-time
analysis of the stochastic thermodynamics of systems subject to quenches of
either the temperature or other external parameters. Our analysis of the
finite-time transitions associated with the magnetisation in Ref. [62] and the
heat exchange $\mathscr{Q}$ conducted here, reveals that these transitions are
generated in quite different ways, as a consequence of different constraints
posed on the dynamics at the trajectory level. This may hint at the existence
of finite-time dynamical phase transitions with distinct properties in a much
wider range of systems, and for more observables, than previously thought. The
dynamical Landau theory we proposed for the study of these transitions has
proven powerful in identifying the distinct time-dependent phases and for
classifying them in terms of well-known equilibrium categories. We are
confident that our methods will be useful in the study of finite-time
dynamical phase transitions in other models and for a variety of observables.

As for the Curie-Weiss model, the next logical step is to investigate the
finite-time statistics of entropy production in response to quenches. This
would give a detailed account of the finite-time dynamics of dissipation and
provide insights into the irreversibility of relaxation processes in the
thermodynamic limit. The analysis is slightly more involved in this case,
because the observable depends explicitly on time, leading to time-dependent
constraints on the trajectories. Notwithstanding, the theory developed here
applies without further limitations.

An important generalisation our method is the inclusion of steady and time-
dependent driving. This enables the study of dynamical observables not only in
non-equilibrium steady states but also the transient relaxation towards them.
For example, the characteristic kink in the rate function of entropy
production found at steady state in Refs. [41, 42, 79] could have formed in
the transient, as a consequence of a finite-time dynamical phase transition.
An analysis of this and related problems with our methods would provide new
insights into how known dynamical phase transitions are generated.

Finally, the fact that our theory applies in the thermodynamic limit, raises
the question how finite $N$ as well as critical fluctuations (in both space
and time [62]) affect finite-time dynamical phase transitions. In equilibrium,
finite-$N$ corrections are known to potentially alter the location of the
critical point, and even change the order of phase transitions [21]. Our
numerical simulations in Figure 8(a) indicate that such corrections could also
occur for finite-time dynamical phase transitions. How precisely these
finite-$N$ corrections and critical fluctuations, responsible for corrections
to mean-field critical exponents at equilibrium [21, 22], affect finite-time
dynamical phase transitions remains an intriguing open question.

This work was supported by the European Research Council, project NanoThermo
(ERC-2015-CoG Agreement No. 681456) and by a Feodor-Lynen Fellowship (JM) from
the Humboldt Foundation.

##  Appendix A Fluctuation relation for $\mathscr{Q}$

We prove a fluctuation relation for $\mathscr{Q}$, (27) in the main text. The
proof given here is based on the following observation: In an equilibrium
state at inverse temperature $\beta_{\text{q}}$, the joint probability
$P^{\text{eq}}_{\text{q}}(m,t;m^{\prime},0)$ obeys

$\displaystyle
P^{\text{eq}}_{\text{q}}(m,t;m^{\prime},0)=P^{\text{eq}}_{\text{q}}(m^{\prime},t;m,0)\,,$
(74)

which follows from stationarity and time-reversal invariance. The subscript q
indicates that both $m$ and $m^{\prime}$ are sampled from the equilibrium
distribution at inverse temperature $\beta_{\text{q}}$. Conditioning on the
initial equilibrium state, we now write

$\displaystyle P^{\text{eq}}_{\text{q}}(m,t;m^{\prime},0)=$ $\displaystyle
P_{\text{q}}(m,t|m^{\prime},0)P_{\text{q}}^{\text{eq}}(m^{\prime})\,,$ (75a)
$\displaystyle P^{\text{eq}}_{\text{q}}(m^{\prime},t;m,0)=$ $\displaystyle
P_{\text{q}}(m^{\prime},t|m,0)P_{\text{q}}^{\text{eq}}(m)\,.$ (75b)

Using this and (74), we relate the conditional probability distributions by

$\displaystyle P_{\text{q}}(m^{\prime},t|m,0)=$ $\displaystyle
P_{\text{q}}(m,t|m^{\prime},0)\frac{P_{\text{q}}^{\text{eq}}(m^{\prime})}{P_{\text{q}}^{\text{eq}}(m)}\,,$
(76) $\displaystyle=$ $\displaystyle
P_{\text{q}}(m,t|m^{\prime},0)\text{e}^{-N\beta_{\text{q}}[\mathscr{F}(\beta_{\text{q}},m^{\prime})-\mathscr{F}(\beta_{\text{q}},m)]}\,.$
(77)

Swapping the summation indices $m\leftrightarrow m^{\prime}$ in (32) we obtain
for $G(k,t)$

$\displaystyle G(k,t)=$
$\displaystyle\sum_{m,m^{\prime}}\text{e}^{-Nk\beta_{\text{q}}\left[\mathscr{E}(m^{\prime})-\mathscr{E}(m)\right]}P_{\text{q}}(m^{\prime},t|m,0)P^{\text{eq}}(m,0)\,.$
(78)

Using (77) and rearranging the terms gives

$\displaystyle
G(k,t)=\sum_{m,m^{\prime}}\text{e}^{-N\beta_{\text{q}}(-k+\beta/\beta_{\text{q}}-1)[\mathscr{E}(m)-\mathscr{E}(m^{\prime})]}P_{\text{q}}(m,t|m^{\prime},0)P^{\text{eq}}(m^{\prime},0)\,.$
(79)

Comparing with (32), and shifting $k$ by $k_{0}=(\beta/\beta_{\text{q}}-1)/2$,
gives the finite-time fluctuation relation

$\displaystyle G(k+k_{0},t)=G(-k+k_{0},t)\,,$ (80)

which shows that $G(k,t)$ is symmetric about $k=k_{0}$. For the probability
distribution $P(\mathscr{Q},t)$, (80) implies

$\displaystyle
P(\mathscr{Q},t)=P(-\mathscr{Q},t)\text{e}^{-N(\beta/\beta_{\text{q}}-1)\mathscr{Q}}\,,$
(81)

leading to

$\displaystyle
I(\mathscr{Q},t)-I(-\mathscr{Q},t)=(\beta/\beta_{\text{q}}-1)\mathscr{Q}\,,$
(82)

for the rate function.

##  Appendix B Variational principle for $\Lambda(k,t)$

Here we prove a variational principle for $\Lambda(k,t)$ valid for all $k$ and
$t$. We consider the variation $\delta\Lambda(k,t)$ with respect to
$q^{*}_{k}(s)$ and $p^{*}_{k}(s)$. From the integral expression (51) we obtain

$\delta\Lambda(k,t)=-\int_{0}^{t}\text{d}s\big{[}\delta
p^{*}_{k}\dot{q}^{*}_{k}+p^{*}_{k}\tfrac{\text{d}}{\text{d}s}\delta
q^{*}_{k}-\partial_{q}\mathscr{H}(q^{*}_{k},p^{*}_{k})\delta
q^{*}_{k}-\partial_{p}\mathscr{H}(q^{*}_{k},p^{*}_{k})\delta
p^{*}_{k}\big{]}\\\ -\delta
q_{k}^{*}(0)\tfrac{\text{d}}{\text{d}q}\mathscr{V}^{\text{eq}}[q^{*}_{k}(0)]+k\\{\delta
q_{k}^{*}(t)\partial_{q}\mathscr{A}[q^{*}_{k}(t),t]-\delta
q_{k}^{*}(0)\partial_{q}\mathscr{A}[q^{*}_{k}(0),0]\\}\,.$ (83)

An integration by parts gives

$\delta\Lambda(k,t)=\int_{0}^{t}\text{d}s\big{[}\dot{p}^{*}_{k}+\partial_{q}\mathscr{H}(q^{*}_{k},p^{*}_{k})\big{]}\delta
q^{*}_{k}(s)-\int_{0}^{t}\text{d}s\big{[}\dot{q}^{*}_{k}-\partial_{p}\mathscr{H}(q^{*}_{k},p^{*}_{k})\big{]}\delta
p^{*}_{k}(s)\\\ +\delta
q^{*}_{k}(t)\big{\\{}-p^{*}_{k}(t)+k\partial_{q}\mathscr{A}[q^{*}_{k}(t),t]\big{\\}}+\delta
q^{*}_{k}(0)\big{\\{}p^{*}_{k}(0)-k\partial_{q}\mathscr{A}[q^{*}_{k}(0),0]-\tfrac{\text{d}}{\text{d}q}\mathscr{V}^{\text{eq}}[q^{*}_{k}(0)]\big{\\}}\,.$
(84)

Applying the Hamilton equations (20) together with the boundary conditions
(50) we readily obtain $\delta\Lambda(k,t)=0$. Equation (84) can be
conveniently written as

$\displaystyle\delta\Lambda(k,t)=\int_{0}^{t}\text{d}s\left[\frac{\delta\Lambda}{\delta
p^{*}_{k}}\delta p^{*}_{k}+\frac{\delta\Lambda}{\delta q^{*}_{k}}\delta
q^{*}_{k}\right]\,,$ (85)

where the variational derivatives

$\displaystyle\frac{\delta\Lambda}{\delta p^{*}_{k}}=$
$\displaystyle-\dot{q}^{*}_{k}+\partial_{p}\mathscr{H}(q^{*}_{k},p^{*}_{k})\,,$
(86a) $\displaystyle\frac{\delta\Lambda}{\delta q^{*}_{k}}=$
$\displaystyle\dot{p}^{*}_{k}+\partial_{q}\mathscr{H}(q^{*}_{k},p^{*}_{k})+\delta(s-t)\left[-p^{*}_{k}+k\partial_{q}\mathscr{A}(q^{*}_{k},s)\right]$
(86b)
$\displaystyle+\delta(s)\left[p^{*}_{k}-k\partial_{q}\mathscr{A}(q^{*}_{k},s)-\tfrac{\text{d}}{\text{d}q}\mathscr{V}^{\text{eq}}(q^{*}_{k})\right]\,,$

vanish individually, i.e., $\frac{\delta\Lambda}{\delta
p^{*}_{k}}=\frac{\delta\Lambda}{\delta q^{*}_{k}}=0$, as stated in the main
text.

## References

  * [1] Isaac Newton.  Scala graduum caloris, Calorum Descriptiones & Signa (Scale of the degrees of heat).  Philos. Trans., 22(270):824–829, 1701.
  * [2] Lars Onsager.  Reciprocal relations in irreversible processes. I.  Phys. Rev., 37(4):405, 1931.
  * [3] Lars Onsager.  Reciprocal relations in irreversible processes. II.  Phys. Rev., 38(12):2265, 1931.
  * [4] Ryogo Kubo.  Statistical-mechanical theory of irreversible processes. I. General theory and simple applications to magnetic and conduction problems.  J. Phys. Soc. Japan, 12(6):570–586, 1957.
  * [5] Ryogo Kubo, Mario Yokota, and Sadao Nakajima.  Statistical-mechanical theory of irreversible processes. II. Response to thermal disturbance.  J. Phys. Soc. Japan, 12(11):1203–1211, 1957.
  * [6] Erasto B Mpemba and Denis G Osborne.  Cool?  Phys. Educ., 4(3):172, 1969.
  * [7] P Alex Greaney, Giovanna Lani, Giancarlo Cicero, and Jeffrey C Grossman.  Mpemba-like behavior in carbon nanotube resonators.  Metall. Mater. Trans. A, 42(13):3907–3912, 2011.
  * [8] Yun-Ho Ahn, Hyery Kang, Dong-Yeun Koh, and Huen Lee.  Experimental verifications of Mpemba-like behaviors of clathrate hydrates.  Korean J. Chem. Eng., 33(6):1903–1907, 2016.
  * [9] Zhiyue Lu and Oren Raz.  Nonequilibrium thermodynamics of the Markovian Mpemba effect and its inverse.  Proc. Natl. Acad. Sci., 114(20):5083–5088, 2017.
  * [10] Antonio Lasanta, Francisco Vega Reyes, Antonio Prados, and Andrés Santos.  When the hotter cools more quickly: Mpemba effect in granular fluids.  Phys. Rev. Lett., 119(14):148001, 2017.
  * [11] Alessio Lapolla and Aljaž Godec.  Faster uphill relaxation in thermodynamically equidistant temperature quenches.  Phys. Rev. Lett., 125(11):110602, 2020.
  * [12] Jan Meibohm, Danilo Forastiere, Tunrayo Adeleke-Larodo, and Karel Proesmans.  Relaxation-speed crossover in anharmonic potentials.  Phys. Rev. E, 104(3):L032105, 2021.
  * [13] Sreekanth K Manikandan.  Equidistant quenches in few-level quantum systems.  Phys. Rev. Res., 3(4):43108, 2021.
  * [14] Tan Van Vu and Yoshihiko Hasegawa.  Toward relaxation asymmetry: Heating is faster than cooling.  Phys. Rev. Res., 3(4):43160, 2021.
  * [15] I M Lifshitz.  Kinetics of ordering during second-order phase transitions.  Sov. Phys. JETP, 15:939, 1962.
  * [16] Leticia F Cugliandolo.  Coarsening phenomena.  Comptes Rendus Phys., 16(3):257–266, 2015.
  * [17] Alan J Bray.  Theory of phase-ordering kinetics.  Adv. Phys., 51(2):481–587, 2002.
  * [18] Jean-Philippe Bouchaud.  Weak ergodicity breaking and aging in disordered systems.  J. Phys. I, 2(9):1705–1713, 1992.
  * [19] Ludovic Berthier and Giulio Biroli.  Theoretical perspective on the glass transition and amorphous materials.  Rev. Mod. Phys., 83(2):587, 2011.
  * [20] Gary L Hunter and Eric R Weeks.  The physics of the colloidal glass transition.  Reports Prog. Phys., 75(6):66501, 2012.
  * [21] Nigel Goldenfeld.  Lectures on phase transitions and the renormalization group.  CRC Press, Boca Raton, 1992.
  * [22] Paul M Chaikin, Tom C Lubensky, and Thomas A Witten.  Principles of condensed matter physics, volume 10.  Cambridge University Press, Cambridge, 1995.
  * [23] Lev Davidovich Landau.  On the theory of phase transitions. I.  Zh. Eksp. Teor. Fiz., 11:19, 1937.
  * [24] Leo P Kadanoff.  Scaling laws for Ising models near T c.  Phys. Phys. Fiz., 2(6):263, 1966.
  * [25] Kenneth G Wilson.  Renormalization group and critical phenomena. I. Renormalization group and the Kadanoff scaling picture.  Phys. Rev. B, 4(9):3174, 1971.
  * [26] Kenneth G Wilson.  Renormalization group and critical phenomena. II. Phase-space cell analysis of critical behavior.  Phys. Rev. B, 4(9):3184, 1971.
  * [27] M I Freidlin and A D Wentzell.  Random perturbations of dynamical systems.  Springer, New York, USA, 1984.
  * [28] R Graham and T Tél.  Existence of a potential for dissipative dynamical systems.  Phys. Rev. Lett., 52(1):9, 1984.
  * [29] Richard S Ellis.  Entropy, large deviations, and statistical mechanics.  Springer, 2007.
  * [30] Udo Seifert.  Stochastic thermodynamics, fluctuation theorems and molecular machines.  Reports Prog. Phys., 75(12):126001, 2012.
  * [31] Lorenzo Bertini, Alberto De Sole, Davide Gabrielli, Giovanni Jona-Lasinio, and Claudio Landim.  Macroscopic fluctuation theory.  Rev. Mod. Phys., 87(2):593, 2015.
  * [32] Luca Peliti and Simone Pigolotti.  Stochastic Thermodynamics: An Introduction.  Princeton University Press, 2021.
  * [33] Bernard Derrida.  Dynamical phase transition in nonsymmetric spin glasses.  J. Phys. A. Math. Gen., 20(11):L721, 1987.
  * [34] Juan P Garrahan, Robert L Jack, Vivien Lecomte, Estelle Pitard, Kristina van Duijvendijk, and Frédéric van Wijland.  Dynamical first-order phase transition in kinetically constrained models of glasses.  Phys. Rev. Lett., 98(19):195702, 2007.
  * [35] Tim Herpich, Juzar Thingna, and Massimiliano Esposito.  Collective power: minimal model for thermodynamics of nonequilibrium phase transitions.  Phys. Rev. X, 8(3):031056, 2018.
  * [36] Ohad Shpielberg, Takahiro Nemoto, and João Caetano.  Universality in dynamical phase transitions of diffusive systems.  Phys. Rev. E, 98(5):52116, 2018.
  * [37] Hadrien Vroylandt, Massimiliano Esposito, and Gatien Verley.  Efficiency fluctuations of stochastic machines undergoing a phase transition.  Phys. Rev. Lett., 124(25):250603, 2020.
  * [38] Thomas Martynec, Sabine H L Klapp, and Sarah A M Loos.  Entropy production at criticality in a nonequilibrium Potts model.  New J. Phys., 22(9):093069, 2020.
  * [39] Karel Proesmans, Raul Toral, and Christian den Broeck.  Phase transitions in persistent and run-and-tumble walks.  Phys. A Stat. Mech. its Appl., 552:121934, 2020.
  * [40] Yann-Edwin Keta, Étienne Fodor, Frédéric van Wijland, Michael E Cates, and Robert L Jack.  Collective motion in large deviations of active particles.  Phys. Rev. E, 103(2):022603, 2021.
  * [41] Jakob Mehl, Thomas Speck, and Udo Seifert.  Large deviation function for entropy production in driven one-dimensional systems.  Phys. Rev. E, 78(1):011123, 2008.
  * [42] D Lacoste, A W C Lau, and K Mallick.  Fluctuation theorem and large deviation function for a solvable model of a molecular motor.  Phys. Rev. E, 78(1):011915, 2008.
  * [43] Antoine Gerschenfeld and Bernard Derrida.  Current fluctuations at a phase transition.  EPL (Europhysics Lett., 96(2):20001, 2011.
  * [44] Pelerine Tsobgni Nyawo and Hugo Touchette.  A minimal model of dynamical phase transition.  EPL (Europhysics Lett., 116(5):50009, 2016.
  * [45] Robert L Jack and Peter Sollich.  Large deviations and ensembles of trajectories in stochastic models.  Prog. Theor. Phys. Suppl., 184:304–317, 2010.
  * [46] Pelerine Tsobgni Nyawo and Hugo Touchette.  Dynamical phase transition in drifted Brownian motion.  Phys. Rev. E, 98(5):052103, 2018.
  * [47] Takahiro Nemoto, Étienne Fodor, Michael E Cates, Robert L Jack, and Julien Tailleur.  Optimizing active work: Dynamical phase transitions, collective motion, and jamming.  Phys. Rev. E, 99(2):022605, 2019.
  * [48] Marc Sune and Alberto Imparato.  Out-of-Equilibrium Clock Model at the Verge of Criticality.  Phys. Rev. Lett., 123(7):070601, aug 2019.
  * [49] Alexandre Lazarescu, Tommaso Cossetto, Gianmaria Falasco, and Massimiliano Esposito.  Large deviations and dynamical phase transitions in stochastic chemical networks.  J. Chem. Phys., 151(6):064117, 2019.
  * [50] Tim Herpich, Tommaso Cossetto, Gianmaria Falasco, and Massimiliano Esposito.  Stochastic thermodynamics of all-to-all interacting many-body systems.  New J. Phys., 22(6):063005, 2020.
  * [51] Marco Baiesi and Christian Maes.  An update on the nonequilibrium linear response.  New J. Phys., 15(1):013004, 2013.
  * [52] Gianmaria Falasco and Marco Baiesi.  Nonequilibrium temperature response for stochastic overdamped systems.  New J. Phys., 18(4):043039, 2016.
  * [53] Nahuel Freitas, Gianmaria Falasco, and Massimiliano Esposito.  Linear response in large deviations theory: a method to compute non-equilibrium distributions.  New J. Phys., 23(9):93003, sep 2021.
  * [54] Raphaël Chetrite and Hugo Touchette.  Variational and optimal control representations of conditioned and driven processes.  J. Stat. Mech. Theory Exp., 2015(12):P12001, 2015.
  * [55] Robert L Jack.  Ergodicity and large deviations in physical systems with stochastic dynamics.  Eur. Phys. J. B, 93(4):1–22, 2020.
  * [56] Stephen Whitelam, Daniel Jacobson, and Isaac Tamblyn.  Evolutionary reinforcement learning of dynamical large deviations.  J. Chem. Phys., 153(4):44113, 2020.
  * [57] Dominic C Rose, Jamie F Mair, and Juan P Garrahan.  A reinforcement learning approach to rare trajectory sampling.  New J. Phys., 23(1):13013, 2021.
  * [58] Jiawei Yan, Hugo Touchette, and Grant M Rotskoff.  Learning nonequilibrium control forces to characterize dynamical phase transitions.  Phys. Rev. E, 105(2):24115, feb 2022.
  * [59] Yongjoo Baek and Yariv Kafri.  Singularities in large deviation functions.  J. Stat. Mech. Theory Exp., 2015(8):P08026, 2015.
  * [60] Camille Aron and Claudio Chamon.  Landau Theory for Non-Equilibrium Steady States.  SciPost Phys., 8(5):74, 2020.
  * [61] Roi Holtzman and Oren Raz.  Landau Theory for the Mpemba Effect Through Phase Transitions.  arXiv Prepr. arXiv2204.03995, 2022.
  * [62] Jan Meibohm and Massimiliano Esposito.  Finite-Time Dynamical Phase Transition in Nonequilibrium Relaxation.  Phys. Rev. Lett., 128(11):110603, 2022.
  * [63] Christof Külske and Arnaud Le Ny.  Spin-flip dynamics of the Curie-Weiss model: Loss of Gibbsianness with possibly broken symmetry.  Commun. Math. Phys., 271(2):431–454, 2007.
  * [64] Victor Ermolaev and Christof Külske.  Low-temperature dynamics of the Curie-Weiss model: Periodic orbits, multiple histories, and loss of Gibbsianness.  J. Stat. Phys., 141(5):727–756, 2010.
  * [65] Markus Heyl, Anatoli Polkovnikov, and Stefan Kehrein.  Dynamical quantum phase transitions in the transverse-field Ising model.  Phys. Rev. Lett., 110(13):135704, 2013.
  * [66] Markus Heyl.  Dynamical quantum phase transitions: a review.  Reports Prog. Phys., 81(5):54001, 2018.
  * [67] Christian den Broeck and Massimiliano Esposito.  Ensemble and trajectory thermodynamics: A brief introduction.  Phys. A Stat. Mech. its Appl., 418:6–16, 2015.
  * [68] Frank Den Hollander.  Large deviations.  American Mathematical Soc., 2008.
  * [69] Hugo Touchette.  The large deviation approach to statistical mechanics.  Phys. Rep., 478(1):1–69, 2009.
  * [70] Federico Corberi, Giuseppe Gonnella, Antonio Piscitelli, and Marco Zannetti.  Heat exchanges in a quenched ferromagnet.  J. Phys. A Math. Theor., 46(4):42001, 2013.
  * [71] A Crisanti, A Sarracino, and M Zannetti.  Heat fluctuations of Brownian oscillators in nonstationary processes: Fluctuation theorem and condensation transition.  Phys. Rev. E, 95(5):52138, 2017.
  * [72] N.G. Van Kampen.  Stochastic Processes in Physics and Chemistry.  In Stoch. Process. Phys. Chem. Elsevier, 2007.
  * [73] M I Dykman, E Mori, J Ross, and P M Hunt.  Large fluctuations and optimal paths in chemical kinetics.  J. Chem. Phys., 100:5735, 1994.
  * [74] Alberto Imparato and Luca Peliti.  Work-probability distribution in systems driven out of equilibrium.  Phys. Rev. E, 72(4):046114, 2005.
  * [75] Jin Feng and Thomas G Kurtz.  Large deviations for stochastic processes.  Number 131. American Mathematical Soc., 2006.
  * [76] Richard Courant and David Hilbert.  Methods of mathematical physics, Volume II.  John Wiley & Sons, 1962.
  * [77] Denis J Evans and Debra J Searles.  The fluctuation theorem.  Adv. Phys., 51(7):1529–1585, 2002.
  * [78] Udo Seifert.  Entropy production along a stochastic trajectory and an integral fluctuation theorem.  Phys. Rev. Lett., 95(4):40602, 2005.
  * [79] Karel Proesmans and Bernard Derrida.  Large-deviation theory for a Brownian particle on a ring: a WKB approach.  J. Stat. Mech. Theory Exp., 2019(2):23201, 2019.