\section{Introduction}

The gravitational path integral requires not only a sum over metrics on a manifold of a given topology, but also a sum over manifolds of different topologies.\footnote{For an opposing viewpoint, arguing not to include topology change, see for example \cite{Anderson:1986ww}.}
One strong reason to include a sum over topologies in the gravitational path integral is that doing so gives us the Hawking-Page transition in Anti-de Sitter space \cite{Hawking:1982dh}, which, famously, is the bulk dual of the confinement-deconfinement transition in gauge theory \cite{Witten:1998zw, Aharony:2003sx}.\footnote{
However, note that there is still room for a sum over only certain topologies, as long as the sum is unambiguously defined. For example, in two dimensions, we can choose to sum either over just the oriented manifolds, or to sum over oriented and unoriented manifolds. The recent papers \cite{Maloney:2020nni, Afkhami-Jeddi:2020ezh} featured a sum over a restricted class of three-manifolds, the so-called handlebodies.}

While the topological classification of three- and higher-dimensional manifolds is quite complicated, in two-dimensional gravity theories, such as worldsheet string theory \cite{Polchinski:1998rq} or Jackiw-Teitelboim (JT) gravity \cite{Jackiw:1984je, Teitelboim:1983ux, Maldacena:2016upp}, the sum over topologies reduces to a sum over the Euler characteristic of the manifold, a single integer.
Recently, there has been a surge of interest in the sum over different topologies in the gravitational path integral.
For instance, in \cite{Almheiri:2019qdq,pssy} it was argued that spacetime wormholes are crucial in understanding entropy paradoxes in black hole physics.
The sum over different topologies also plays a crucial role in the interpretation of JT gravity as a random matrix theory, and the computation of the ramp and plateau regions of the spectral form factor \cite{largen,sss1, sss2}.

A systematic way to quantize a theory that involves topology change and multiple universes is the so-called ``third quantization" formalism \cite{Strominger:1988ys}.
Third quantization is a bad name for reasons that will become clear later in this note, but we stick with it because of legacy.
The name string field theory (which is the field theory of multiple strings) suggests that ``universe field theory" would perhaps be a more appropriate name.\footnote{
We thank Juan Maldacena for suggesting this name.}
This formalism has been reviewed and clarified in a recent paper by Marolf and Maxfield \cite{mm}.
An incomplete list of references is \cite{Hawking:1984hk, Hawking:1991vs, Coleman:1988cy,Coleman:1988tj, Giddings:1987cg, Giddings:1988cx, Giddings:1988wv}.

Given the recent interest in this subject, one of our aims in this brief note is to clarify some of the conceptual features of third quantization.
Much of the mystery of this formalism disappears if we keep in mind the example of worldline gravity, where the third-quantized theory is just the Klein-Gordon theory, as we review in section \ref{sec:worldline}.
The worldline gravity discussion also shows us that the commutativity of boundary-creating operators, which is necessary for constructing the alpha states and having a dual ensemble interpretation, is subtle.
For example, the Klein-Gordon field operators do not commute at timelike separation.
However, as usual, if the target space (which, in general, would be ``superspace") is analytically continued to Euclidean signature, we do expect the boundary-creating operators to commute.\footnote{
Superspace has infinitely many negative-signature directions and this analytic continuation might be subtle.}
We also point out that the general construction of the baby universe Hilbert space is the same as the Gelfand-Naimark-Segal (GNS) construction in algebraic QFT.

In order to talk about quantities like the entropy of the density matrix of the universe, we first need to specify a global state in the multi-universe Hilbert space.
There are multiple options for the global state, as we review in section \ref{sec:mainArgument}.
One feature of different global density matrices, defined by the gravitational path integral, is whether or not manifolds connecting the bra and the ket, or a bra-ket wormholes, exist.
The choice of whether or not to include bra-ket wormholes is not a free choice, rather it depends on which global state we pick.
Two special global states are the Hartle-Hawking state \cite{Hartle:1983ai, HAWKING1984257}, which does not have bra-ket wormholes, and the Page state \cite{Page:1986vw}, which includes bra-ket wormholes.
Most of the observations in these sections \ref{sec:worldline} and \ref{sec:mainArgument} are not new and have already appeared in the early literature on quantum cosmology; our aim is to present them in a way that we found useful.

Section \ref{sec:implications} is devoted to some implications of these observations.
Perhaps most interestingly, we find an application for the notion of effective wormholes, due to \cite{diagcyl}.
The bra-ket wormholes that are needed to resolve the bags-of-gold type paradoxes in de Sitter (as in section 6 of \cite{pssy}) and strong subadditivity paradoxes \cite{cgmupcoming} would need to ``emerge" in the Hartle-Hawking state, since they are not originally present in the definition of the Hartle-Hawking state.
One way this can happen is if the density matrix of the Hartle-Hawking state, restricted to a single, late-time classical universe, contains effective wormholes obtained by tracing out the unobserved universes.
More extreme possibilities are that the Hartle-Hawking state could be non-perturbatively gauge equivalent to a state with bra-ket wormholes, or that the baby universe Hilbert space is one-dimensional.
In section \ref{sec:adsaitorjuan} we discuss how boundary entropy computations in AdS are conceptually different, and emphasize that the replica wormholes in that case are simply the wormholes between the various ket boundaries in the bulk Hartle-Hawking state.

Throughout this paper, by the baby universe Hilbert space, or the third-quantized Hilbert space, we will mean the Hilbert space that was denoted $\mathcal{H}_{\rm BU}$ or $\mathcal{H}_{0,0}$ in \cite{mm}.

\emph{Note added:} While this article was nearing completion, the paper \cite{monicagns} appeared which has some overlap with our section \ref{sec-gns}.

\section{Third quantization through the lens of worldline gravity}
\label{sec:worldline}

Let us recall some basic facts regarding 1d gravity.
We specialize to a class of theories describing worldlines embedded in Minkowski space $\mathbb{R}^{1,d-1}$ \cite{Polchinski:1998rq, Strominger:1988ys}.
The worldline fields are an einbein $e(\tau)$ and $d$ scalar fields $x^{\mu}(\tau)$ with action
\begin{align}
    I_{\rm WL}[e, x^\mu] = \int_{\tau_i}^{\tau_f} \d \tau\, (e^{-1}\dot{x}^{\mu}\dot{x}^{\nu}\eta_{\mu\nu} - m e)\, .
    \label{SWL}
\end{align}
This theory is invariant under reparametrizations of the worldline time $\tau$.
Apart from its simplicity, the main advantage of this theory is that the ``third-quantized'' theory describing multiple 1d universes \cite{Strominger:1988ys} is just the Klein-Gordon scalar field theory in $d$-dimensional Minkowski space.\footnote{Usually, the Klein-Gordon theory would be obtained as a ``second quantization" of single-particle wavefunctions, without any reparametrization invariance involved at any stage.
Indeed, the worldline perspective and the Schwinger proper-time representation of the propagator is useful even in practical QFT calculations \cite{Schubert:1996jj} or exploring the analyticity structure of Feynman diagrams (see Chapter 18 of \cite{Bjorken:1965zz}).}
If the worldlines are not allowed to split, we get a free theory.
By allowing a worldline to branch into two, and two worldlines to fuse into one, we can get a $\phi^3$ theory in target space.

A typical computation in this theory would be to sum over all worldlines, or 1d manifolds $X$, with boundary $\partial X$ consisting of $n+m$ points, and each boundary point labelled by a point in $\mathbb{R}^{1,d-1}$.
Picking points $x_1, \ldots, x_m \in \mathbb{R}^{1,d-1}$ to be the ``past" boundaries, and $y_1, \ldots, y_n \in \mathbb{R}^{1,d-1}$ to be the ``future" boundaries, we denote this quantity by
\begin{align}
    \langle y_1 \ldots y_n \, \vert \,
    x_1 \ldots x_m
    \rangle := \int_{X : \, |\partial X| = n+m} e^{- I_\text{WL}}=\begin{gathered}\includegraphics[height=3cm]{mtondiag.pdf} \end{gathered}
    \label{1dgravobs}
\end{align}
Note that these quantities are the precise analogs of the quantities $\langle Z[\widetilde{J}_1] \ldots Z[\widetilde{J}_n] \, \vert \, Z[J_1] \ldots Z[J_m] \rangle$ considered in \cite{mm} (see their equation (2.5)).\footnote{
In analogy to the well established notation in worldline gravity, we would prefer to denote these quantities as $\langle \widetilde{J}_1 \ldots \widetilde{J}_n  \vert J_1 \ldots J_m \rangle$, without the letter $Z$.
The reason in \cite{mm} for adopting the notation $Z$ was the anticipation of a boundary dual, but from the perspective of the bulk path integral, it is perhaps more natural to omit the letter $Z$.}
These analogies and others that will be discussed below are summarised in table \ref{tab:comparison}.

\begin{table}[t]
\vspace{10pt}
    \centering
    \begin{tabular}{|c|c|}
     \hline Worldline gravity/Klein-Gordon theory & Worldvolume gravity/Universe field theory\\[4pt]\hline
     $\mathfrak{S} = \mathbb{R}^{1,d-1}$ &
         $\mathfrak{S} = \text{superspace}$ \\
        $x\in \mathbb{R}^{1,d-1}$ & $J \in \text{superspace}$ \\
          $\ket{\text{KG-vac}}$ & $\ket{\rm HH}$\\[4pt]
           $\ket{x} = \phi(x)\ket{\text{KG-vac}}$ &
           $\vert J \rangle = \phi(J)\, \vert \text{HH} \rangle$ or $\ket{Z[J]} = \widehat{Z[J]}\ket{\rm HH}$ \\[4pt]
         $\braket{y|x}$ & $\braket{J_1|J_2}$ or $\braket{Z[J_1]\, |\, Z[J_2]}$ \\[4pt]
         $\langle \text{KG-vac} \, \vert \phi(x) \phi(y) \, \vert \text{KG-vac}\rangle$ &
         $\langle \text{HH} \, \vert \phi(J_1)\, \phi(J_2)  \, \vert \text{HH} \rangle$ or
         $\langle \text{HH} \, \vert \widehat{Z[J_1]}\, \widehat{Z[J_2]}  \, \vert \text{HH} \rangle$ \\[4pt]
         $-\Box + m^2 = 0$ & $H_{\rm WdW} = 0$ \\
         \hline
    \end{tabular}
    \caption{Comparison between objects in worldline gravity, whose third quantization leads to Klein-Gordon theory, and higher-dimensional gravity theories whose third-quantized description should perhaps be called universe field theory, imitating the name string field theory. The word superspace is used like it is used in quantum cosmology, it is the space of spatial metrics modulo spatial diffeomorphisms.
    In general, $\mathfrak{S}$ is the space of boundary conditions in the ``worldvolume path integral", and each element of $\mathfrak{S}$ represents a boundary condition that can be imposed on a single connected component of the boundary.
    The notation involving $Z[J]$'s is due to \cite{mm}.
    }
    \label{tab:comparison}
\end{table}

The simplest nonzero quantity of the form (\ref{1dgravobs}) corresponds to just having one point in the past and one point in the future.
It is well-known that this computes the Klein-Gordon propagator:\footnote{Depending on the range of integration of the lapse variable, we can either get two-point functions that obey the homogeneous Klein-Gordon equation, or two-point functions that obey the Klein-Gordon equation with a delta-function source.
For details, see, for example \cite{PhysRevD.38.2468}.
Notice also that the states $\ket{x}$ are not orthonormal.
See also \cite{Cohen:1985sm} for an analogous computation of the off-shell propagator for strings in a special case.}
\begin{align}
    \langle y \vert x\rangle =
    \langle \text{KG-vac} \, \vert \, \phi(y) \phi(x) \, \vert\, \text{KG-vac}\rangle\, ,
    \label{propwlkg}
\end{align}
with $\ket{\text{KG-vac}}$ the standard Klein-Gordon vacuum.
Similarly, the general quantity in (\ref{1dgravobs}) will compute an $(n+m)$-point function in the Klein-Gordon theory.
The relation (\ref{propwlkg}) and similar expressions for the higher point functions make it clear that the usual Klein-Gordon vacuum state $\vert \text{KG-vac} \rangle$ is the precise analog of the Hartle-Hawking state $\vert \rm{HH} \rangle$ \cite{Hartle:1983ai}, and also that the field operators $\phi(x)$ are the precise analogs of what were called the $\widehat{Z[J]}$ operators in \cite{mm}.
See table \ref{tab:comparison} and section \ref{sec:mainArgument} for some more details.
With the benefit of hindsight and because of this direct analogy to the Klein-Gordon theory, perhaps $\phi(J)$ is a better notation for $\widehat{Z[J]}$.
Below we will use $\phi(J)$ and $\widehat{Z[J]}$ interchangeably.

Null states, which played a crucial role in \cite{mm}, also exist in this 1d gravity model.
To see this, note that the field operator $\phi(x)$ is labeled by a point $x$ in $\mathbb{R}^{1,d-1}$, it is not restricted to a single Cauchy slice.
However, the hyperbolic nature of the Klein-Gordon equation allows us to relate the field operator $\phi(t,\mathbf{x})$ to a linear combination of $\phi(0,\mathbf{x})$, and these relationships give rise to null states.
The Klein-Gordon equation in this model is the analog of the Wheeler-DeWitt equation in higher-dimensions.

In general, if we have some reparametrization-invariant path integral with some set $\mathfrak{S}$ of allowed boundary conditions, then we should consider $\mathfrak{S}$ as our ``target spacetime" and the collection of field operators would be $\phi(J)$ for every $J \in \mathfrak{S}$.
The role of $\phi(J)$ is to insert a boundary in the ``worldvolume" path integral with boundary condition $J$.
Note also that in general the space $\mathfrak{S}$ is infinite dimensional, has no symmetries, and can have an infinite number of negative signs in its metric signature.

For $D$-dimensional gravity,\footnote{Note that we are deliberately using $D$ here, rather than $d$, to distinguish it from the target space of worldline gravity.} the space $\mathfrak{S}$ is called superspace and consists of all $(D-1)$-metrics $h_{ij}(\sigma)$ modulo parallel diffeomorphisms.
Here $\sigma$ denotes the collection of $D-1$  coordinates on the worldvolume.
The Wheeler-DeWitt equation is a functional differential equation, and it resembles a Laplacian on a space with an infinite number of timelike directions.
It is a well-known fact that the conformal factor of $h_{ij}(\sigma)$ for each $\sigma$ corresponds to a time-like direction in $\mathfrak{S}$, along which the line-element is negative.
One can further speculate whether there is some notion analogous to a Cauchy slice in QFT, i.e. a subset $\mathfrak{C} \subset \mathfrak{S}$ such that the collection of field operators $\phi(J)$ with $J \in \mathfrak{C}$ constitutes the linearly independent field operators.

To make things a bit more concrete, a useful example to keep in mind is JT gravity with a positive cosmological constant. This theory was discussed in detail in \cite{Maldacena:2019cbz, Cotler:2019nbi} (see also \cite{Iliesiu:2020zld}) and describes the fluctuations of a boundary mode in rigid dS$_2$.
The superspace $\mathfrak{S}$ consists of a variable corresponding to the boundary length $\ell$ (which is all that remains of $h_{ij}(\sigma)$ after gauge-fixing the spatial diffeomorphisms), and the dilaton profile $\Phi(\sigma)$.
In the minisuperspace approximation, where $\Phi$ is taken to be constant, $\mathfrak{S}$ reduces to two-dimensional Minksowki space and the Wheeler-DeWitt equation is a Klein-Gordon equation for a massive charged scalar in an electric field. The null states would therefore be analogous to the ones found in the 1d gravity theory.

\subsection{Commutativity of operators, and operator products}
A very important claim of \cite{mm} is that, for any $J_1, J_2 \in \mathfrak{S}$, the operators $\widehat{Z[J_1]}$ and $\widehat{Z[J_2]}$  commute.
These operators can thus be simultaneously diagonalized to yield a basis of the so-called alpha states.
In the boundary dual description, each alpha parameter labels a member of an ensemble of theories, and the eigenvalue of $\widehat{Z[J]}$ in an individual alpha state is interpreted as the numerical value of the partition function $Z[J]$ in a specific boundary theory.

The argument in \cite{mm} (see the discussion around their equation (2.16)) for the commutativity of $\widehat{Z[J_1]}$ and $\widehat{Z[J_2]}$ for any $J_1, J_2 \in \mathfrak{S}$ operators is based on the fact that exchanging the two boundaries corresponding to $J_1$ and $J_2$ does nothing to the path integral.
We want to point out that this argument is perhaps too quick, and that the statement of commutativity deserves a more careful analysis.

Recall that in the Klein-Gordon theory, we have
\begin{align}
    [\phi(t_1,\mathbf{x}_1) , \phi(t_2,\mathbf{x}_2) ]
    \neq 0
\end{align}
if the points $(t_1, \mathbf{x}_1)$ and $(t_2, \mathbf{x}_2)$ are timelike separated.
This is a seeming counterexample to the above claim about the commutativity of any two of the  $\widehat{Z[J]}$ operators.
Note however that if the target space in the Klein-Gordon theory is Wick-rotated to Euclidean signature, these operators do commute.
This fact will be discussed more completely in an upcoming publication \cite{mmupcoming}, where it will be argued that, at least in this respect, the universe field theory is more similar to QFT in Euclidean signature.\footnote{We thank Don Marolf and Henry Maxfield for correspondence on this point.}
Here, we just want to point out that this is a subtle issue that involves analytic continuations in the target space $\mathfrak{S}$.
In this context, see also section 8 of \cite{Giddings:1988wv} (especially the discussion around their equation (8.5)) which takes the view that the boundary-creating operators do not commute in general, even in higher-dimensional gravity.

It is interesting to note that the theories dual to AdS are conformal, and hence their partition functions only depend on the conformal class of the boundary metric, with the anomaly coefficients of the boundary encoded in the bulk coupling constants.
In other words, the dependence of $Z[J]$ on the ``timelike" directions in $\mathfrak{S}$ seems to be completely determined from a subset $\mathfrak{C} \subset \mathfrak{S}$.
Thus, in order to retain the ensemble interpretation needed in AdS, it might be enough that the field operators $\widehat{Z[J_1]}$ and $\widehat{Z[J_2]}$ commute only whenever $J_1, J_2 \in \mathfrak{C} \subset \mathfrak{S}$.
This last property is indeed true even in the Lorentzian Klein-Gordon theory with $\mathfrak{C} = \mathbb{R}^{d-1}$ and $\mathfrak{S} = \mathbb{R}^{1,d-1}$.

Another interesting question is about singularities in operator products.
It is well-known that operator products in Euclidean QFT have singularities as the two operator insertions becomes coincident.
These singularities become branch cuts on the lightcone when continued to Lorentzian signature, and these branch cuts give rise to nonzero commutators when operators become timelike separated.

Relatedly, if we are given a list of correlators $\langle \text{KG-vac} \vert \phi(t_1, \mathbf{x}_1) \ldots \phi(t_n, \mathbf{x}_n) \vert \text{KG-vac} \rangle$ for all $n$ and all $(t_i, \mathbf{x}_i)$ in a pertubative scalar field theory, we can take derivatives with respect to $t_i$ and get correlators involving the conjugate field $\pi(t_i, \mathbf{x}_i)$.\footnote{We thank Douglas Stanford for asking us about the canonical momentum operator.}
Thus, from the perspective of worldline gravity, computing correlators of $\pi$ involves computing the change in the path integral when we perturb the boundary conditions $J \in \mathfrak{S}$.
Note that the canonical commutation relation between $\phi$ and $\pi$ could be determined from these correlators.

Thus, it is an interesting question to ask in universe field theory whether there are any singularities in the operator product $\phi(J_1) \phi(J_2) = \widehat{Z[J_1]} \, \widehat{Z[J_2]}$ in the coincident limit $J_1 \to J_2$.
If this operator product is singular, generically there should be operators acting on $\mathcal{H}_\text{BU}$ that do not commute with $\widehat{Z[J]}$.
If the theory is furthermore weakly coupled, we could take derivatives along some direction in $\mathfrak{S}$ and construct an analog of an operator $\pi(J)$, which is canonically conjugate to $\phi(J)$.
On the other hand, if operator products in the universe field theory are completely non-singular, the operator algebra will be Abelian.
This latter possibility would be a desirable result, because, in gravity theories that have a boundary dual (which in general, could be a disorder-averaged theory), it is hard to give a boundary interpretation to the operators that do not commute with $\widehat{Z[J]}$ \cite{mm}.

These OPE-type coincidence singularities exist for loop operators \cite{Banks:1989df} in minimal string theory, at least in the genus expansion.
Concretely, the operator to consider is the density of eigenvalues of the matrix integral, written in third-quantized notation as $\widehat{\rho(x)}$.
The operator $\widehat{\rho(x)}$ is just a specific example of the general $\widehat{Z[J]}$ operator.
The eigenvalue direction $x$ of the dual matrix integral is known to be the target space coordinate for $\mathfrak{S}$ in minimal string theories \cite{Maldacena:2004sn}, and is thus the appropriate ``position-space" variable to diagnose the coincidence limit.
Perturbatively, we have $\widehat{\rho(x)} \widehat{\rho(y)} \sim -{(x-y)^{-2}}$; see, for example, equation (139) in \cite{sss2}.\footnote{We thank Douglas Stanford for pointing this out.}
Akin to singularities in a BCFT as operators approach the boundary, there are also singularities in the loop operators as $x \to 0$, which is a boundary of $\mathfrak{S}$ in perturbation theory.
Thus, at least perturbatively, there exist operators that do not commute with $\widehat{\rho(x)}$.
In the string field theory of the $c=1$ matrix model \cite{Das:1990kaa} this becomes completely explicit:
The density of eigenvalues is taken to be the field variable, and this field also has a canonical momentum.
It is interesting that, non-perturbatively, the two-point function of $\widehat{\rho(x)}$ gets corrected and is replaced by the sine-kernel which washes out the $(x-y)^{-2}$ singularity.
It thus remains an open possibility that non-perturbative effects in gravity remove all such OPE-type singularities, and all the $\widehat{Z[J]}$ operators commute.

\subsection{Relation to the GNS construction}
\label{sec-gns}

The procedure described in \cite{mm} for constructing the third-quantized Hilbert space is analogous to the Gelfand-Naimark-Segal (GNS) construction in algebraic quantum field theory;
see theorem 2.34 of \cite{Pontello:2020csg} for a brief explanation of the GNS construction and for more references.
In the GNS construction, we are given an algebra of operators and a state $\omega$, which is defined abstractly as a positive linear map from the operator algebra into $\mathbb{C}$.
In \cite{mm}, the algebra includes all sums of products of the field operators $\phi(J)$, and the state is the linear map that maps the product $\phi(J_1) \ldots \phi(J_n)$ to the complex number computed by the worldvolume path integral with boundaries corresponding to $J_1, \ldots, J_n$.
The GNS method first constructs a pre-Hilbert space, which is the span of all formal kets $\ket{A}$, where $A$ is any operator in the algebra.
The inner product is defined as $\langle A \vert B \rangle := \omega(A^* B)$.
This pre-Hilbert space contains null vectors, which are modded out to give the GNS Hilbert space.\footnote{Technically, one also needs to add appropriate limit points to ensure completeness (in the sense of a metric space).}
This makes the analogy to \cite{mm} clear.
Notice that this construction of the Hilbert space takes as input \emph{all} correlation functions in a \emph{single} state.
See also the recent paper \cite{monicagns} for more on the relationship between the GNS construction and baby universes.

\section{Global states in the third-quantized Hilbert space}
\label{sec:mainArgument}

\newcommand{\Psi_\text{HH}}{\Psi_\text{HH}}
\newcommand{\rho_\text{Page}}{\rho_\text{Page}}

In this section, we discuss various possibilities for the choice of a global state in the third-quantized Hilbert space $\mathcal{H}_\text{BU}$.

Hartle and Hawking \cite{Hartle:1983ai} constructed a particular state $\ket{\text{HH}}$
in the third-quantized Hilbert space, as follows.
Consider a $D$-dimensional theory of gravity.
Let $Y$ denote a closed $(D-1)$-dimensional manifold, \emph{not necessarily connected}.
The Hartle-Hawking state is a function that assigns a complex number to each closed $(D-1)$-manifold $Y$
\begin{align}
    \Psi_\text{HH} (Y) := \int_{X: \partial X = Y} e^{-I(X)}\,,
    \label{hhstate}
\end{align}
where the integration is to be done over all $D$-manifolds $X$ such that $\partial X = Y$.
We work with unnormalized states and density matrices.
The analogous object in the worldline theory is
\begin{align}
    \Psi_{\text{KG-vac}} (x_1, \ldots, x_n) :=
    \int_{X: \vert \partial X \vert = n} e^{-I_\text{WL}}\,,
    \label{kgstate}
\end{align}
where $X$ is a one-dimensional manifold and $x_i \in \mathbb{R}^{1,d-1}$.
Note that $\Psi_{\text{KG-vac}}$ depends on the tuple $(x_1, \ldots, x_n)$, and the non-negative integer $n$ is arbitrary.
Note that (\ref{hhstate}) is equal to the correlation function $\bra{\text{HH}} \phi(w_1) \ldots \phi(w_n) \ket{\text{HH}}$ where $w_1, \ldots w_n$ are the connected components of $Y$, and that (\ref{kgstate}) is equal to the correlation function $\bra{\text{KG-vac}} \phi(x_1) \ldots \phi(x_n) \ket{\text{KG-vac}}$.
Both (\ref{hhstate}) and (\ref{kgstate}) can be thought of as expressing the wavefunction in an overcomplete set of non-orthonormal states.
The Klein-Gordon vacuum state would usually be written in the orthonormal basis of eigenstates of the field operators $\phi(\mathbf{x})$ as $\langle \phi(\mathbf{x}) \vert \text{KG-vac}\rangle$, but (\ref{kgstate}) is also correct, and is directly analogous to (\ref{hhstate}) \cite{Hartle:1983ai}.
See section \ref{sec-gns} for more details about how all correlation functions in a single state encode the full Hilbert space.
The analog of $\langle \phi(\mathbf{x}) \vert \text{KG-vac}\rangle$ in the universe field theory is $\langle \alpha \vert \text{HH} \rangle$ \cite{mm}.

In \cite{Page:1986vw}, Page proposed a state for the universe, which is \emph{different} than the state proposed by Hartle and Hawking in \cite{Hartle:1983ai}.
Page's state is a density matrix $\rho_\text{Page}$ whose components (in an overcomplete non-orthonormal basis) are given by
\begin{align}
    \rho_\text{Page}(Y_1, Y_2) := \int_{X: \partial X = \overline{Y_1} \cup Y_2}\,
    e^{- I(X)}\,.
    \label{pageconj}
\end{align}
Again, we emphasize that neither $Y_1$ nor $Y_2$ is required to be connected, and in general they have different numbers of connected components.
The overline indicates orientation reversal and accounts for complex conjugation in the bra.
Note that the right hand side of (\ref{pageconj}) is the same as the object $\langle Y_1 \vert Y_2 \rangle$.
The punchline of \cite{Page:1986vw} is that because there exist Euclidean wormholes $X$ that connect $Y_1$ and $Y_2$, these configurations enter the path integral on the right hand side of (\ref{pageconj}) and render the state $\rho_\text{Page}$ mixed.

Next, we actually note that\footnote{We thank Don Marolf and Henry Maxfield for discussions on this point.}
\begin{align}
    \rho_\text{Page} = \mathbb{1}_{\mathcal{H}_\text{BU}} \,,
    \label{rhopageequalid}
\end{align}
where $\mathbb{1}_{\mathcal{H}_\text{BU}}$ is the identity matrix on the baby universe Hilbert space.\footnote{Note that this density matrix is ill-defined if the Hilbert space is infinite dimensional.}
This is true, because, according to (\ref{pageconj}), $\rho_\text{Page}(Y_1, Y_2) = \braket{Y_1\vert Y_2}$ with \emph{nothing} else inserted in the path integral.
In particular, if $\text{dim } \mathcal{H}_\text{BU}>1$, we see that
\begin{align}
    \rho_\text{Page} \neq \vert \text{HH} \rangle \, \langle \text{HH} \vert\, .
    \label{pageneqhh}
\end{align}
In more detail, note that the components of the density matrix corresponding to $\ket{\text{HH}}$ are given by
\begin{align}\label{proposalrho}
\rho_\text{HH}(Y_1,Y_2) = \Psi_{\rm HH}(Y_1)^*
\, \Psi_{\rm HH}(Y_2)~.
\end{align}
The right hand side of (\ref{proposalrho}) is a product of two independent path integrals, \emph{without any wormholes connecting} $Y_1$ and $Y_2$.
This is simply because $\Psi_\text{HH}(Y_1)$ and $\Psi_\text{HH}(Y_2)$ are well-defined objects that have already been defined in (\ref{hhstate}).
We cannot add additional wormholes between $Y_1$ and $Y_2$.
The difference between $\rho_{\rm page}$ and $\rho_{\rm HH}$ is illustrated in figure \ref{fig:pageHH}, as also originally noted in \cite{Page:1986vw}.
\begin{figure}[t]
    \centering
    \includegraphics[width=\textwidth]{pageHH.pdf}
    \caption{The difference between the Page density matrix $\rho_{\rm Page}$ and the density matrix $\rho_{\rm HH}$ corresponding to $\ket{\text{HH}}$.
    This figure depicts contributions to a particular matrix element of these density matrices in two-dimensional gravity where a general $Y$ is a union of disconnected circles.
    In red we indicated the bra and in blue the ket.
    In the Page density matrix (\ref{pageconj}) \cite{Page:1986vw}, bra-ket wormholes are present, whereas they are absent in the density matrix for the Hartle-Hawking state (\ref{proposalrho}) \cite{Hartle:1983ai}.
    In particular, the set of configurations that contribute to $\rho_\text{Page}(Y_1, Y_2)$ is a superset of the configurations that contribute to $\rho_\text{HH}(Y_1, Y_2)$.
     }
    \label{fig:pageHH}
\end{figure}

We believe this point should be non-controversial, but nevertheless it is important to highlight because it has important consequences.
For instance, there has been much recent work on the the spectral form factor in JT gravity, and its non-factorization
$\langle Z(\beta_1) Z(\beta_2)\rangle \neq \langle Z(\beta_1) \rangle\, \langle Z(\beta_2)\rangle$ \cite{largen, sss1, sss2}.
Here the left hand side is equal to
$\langle \text{HH} \vert \widehat{Z(\beta_1)}\widehat{Z(\beta_2)} \vert \text{HH} \rangle$,
whereas the right hand side is equal to
$\langle Z(\beta_1) \vert \text{HH} \rangle \langle \text{HH} \vert Z(\beta_2) \rangle $.
If we allowed wormholes connecting $Y_1$ and $Y_2$ on the right hand side of (\ref{proposalrho}), we would also say that $\langle Z(\beta_1) \vert \text{HH} \rangle \langle \text{HH} \vert Z(\beta_2) \rangle $ is computed by a two-boundary quantity with all possible wormholes connecting the two $Z$ insertions.
This sum would thus be exactly the same as $\langle \text{HH} \vert \widehat{Z(\beta_1)}\widehat{Z(\beta_2)} \vert \text{HH} \rangle$, and there would be no factorization puzzle.

If we allowed wormholes between products like that on the right hand side of (\ref{proposalrho}), the variance of all boundary-creating operators (which are all the operators) would be zero, and we would conclude that the third-quantized Hilbert space is one-dimensional.
Even though it would be desirable to prove that $\text{dim}\, \mathcal{H}_\text{BU} = 1$,\footnote{This statement has recently been included as a swampland conjecture \cite{McNamara:2020uza}.} this line of argumentation of connecting everything to everything is flawed.

Let us also comment on the density matrix considered in Hawking's paper \cite{Hawking:1986vj}, which was contemporaneous to \cite{Page:1986vw}.
Hawking considers tracing out all connected components of the spatial manifold except ``our own" connected universe, and interprets this object as the density matrix of the universe in which we live.
This is necessarily an approximate notion of a density matrix that would only make sense, for instance, at late times in de Sitter space.
See also section \ref{sec-oneuniv} below.
Instead, the object considered by Hawking is more appropriately identified as a two-boundary correlation function in the state $\ket{\text{HH}}$.

\section{Implications}
\label{sec:implications}

In the previous section we saw that the choice of a global state in the third-quantized Hilbert space defines what bra-ket wormholes can contribute.
We will now discuss two applications.
The first is to clarify what wormhole contributions are present in entropy computations, and the second is to discuss how approximate wormholes could arise when restricting to a single large connected universe.

\subsection{Bra-ket wormholes in entropy computations}
\label{sec:renyi}

Let us say we want to compute the quantity $(\text{Tr}\rho)^n$ where $\rho$ is a state on $\mathcal{H}_\text{BU}$.
The first point we want to emphasize is that before we try to compute $(\text{Tr}\rho)^n$, we should first specify which $\rho$ we are talking about.
In general, $\text{dim }\mathcal{H}_{\text{BU}} > 1$ and the global state of the universe can be chosen from an infinite number of possibilities.
So, let us pick a particular $\rho$, which means that we have a definite rule for computing $\rho(Y_1, Y_2)$ for each choice of $Y_1$ and $Y_2$.
For example, we could pick $\rho_\text{Page}$ which is defined in (\ref{pageconj}), or we could pick $\rho_\text{HH}$ which is defined in (\ref{hhstate}) and (\ref{proposalrho}).

Now, following the exact same logic as in the previous section, while computing $(\sum_Y\rho(Y,Y))^n$ we may not  freely add wormholes connecting an arbitrary subset of the various connected components of the $2n$ insertions of $Y$.
By specifying the state $\rho$ in question, the quantity $\rho(Y,Y)$ is completely well-defined (and it may or may not include bra-ket wormholes depending on what $\rho$ we picked).
In particular, the definition of $(\sum_Y\rho(Y,Y))^n$ is unambiguous: We should simply compute $\rho(Y,Y)$ for each $Y$ using the particular gravitational path integral in the definition of $\rho$, do the explicit sum over $Y$ by hand, and raise it to the $n$-th power.

Similar comments apply to $\text{Tr}(\rho^n)$.
The quantity $\sum_{Y_1, \ldots, Y_n} \rho(Y_1, Y_2) \ldots \rho(Y_n, Y_1)$ is unambiguously defined once we have specified the gravitational path integral that computes $\rho(Y_1, Y_2)$.

It might seem like $\text{Tr}(\rho^n)$ and $(\text{Tr}\rho)^n$ are both computed by the same gravity path integral \cite{pssy},\footnote{Note that \cite{pssy} restricted to the case when $Y$ is connected, see section \ref{sec-oneuniv} for this case.} leading one to believe that they are equal for any choice of $\rho$.
However, this reasoning is incorrect, because the only wormholes that can possibly appear are in the computation of the individual quantities $\rho(Y_1, Y_2)$, and then we should use the sums $\sum_{Y_1, \ldots, Y_n} \rho(Y_1, Y_2) \ldots \rho(Y_n, Y_1)$ and $(\sum_Y\rho(Y,Y))^n$ as the definitions $\text{Tr}(\rho^n)$ and $(\text{Tr}\rho)^n$, respectively.
For example, to reiterate our basic point, bra-ket wormholes are present in the gravitational path integral that computes $\rho_{\text{Page}}(Y_1, Y_2)$, while they are not present in the gravitational path integral that computes $\rho_{\text{HH}}(Y_1, Y_2)$.

Similarly, before discussing wormholes of the sort in section 6 of \cite{pssy} or in \cite{cgmupcoming}, which refer to one-universe density matrices, we first need to specify the global state $\rho$ in the universe field theory.
In section \ref{sec-oneuniv}, we discuss how such wormholes can be ``emergent" in special cases, even if they are not present in the original definition of $\rho$.

\subsection{Relation to entropy computations in holographic QFTs}
\label{sec:adsaitorjuan}

The Ryu-Takayanagi formula \cite{Ryu:2006bv, Casini:2011kv, Lewkowycz:2013nqa, Engelhardt:2014gca, Dong:2017xht} and its recent extensions involving ``bath" regions with non-dynamical gravity \cite{Penington:2019npb, Almheiri:2019psf, pssy, Almheiri:2019qdq, Almheiri:2020cfm} compute entropies defined purely in the dual quantum-mechanical system which has no gravity.
Conceptually, this is a very different quantity than computing the entropy of $\rho_\text{Page}$ or $\rho_\text{HH}$.
The density matrix whose entropy we want to compute in the AdS context is a state in the \emph{boundary} Hilbert space, whereas $\rho_\text{HH}$ and $\rho_{\text{Page}}$ are states in the baby universe Hilbert space $\mathcal{H}_{\text{BU}}$.
This is a fundamental difference, and we will denote density matrices in the boundary (plus bath, if present) Hilbert space by $\rho_\text{CFT}$.

For entropy calculations in a holographic QFT (plus bath, if present), we follow \cite{Lewkowycz:2013nqa} to first set up the replica trick purely in the non-gravitational description, and then ask what is the gravity dual of this calculation.
In particular, in the third-quantized language of \cite{mm}, we would be computing expectation values of the Renyi-entropy ``operator", i.e. quantities like $\langle \text{HH} \vert \, \widehat{\text{Tr}(\rho_\text{CFT}^n)} \,\vert \text{HH} \rangle$.
The Renyi entropies of boundary density matrices, or individual matrix elements of $\rho_{\text{CFT}}$, become third-quantized operators acting on $\mathcal{H}_{\text{BU}}$.
This is exactly analogous to the operator on the left hand side of equation (3.42) in \cite{mm}.
By definition of $\ket{\text{HH}}$, there are wormholes connecting all the boundaries in the computation of $\langle \text{HH} \vert \, \widehat{\text{Tr}(\rho_\text{CFT}^n)} \,\vert \text{HH} \rangle$.

In the context of this paper or section 6 of \cite{pssy}, the quantities under consideration were the entropies of states in $\mathcal{H}_\text{BU}$, i.e. quantities of the form $\text{Tr}(\rho_\text{HH}^n)$ or $\text{Tr}(\rho_\text{Page}^n)$.
In AdS, the quantities analogous to this would be
\begin{align}
\sum_{\{\beta_1\ldots \beta_n\}} \big\langle Z(\beta_1) Z(\beta_2) \big\rangle \, \big\langle Z(\beta_2) Z(\beta_3) \big\rangle \ldots \big\langle Z(\beta_{n}) Z(\beta_1) \big\rangle \, .
\end{align}
In this quantity there are no wormholes connecting all $2n$ of these insertions, but only wormholes connecting the two $Z$'s within a single $\langle \cdots \rangle$.

\subsection{Comments on single-universe observables}
\label{sec-oneuniv}
In inflationary physics, the two-point function of perturbative fields in a single connected universe plays a central role \cite{Maldacena:2002vr}.
There is a regime in which such observables should be well-defined: a large classical universe with highly suppressed topology fluctuations, in which we can make sense of inflationary correlators, as well as the density matrix discussed in \cite{Hawking:1986vj, pssy}.
In the worldline gravity example considered in section \ref{sec:worldline}, and allowing worldlines allowed to split, this approximation is valid when the particles are very heavy and particle production is suppressed.
In this regime, the position and momentum operators of a single particle become well-defined.

A single connected (late-time) universe is the scenario considered in section 6 of \cite{pssy} and in \cite{cgmupcoming}, so let us see what our observations imply about this setting.
The idea is that we want to define a density matrix for a single universe, for instance via
\begin{align}
    \rho_{\text{1-univ}} (w, w') := \sum_{Y} \rho(w \cup Y, w' \cup Y)\, ,
    \label{rholate}
\end{align}
where $w$ and $w'$ label a complete set of configurations of single-universe states, and $Y$ denotes the configurations of the ``other" universes.\footnote{The equation (\ref{rholate}) is correct even though the $Y$'s do not form an orthonormal basis. This is related to the fact, nicely explained in \cite{mm}, that the path integral computes inner products, and sidesteps the complications of specifying an orthonormal basis for Hilbert space. In other words, cutting the gravitational path integral still provides us with a resolution of the identity, albeit in a non-orthonormal basis.}
Note that this split between our universe and other universes becomes arbitrarily good in an appropriate regime, such as late times in de Sitter.
Note that there is \emph{still} some choice of $\rho$ involved on the right hand side of (\ref{rholate}), which could be
$\rho_\text{HH}$, $\rho_\text{Page}$, etc.

\begin{figure}
    \centering
    \includegraphics[width=\textwidth]{EffectiveWormholev2.pdf}
    \caption{Representation of $\rho_{\text{1-univ}}(w,w')$ in (\ref{rholate}) with $\rho = \rho_{\text{HH}}$.
    Recall that $Y$ is not necessarily connected.
    For an appropriate choice of state and model, the sum over $Y$ can give rise to an approximate ``effective" wormhole between $w$ and $w'$ \cite{diagcyl, Blommaert:2019wfy}.}
    \label{fig:effectiveWormhole}
\end{figure}

We can now ask the question whether the sum over $Y$ in (\ref{rholate}) leads to an effective wormhole between $w$ and $w'$, even for states like $\rho_\text{HH}$ as in (\ref{proposalrho}) which do not have an explicit wormhole between $w$ and $w'$ in their fundamental definition.
As pointed out in \cite{diagcyl}, having effective wormholes is possible, though this likely depends on the choice of the state $\rho$ and the details of the gravitational model.

The bra-ket wormhole discussed in equation (6.2) of \cite{pssy} plays an important role in avoiding a bags-of-gold type paradox in de Sitter space.
Such wormholes have also recently been shown to prevent violations of strong subadditivity of entropy \cite{cgmupcoming}.
Our view is that these wormholes, if not already present in $\rho$, must be emergent: The sum over $Y$ in the definition (\ref{rholate}) of $\rho_{\text{1-univ}} (w, w')$ should lead to approximate geometric connections between the bra $w$ and the ket $w'$, as in figure \ref{fig:effectiveWormhole}.
In principle, this could happen even for states such as $\rho_\text{HH}$ that do not have these bra-ket type wormholes in their definition.
Note that this approximate geometric connection will  generically not be equal to the original cylindrical geometry between $w$ and $w'$, if the latter exists in the definition of $\rho$ (an example of such a case would be $\rho_\text{Page}$).
This is analogous to the diagonal piece in the sum over periodic orbits in the spectral form factor giving rise to a cylinder \cite{sss2, pssy}, and the ``diagonal = cylinder" identity derived in the setup of \cite{diagcyl}.
See also \cite{Blommaert:2019wfy}.

A more drastic possibility is for $\rho_{\text{HH}}$ to be non-perturbatively gauge equivalent to some state with bra-ket wormholes (which need not be $\rho_\text{Page}$).\footnote{This might seem surprising, but the gauge redundancies in gravity are strong \cite{mm, Jafferis:2017tiu} and need to be explored further.}
An extreme possibility is that $\text{dim }\mathcal{H}_\text{BU} = 1$, a condition which is equivalent to the condition that $\rho_{\text{HH}}$ and $\rho_\text{Page}$ be gauge equivalent to each other.\footnote{This is because $\rho_\text{Page} = \mathbb{1}_{\mathcal{H}_\text{BU}}$ (\ref{rhopageequalid}) and $\rho_\text{HH}$ is pure. So if $\rho_\text{HH}$ is gauge equivalent to $\rho_\text{Page}$, $\ket{\text{HH}}$ is the only state in $\mathcal{H}_\text{BU}$.}

In order to compute the Renyi entropies of $\rho_\text{1-univ}$, one would follow the idea described in section \ref{sec:renyi}.
One would first compute the matrix elements $\rho_\text{1-univ}(w,w')$ using (\ref{rholate}), and then explicitly compute the sums in the index contractions in $\text{Tr}(\rho_\text{1-univ}^n)$.

The recent paper by Giddings and Turiaci \cite{Giddings:2020yes} also contained some expressions similar to ours.
Their equation (3.5) is similar to our (\ref{rholate}), and their equation (3.8) is arguing for computing the Renyi entropies of $\rho_{\text{1-univ}}$ just like we have described.
However, we believe that the LHS of their equation (3.10) should be replaced by $\langle \text{HH} \vert \, \widehat{\text{Tr}(\rho_\text{CFT}^n)} \,\vert \text{HH} \rangle$, like we discussed in section \ref{sec:adsaitorjuan}.
In particular, we are in complete agreement with \cite{pssy, Almheiri:2019qdq} for computing Renyi entropies of $\rho_\text{CFT}$ (states of the boundary system, possibly coupled to a bath).

A brief comment about entanglement entropy in the worldvolume theory.
Usually, one computes the entanglement properties of a QFT by considering a complete set of states on a Cauchy slice in spacetime.
But one could imagine special states in which the entanglement could be computed by considering worldlines of heavy particles.
For instance, the particles could have two-internal states, and we might consider an EPR state of two such heavy particles.
See \cite{Mazenc:2019ety} for some work in this direction.
The same comments should apply to the universe field theory; there should be a limit in which the entropies of subregions on the worldvolume become well-defined.

\paragraph{Acknowledgments.}
We thank Dionysios Anninos, Austin Joyce, Adam Levine, Juan Maldacena, Don Marolf, Henry Maxfield, Edgar Shaghoulian, Steve Shenker, Douglas Stanford, John Stout, Zhenbin Yang and Ying Zhao for insightful discussions, and Edgar Shaghoulian for comments on the draft.
TA is supported by the Delta ITP consortium, a program of the Netherlands Organisation for Scientific Research (NWO) that is funded by the Dutch Ministry of Education, Culture and Science (OCW).
JK is supported by the Simons Foundation.
This research was supported in part by the National Science Foundation under Grant No. NSF PHY-1748958.

\small
\bibliographystyle{apsrev4-1long}


\section{Introduction}

The increase in speed and intensity of movement of trains on the tracks, caused an increase in quality control requirements. At the same time, the time of the control, data processing, analysis and decision-making on the admission of the railway is reduced. Integrity monitoring includes the detection of any internal defects: cracks, voids, delamination, loss of integrity of connections, etc. It is crucial to prevent disasters and encure the stability of rail transport.

In this regard, the development of automation systems, new models and methods for finding defects in real-time mode is relevant. One of the classic means of scanning railway rails is the use of ultrasound. Various methods are used to decipher ultrasonic defectograms of the rails. Starting from manual, methods based on the analysis of physical principles and ending with tools for analyzing various types of graphical presentation. This article discusses a method for analyzing and identifying defects using machine learning tools. A graphical representation of ultrasonic defectograms is considered as data for analysis.

\section{Subject matter and system requirements}

During the last 5 years, ultrasonic devices have appeared on the market that allow for high-speed testing of railway rails. Controls systems include the detection and registration of defects in real time, as well as the complete recording of scanned data. These data can be used for periodic monitoring of the state of the railway, by identifying defects in the controlled  object with the necessary accuracy and reliability.

With the manual method of decoding the visual appearance of defectograms obtained during ultrasound testing, experts are involved. In this case, the main disadvantages are the presence of factors that influence the results obtained. These factors can be: qualification, affentiveness, physical and mental state of a person, etc. Given the large volume and complexity of the visual presentation of data, manual processing performance is very low.

Moreover, in recent years, to facilitate the work of specialists, tools have been developed to facilitate the proccessing of large amounts of data \cite{Armbruster}, such as:

- data output in a convenient view;

- filtering noise signals, for a clearer visualization of areas that may contain defects;

- means of classification based on harsh conditions.

All these tools accelerate data processing, but in modern conditions do not meet the requirements:

- by definition time;

- by the percentage of defects detected;

- at the time of the decision;

- in automated systems, the presence of stringent conditions does not allow to determine all types of defects in the presence of various characteristics of detects;

- there is no possibility to conduct an analysis in the mode / speed of receipt of data from the flaw detector sensors.

These funds also do not allow for the full and for all identified and possible cases of comparative and periodic monitoring.

The level of development of machine learning systems, in particular, neural network algorithms and hardware, make it possible to organize their use for solving the above problem. Development of an automated identification systems (AIS) based on a neural network, which will allow to solve the problem of identifying and classifying defects without imposing restrictions on the input data \cite{Bettayeb2008}. Such a system allows to increase the effeciency of rail monitoring, to organize control in the mode of data entry into the systems, as well as to increase the reliability and accuracy of the results obtained by minimizing the influence of subjective factors.

To achieve its goals, AIS must meet the following requirements:

- work with single-channel and multichannel ultrasound control systems;

- the ability to identify and classify all types of defects in the subject area;

- the computational complexity of the algorithms used should ensure that results are obtained in real time when implemented on modern hardware platforms (including parallel ones) with the speed of movement of scanning platforms up to 110 km/h.

\section{System description}

Scanning probes are located on a special mechanical skid on the front wheel pair (Fig.1)

\begin{figure}[h]
	\includegraphics[width=\linewidth]{fig1}
	\caption{Ultrasound diagnosis system}
\end{figure}

When determining the location of the defect in the calculations, the position of each probe relative to the zero position of the system is taken. In this case, the angle of inclination of the sensor is not taken into account, therefore the indication of the depth of the defect and the real position along the scanning axes do not correspond to its actual location in the rail being diagnosed. This is done to simplify the identification of defects, as show in Fig.2.

\begin{figure}[h!]
	\includegraphics[width=\textwidth]{fig2}
	\caption{Identification of defects}
\end{figure}

The indications exicting in the railway can be divided into two large classes: technological and defects. To technological include: bolted joints, joints and welds. The defects are: horizontal crack of the rail head, delamination of the rail head, detachment of the rail bottom, crack in the neck of the rail, emptiness in the weld, vertical crack of the rails, cracks in bolted joints (star  cracks). Also, defects can be displaced not only in a vertical plane, but also have a horizontal displacement relative to the central axis in the rail head.

Each type of defect gives an indication not on all channels of the probes, but only at certain angles (Table 1). Using this feature allows you to combine information on the measuring channel in accordance with the type of defect, this can significantly reduce the amount of information supplied to the appropriate classifier and thereby significantly increase the overall speed of the system.

\begin{table}[h]
	\caption{Combining sensor data}
	\begin{tabular}{| c | c | c |}
		\hline
		N & Sensor combination & Detectable defect types \\
		\hline
		1 & $0^o$ & Horizontal cracks in the head, neck and foot rail \\
		\hline
		2 & $\pm70^o$ & Transverse cracks in the head, neck and foot rail \\
		\hline
		3 & $0^o, \pm35^o, \pm70^o$ & Bolt holes \\
		\hline
		4 & $0^o, \pm35^o$ & Inclined cracks \\
		\hline
		5 & $\pm55^o$ & Cracks in the head, neck and foot rail \\
		\hline
	\end{tabular}
\end{table}

The proposed general scheme of the process of decoding a defectogram is shown in Fig.3. Its main stages are the stage of preliminary processing of ultrasound data, including sampling data from the sensors of the ultrasound system, bringing the amplitude values into a range and combining the data, as well as the stage of searching for defects and making a decision.

\begin{figure}[h!]
	\includegraphics[width=\textwidth]{fig3}
	\caption{Architecture of the automatic recognition system of railway bed defects}
\end{figure}

The stack of measurement information is used to select the source data. The data of each channel are recorded sequentially in the tensors of the same size.

In the next step, the data of individual channels that are included in the sample are combined into a single structure in accordance with Table 1, which can be used to search for signs of defects. Defects are searched for in parallel by specialized classifiers.

Decisions of specialized classifiers are transmitted to the input of the decisionmaking module, which assesses the probability of correctness of decision making by the composition of classifiers \cite{Yaman2008}, and in case of low level of confidence intervals, delegates this decision to an expert. The solutions specified by the expert are further used for the further training of neural networks of the classifier, thereby gradually improving the quality of the entire system.

To solve the problem associated with the detection and classification of defects as an object of technical diagnostics, convolutional neural networks (CNN) were used, which allowed:

1. Effectively parallelize computational processes, which made it possible to organize the work of the system in real time.

2. Implement a mechanism for further training classification.

3. To ensure high computational performance of the neural network due to the use of a much smaller number of parameters compared to other neural network architectures.

4. To provide resistance to turns and shifts of recognizable frames.

\section{Conclusion}

The development of systems that provide decoding of ultrasonic defectograms of railway rails in automatic mode at high scanning speeds is a difficult task. At the same time, the models used to solve this problem at present have a number of limitations that do not allow solving it completely.

The application of the proposed system of models in the development of an automated system for decoding ultrasonic defectograms will improve the efficiency of the rail monitoring process, the reliability of the results obtained and the safety of rail transport.