text:
\section{Introduction}
\setcounter{equation}{0}

Gravitational theories exhibit fascinating ``hidden symmetries" upon dimensional reduction \cite{Ehlers,Cremmer:1979up}.  These hidden symmetries involve duality in an essential way. For instance, in the case of $11$-dimensional supergravity reduced to four dimensions, the hidden $E_7$ symmetry includes $SO(2)$ electric-magnetic duality invariance acting on the 28 abelian gauge fields present in the theory  \cite{Cremmer:1979up}.

It has been conjectured that these hidden symmetries might actually already be present prior to dimensional reduction, although not manifestly so, and recent analysis in the light cone formalism supports this conjecture \cite{Ananth:2016abv}.  It has also been speculated that the finite-dimensional symmetries uncovered by dimensional reduction to $D \geq 3$ dimensions are actually a subset of a much larger, infinite-dimensional Kac-Moody algebra, which could be $E_{10} $  or $E_{11}$ \cite{Julia:1980gr,Julia1,Julia:1982gx,Nicolai:1991kx,Julia:1997cy,West:2001as,Damour:2002cu} for (an appropriate extension of) maximal supergravity.

A characteristic feature of the nonlinear realizations of the conjectured hidden symmetry algebras is that they treat the $p$-forms and their duals democratically: for each $p$-form appearing in the spectrum, the dual $D-p-2$ form also appears.  In order to exhibit the hidden symmetries of gravitational theories, it appears therefore necessary to reformulate the equations of motion for the $p$-forms present in the model in a manner that involves both the $p$-forms and their duals on an equal footing, but without doubling the number of degrees of freedom.  This is achieved
by rewriting the equations of motion as ``twisted self-duality conditions" \cite{Cremmer:1979up,Cremmer:1997ct,Cremmer:1998px}.  These conditions are first-order with respect to time (and space) and equate the electric field (respectively the magnetic field) of the $p$-form  to the magnetic field (respectively, $\pm$ the electric field) of its dual. It is easily verified that these conditions are equivalent to the Maxwell equations.  Furthermore, they can readily accomodate Chern-Simons couplings.  This form of the equations of motion for the $3$- and $7$-forms of 11-dimensional supergravity is the starting point of the authors of \cite{Tumanov:2015yjd} in their recent construction of $E_{11}$-invariant equations of motion.

The twisted self-duality conditions derive from a variational principle where both the $p$-form potential and its dual are treated as independent fields on an equal footing \cite{Bunster:2011qp}, which is however not manifestly spacetime covariant (for comments on this fact, see \cite{Bunster:2012hm}).

Now, the non-linear realizations of all the conjectured infinite-dimensional hidden symmetries of gravitational theories  involve also the dual to the graviton \cite{West:2001as,Damour:2002cu}. For that reason, similar twisted-duality reformulations of gravity are desirable.  The task of rewriting the linearized gravitational field equations as twisted self-duality conditions putting the spin-2 field and its dual  on a democratic footing, in a manner derivable from a variational principle, has been achieved in \cite{Bunster:2012km,Bunster:2013oaa}.

One of the original motivations underlying the $E_{10}$ conjecture \cite{Damour:2002cu} was its potential connection with the zero tension limit of string theory \cite{Gross:1988ue}.   This zero tension limit involves an infinite collection of massless higher spin fields. With this in mind, we continue in this paper our investigation of twisted self-duality  for higher spin gauge fields.  We consider explicitly the case of four spacetime dimensions but formulate our results in a manner applicable to higher spacetime dimensions \cite{Comment}.

We establish in this paper a number of results concerning the twisted self-duality formulation of higher spin gauge fields.
\begin{itemize}
\item We show that the equations of motion of the free bosonic higher spin fields can indeed equivalently be written as twisted self-duality conditions on the curvatures of the spin-$s$ field and its dual (Section \ref{Twisted}). The crucial property that allows this reformulation is the demonstration given in \cite{Bekaert:2003az} that the equations of motion of the higher spins are equivalent to the vanishing of the Ricci tensor. This is not obvious when $s >2$ since the equations of motion are of second order, while the curvatures contain derivatives of the higher spin gauge field up to the order $s$.
\item The twisted self-duality conditions are highly redundant. In section \ref{3+1}, we decompose the higher spin curvatures into electric and magnetic components, and point out that the subset of the twisted self-duality conditions that expresses that the electric field  (respectively the magnetic field) of the spin-$s$ field is equal to the magnetic field (respectively, minus the electric field) of its dual, completely captures the full content of the twisted self-duality conditions. [The proof of this fact is postponed to Section \ref{Hamiltonian}.] Remarkably, this subset of the twisted self-duality conditions contains only first-order time derivatives of the fields  -- even though a generic curvature component can contain up to $s$ time derivatives.
\item In their ``electric-magnetic" form, the twisted self-duality conditions involve the spatial components of the spin $s$-field and its dual, as well as the components with one index in the time direction, i.e., equal to zero.  These components are pure gauge and can be eliminated by taking an appropriate curl.  The resulting equations are physically equivalent and shown to be derivable from a variational principle in Section \ref{VarPri}. This variational principle naturally involves prepotentials, which are introduced to take into acount the constraints on the electric and magnetic fields.  The prepotentials enjoy spin-$s$ diffeomorphism invariance and also, somewhat unexpectedly, spin-$s$ Weyl invariance.  The tools necessary to introduce the prepotentials have been developed in \cite{Henneaux:2015cda}, upon which we heavily rely.
\item  It turns out that the action principle so derived is exactly the action principle that one would obtain by starting from the Fronsdal action, going to the Hamiltonian formalism and solving the constraints through prepotentials.  This is proved in Section \ref{Hamiltonian}.  As a by-product of this result follows the completeness of the twisted self-duality conditions on the electric and magnetic fields.
\item Although the analysis is explicitly carried out in four spacetime dimensions, we expect that it should go through along parallel lines in higher dimensions where the higher spin field equations also admit a twisted self-duality reformulation.  Arguments supporting this expectation, and how the analysis would proceed, are outlined in Section \ref{Additional}.  There is, however, a feature peculiar to four dimensions (for the types of Young tableaux under consideration), namely, that the electric and magnetic fields are tensors of identical type, and the equations of motion are invariant under $SO(2)$ electric-magnetic duality rotations in the internal plane of the electric and magnetic fields.  The action expressed in terms of the prepotentials makes it explicit that this symmetry is an off-shell symmetry.  This result generalizes to higher spins the known results for spins $s=1$ \cite{Deser:1976iy}, $s=2$ \cite{Henneaux:2004jw,Julia:2005ze} and $s=3$ \cite{Henneaux:2015cda,Deser:2004xt}.  This is also discussed in Section \ref{Additional}.
\end{itemize}
We conclude in Section \ref{Conclusions} with some comments.  Two appendices provide the technical steps necessary to derive the expression of the spin-$s$ field in terms of the prepotentials.

This paper was announced in \cite{Henneaux:2015cda}, with the different title ``Emergent conformal geometry for higher
spins".

\section{Twisted Self-Duality for Higher Spin Gauge Fields}
\setcounter{equation}{0}
\label{Twisted}
\subsection{Standard form of the equations of motion}
In four dimensions, a massless field of spin (helicity) $s$ is described by a completely symmetric tensor $h_{\lambda_1 \lambda_2 \cdots \lambda_s}$ of rank $s$, subject to the gauge invariance
\be
\delta h_{\lambda_1 \lambda_2 \cdots \lambda_s} =  s \partial_{(\lambda_1} \varepsilon_{\lambda_2 \cdots \lambda_s )} \label{GaugeInv}
\ee
where the gauge parameter $\varepsilon_{\lambda_2 \cdots \lambda_s }$ is completely symmetric but otherwise arbitrary.  The gauge invariant curvatures involve $s$ derivatives of the fields and read \cite{deWit:1979pe}
\be
R_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}[h] =  2^s \partial_{[\mu_1\vert} \partial_{ [ \mu_2\vert} \cdots \partial_{[\mu_s\vert } h_{\lambda_1] \vert  \lambda_2] \vert  \cdots \lambda_s]}
\ee
It has Young symmetry type
$$
\overbrace{\yng(10,10)}^{\text{$s$ boxes}}.
$$
One can express it in terms of the derivative operator $d_{(s)}$ of \cite{DuboisViolette:1999rd,DuboisViolette:2001jk}, which fulfills $d_{(s)}^{s+1} = 0$ (see also  \cite{Coho,XBNB}).  One has $R = d_{(s)}^s h$ and $\delta h = d_{(s)} \varepsilon$ (suppressing indices), so that $\delta R=d_{(s)}^{s+1} \varepsilon = 0$.  The curvature tensor fulfills also the ``Bianchi identities"
\be
d_{(s)} R = 0.
\ee

In order to get gauge invariant objects that involve no more than second order derivatives, it is necessary to restrict the gauge parameter $\varepsilon_{\lambda_1 \cdots \lambda_{s-1}}$ to be traceless when $s>2$ \cite{Campoleoni:2012th}. The Fronsdal tensor \cite{Fronsdal:1978rb},
\bea
F_{\lambda_{1}\cdots\lambda_{s}}&=&\Box h_{\lambda_{1}\cdots\lambda_{s}} - s\partial_{(\lambda_{1}\vert}\partial^{\mu}h_{\mu\vert\lambda_{2}\cdots\lambda_{s})}\nonumber\\
&& + \frac{s(s-1)}{2}\partial_{(\lambda_{1}}\partial_{\lambda_{2}}h_{\lambda_{3}\cdots\lambda_{s})}
\eea
which involves only second order derivatives of the gauge field, is easily seen to be invariant when $\varepsilon_{\lambda_1 \cdots \lambda_{s-1}}$ is traceless.  In that approach where the gauge parameter is restricted by trace conditions, the equations of motion are actually
\be
F_{\lambda_{1}\cdots\lambda_{s}} =0 \label{FronsdalForm}
\ee
and are derived from the Fronsdal action \cite{Fronsdal:1978rb}
\bea
&&S[h_{\mu_1 \mu_2 \cdots \mu_s}] = \int d^{4}x[-\frac{1}{2}(\partial_{\rho}h_{\mu_{1}\cdots\mu_{s}})^{2}\nonumber\\
&&+\frac{s}{2}(\partial^{\rho}h_{\rho\mu_{1}\cdots\mu_{s-1}})^{2}-\binom{s}{2}\partial^{\rho}h_{\rho\sigma\mu_{1}\cdots\mu_{s-2}}\partial^{\sigma}\bar{h}^{\mu_{1}\cdots\mu_{s-2}}\nonumber\\
&&+\frac{1}{2}\binom{s}{2}(\partial_{\rho}\bar{h}_{\mu_{1}\cdots\mu_{s-2}})^{2}
+\frac{3}{4}\binom{s}{3}(\partial^{\rho}\bar{h}_{\rho\mu_{1}\cdots\mu_{s-3}})^2]\nonumber\\
\eea
(where $\bar{h}_{\mu_{1}\cdots\mu_{s-2}} = h^{\nu}_{\phantom{\nu}\nu\mu_{1}\cdots\mu_{s-2}}$)which is easily verified to be gauge invariant up to a total derivative (with traceless gauge parameter).

\subsection{Equations in terms of the curvature}
In a very beautiful piece of work \cite{Bekaert:2003az}, it has been shown that the tracelessness condition on the gauge parameter is not necessary and can be viewed as a partial gauge condition.  Equivalent ideas were formulated in \cite{Francia:2002aa}, but their realization involves non-local terms, and for that reason we shall follow here \cite{Bekaert:2003az}.

The equations of motion for a spin $s$ gauge field can be taken to be
\be
\bar{R}_{\lambda_1 \lambda_2 \lambda_3 \mu_3  \cdots \lambda_{s} \mu_{s}} = 0 \label{RicciForm}
\ee
where $\bar{R}$ is the ``Ricci" tensor obtained by taking one trace on the Riemann tensor,
\bea
\bar{R}_{\lambda_1 \lambda_2 \lambda_3 \mu_3  \cdots \lambda_{s} \mu_{s}}&=&2^{s-2}\{\Box\partial_{[\mu_{3}\vert}\cdots\partial_{[\mu_{s}\vert}h_{\lambda_{1}\lambda_{2}\vert\lambda_{3}]\cdots\lambda_{s}]}\nonumber\\
&& - \partial_{\lambda_{1}}\partial^{\mu}\partial_{[\mu_{3}\vert}\cdots\partial_{[\mu_{s}\vert}h_{\mu\lambda_{2}\vert \lambda_{3}]\vert\cdots\lambda_{s}]}\nonumber\\
&&- \partial_{\lambda_{2}}\partial^{\mu}\partial_{[\mu_{3}\vert}\cdots\partial_{[\mu_{s}\vert}h_{\mu\lambda_{1}\vert \lambda_{3}]\vert\cdots\lambda_{s}]}\nonumber\\
&& + \partial_{\lambda_{1}}\partial_{\lambda_{2}}\partial_{[\mu_{3}\vert}\cdots\partial_{[\mu_{s}\vert}\bar{h}_{\lambda_{3}]\vert\cdots\lambda_{s}]}\}\nonumber\\
\eea
The equations (\ref{RicciForm}) are differential equations of order $s$, but contrary to (\ref{FronsdalForm}), they are invariant under the full gauge symmetry (\ref{GaugeInv}) without restriction on the trace of the gauge parameter. It was shown in \cite{Bekaert:2003az} that they imply, with an appropriate choice of the trace of $\varepsilon_{\lambda_1 \cdots \lambda_{s-1}}$, the Fronsdal equations (\ref{FronsdalForm}) -- which, conversely, are easily verified to imply (\ref{RicciForm}).

As also pointed out in \cite{Bekaert:2003az}, the equations (\ref{RicciForm}) are very convenient for discussing duality along the lines of \cite{Hull:2001iu}.  Let $S_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}$ be the tensor dual to $R_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}$ on the first two indices (say),
\bea S_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s} &=& \; \!^*R_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s} \nonumber \\
&= &\frac12 \epsilon_{\lambda_1  \mu_1}^{\; \; \; \; \; \; \rho_1 \sigma_1} R_{\rho_1 \sigma_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}
\eea
The equations of motion (\ref{RicciForm}) imply that $S_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}$ fulfills the cyclic identity, i.e., is  a tensor of same Young type as $R_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}$.   Furthermore, the cyclic identity for $R_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}$ implies that $S_{\lambda_1 \mu_1 \lambda_2 \mu_2 \cdots \lambda_s \mu_s}$ is traceless, $\bar{S}_{\lambda_1 \lambda_2 \lambda_3 \mu_3 \cdots \lambda_s \mu_s} = 0$.  There is thus complete symmetry between the equations fulfilled by $R$ and its dual $S$.

\subsection{Twisted Self-Duality}
It is this symmetry which is embodied in the twisted self-duality formulation.  When the equations of motion for the spin-$s$ field are fulfilled,  the tensor $S$ dual to the curvature not only is of same Young symmetry type
$$
\overbrace{\yng(10,10)}^{\text{$s$ boxes}}.
$$
as $R$, but it fulfills also the Bianchi identities $d_{(s)} S=0$.  This implies the existence of a ``dual" spin-$s$ field $f_{\lambda_1 \lambda_2 \cdots \lambda_s}$ of which $S$ is the curvature \cite{DuboisViolette:1999rd,DuboisViolette:2001jk}, $$S = d_{(s)}^s f.$$  This second spin-$s$ field has its own gauge invariance since it is determined up to the $d_{(s)}$ of some $\eta_{\lambda_1 \cdots \lambda_{s-1}}$,
\be
\delta f_{\lambda_1 \lambda_2 \cdots \lambda_s} = s \partial_{(\lambda_1} \eta_{\lambda_2 \cdots \lambda_s)}
\ee

We can thus rewrite the equations of motion for the spin-$s$ theory in a duality-symmetric way where both the spin-$s$ field and its dual appear on an equal footing as follows,
\begin{equation}
{\mathcal F} = {\mathcal S}  \, ^*\hspace{-.05cm}{\mathcal F}, \label{key1}
\end{equation}
where,
\vspace{.5cm}
\begin{equation}
{\mathcal F} =
 \begin{pmatrix} R[h] \\ S[f] \\ \end{pmatrix}, \; \; \; ^*\hspace{-.05cm}{\mathcal F} =
 \begin{pmatrix} ^*\hspace{-.05cm}R[h] \\ ^*\hspace{-.05cm}S[f] \\ \end{pmatrix}, \; \; \;  {\mathcal S}  = \begin{pmatrix} 0& -1 \\ 1 & 0 \end{pmatrix}  .\label{key2}
\end{equation}
This form of the equations is completely equivalent to the original form $\bar{R}=0$, since we have seen that the equation $\bar{R}=0$ implies (\ref{key1}).  And conversely, if (\ref{key1}) holds, then both  $h$ and $f$ obey $\bar{R}[h] = 0$, $\bar{S}[f] =0$, i.e., fulfill the spin-$s$ equations of motion.  Furthermore,  the two spin-$s$ fields are not independent since $f$ is completely determined by $h$ up to a gauge transformation and therefore carries no independent physical degrees of freedom.

Following \cite{Cremmer:1998px}, one refers to (\ref{key1}) as the twisted self-dual formulation of the spin-$s$ theory.

\section{Electric and magnetic fields}
\label{3+1}
\setcounter{equation}{0}
\subsection{Definitions}
The twisted self-duality conditions in their covariant form (\ref{key1}) are highly redundant.  We shall extract from them an equivalent subset that has the interesting property of containing only first order derivatives with respect to time.

To that end, we first define the electric and magnetic components of the Weyl tensor, which coincides on-shell with the Riemann tensor.  It would seem natural to define the electric components as the components of the Weyl tensor with the maximum number of indices equal to zero (namely $s$), and the magnetic components as the components with the maximum number minus one of indices equal to zero (namely $s-1$). By the tracelessness conditions of the Weyl tensor, the electric components can be related to the components with no zeroes when $s$ is even, like for gravity, or just one zero when $s$ is odd, like for Maxwell.  It turns out to be more convenient for dynamical purposes to define the electric and magnetic components starting from the other end, i.e., in terms of components with one or no zero.  Now, it would be cumbersome in the general analysis to have a definition of the electric and magnetic components that would depend on the spin.  For that reason, we shall adopt a definition which is uniform for all spins, but which coincides with the standard conventions given above only for even spins.  It makes the Schwarzschild field ``electric", but the standard electric field of electromagnetism is viewed as ``magnetic".   Since the electric (magnetic) components of the curvature of the spin-$s$ field are the magnetic (electric) components of the curvature of the dual spin-$s$ field, this is just a matter of convention, but this convention may be confusing when confronted with the standard Maxwell terminology.

Before providing definitions, we recall that the curvature $R_{i_1 j_1\cdots i_s j_s}$ of the three-dimensional ``spin-$s$ field" $h_{i_1 \cdots i_s}$ given by the spatial components  of the spacetime spin-$s$ field $h_{\lambda_1 \cdots \lambda_s}$ is completely equivalent to its Einstein tensor defined as
\be
G^{i_1 \cdots i_s} = \frac{1}{2^s} \epsilon^{i_1 j_1 k_1} \cdots \epsilon^{i_s j_s k_s} R_{j_1 k_1\cdots j_s k_s}
\ee
This tensor is completely symmetric and identically conserved,
\be
\partial_{i_1} G^{i_1 i_2 \cdots i_s} = 0
\ee
In the sequel, when we shall refer to the Einstein tensor of the spin $s$ field, we shall usually mean this three-dimensional Einstein tensor (the four-dimensional Einstein tensor vanishes on-shell).

We now define precisely the electric and magnetic fields off-shell as follows:
\begin{itemize}
\item The electric field ${\mathcal E}^{i_1 \cdots i_s}$ of the spin-$s$ field $h_{\lambda_1 \cdots \lambda_s}$ is equal to the Einstein tensor $G^{i_1 \cdots i_s}$ of its spatial components $h_{i_1 \cdots i_s}$,
\be {\mathcal E}^{i_1 \cdots i_s} = G^{i_1 \cdots i_s}
\ee
By construction, the electric field fully captures the spatial curvature and involves only the spatial components of the spin-$s$ field.  It is completely symmetric and conserved,
\be
 {\mathcal E}^{i_1 \cdots i_s} =  {\mathcal E}^{(i_1 \cdots i_s)}, \; \; \; \partial_{i_1} {\mathcal E}^{i_1 i_2 \cdots i_s} = 0
\ee
\item The magnetic field ${\mathcal B}^{i_1 \cdots i_s}$ of the spin-$s$ field $h_{\lambda_1 \cdots \lambda_s}$ is equivalent to the components with one zero of the spacetime curvature tensor and is defined through
\be {\mathcal B}_{i_1 \cdots i_s} = \frac{1}{2^{s-1}} R_{0i_1}^{\; \; \; \; \;  j_2 k_2 \cdots j_s k_s} \epsilon_{i_2 j_2 k_2} \cdots \epsilon_{i_s j_s k_s}
\ee
It contains one time (and $s-1$ space) derivatives of the spatial components $h_{i_1 \cdots i_s}$, and $s$ derivatives of the mixed components $h_{0i_2 \cdots i_s}$.  The magnetic field is symmetric and transverse in its last $s-1$ indices,
\be
{\mathcal B}^{i_1 i_2 \cdots i_s} = {\mathcal B}^{i_1 (i_2 \cdots i_s)}, \; \; \; \partial_{i_2} {\mathcal B}^{i_1 i_2 \cdots i_s} =0.
\ee
It is also traceless on the first index and any other index,
\be
\delta_{i_1 i_2} {\mathcal B}^{i_1 i_2 \cdots i_s} = 0.
\ee
It is useful to make explicit the dependence of the magnetic field -- or equivalently, $R_{0i_1 j_2k_2 \cdots j_s k_s}$ -- on $h_{0i_2 \cdots i_s}$.   One finds
\be
R_{0i_1 j_2k_2 \cdots j_s k_s}  = \partial_{i_1} \left(d_{(s-1)}^{s-1} N \right)_{j_2 k_2 \cdots j_s k_s} + ``more" \label{ambiguity}
\ee
where ``$more$" involves only spatial derivatives of $\dot{h}_{i_1 \cdots i_s}$ and where $N_{i_1 \cdots i_{s-1}}$ stands for $h_{0i_1 \cdots i_{s-1}}$, i.e., $N_{i_1 \cdots i_{s-1}} \equiv h_{0i_1 \cdots i_{s-1}}$.
\end{itemize}

Similar definitions apply to the dual spin-$s$ field $f_{\lambda_1 \cdots \lambda_s}$.

The electric and magnetic fields possess additional properties on-shell.  First, the electric field is traceless as a result of the equation $\bar{R}^0_{\; \; 0 i_5 \cdots i_s} - \frac12 \delta^0_0 \bar{\bar{R}}_{i_5 \cdots i_s} = 0$,
\be
\delta_{i_1 i_2} {\mathcal E}^{i_1 i_2 \cdots i_s} = 0.
\ee
Second, the magnetic field is symmetric as a result of the equation $\bar{R}_{0i_4 i_5 \cdots i_s} =0$,
\be
 {\mathcal B}^{i_1 \cdots i_s} =  {\mathcal B}^{(i_1 \cdots i_s)} = 0.
\ee

We also note that there are no other independent components of the spacetime curvature tensor on-shell, since components with more than one zero can be expressed in terms of components with one or no zero through the equations of motion.

\subsection{Twisted self-duality in terms of electric and magnetic fields}
It is clear that the twisted self-duality conditions (\ref{key1}) with all indices being taken to be spatial read
\begin{equation}
 \begin{pmatrix} {\mathcal E}^{i_1 i_2 \cdots i_s}[h] \\ {\mathcal E}^{i_1 i_2 \cdots i_s}[f] \\ \end{pmatrix} = \begin{pmatrix} {\mathcal B}^{i_1 i_2 \cdots i_s}[f] \\ -{\mathcal B}^{i_1 i_2 \cdots i_s}[h] \\ \end{pmatrix} . \label{key3}
\end{equation}
It turns out that these equations are completely equivalent to the full set of twisted self-duality conditions.  This is not surprising since the components of the curvature tensor with two or more zeroes are not independent on-shell from the components with one or no zero.  The fact that (\ref{key3}) completely captures all the equations of motion will be an automatic consequence of our subsequent analysis and so we postpone its proof to later (Section \ref{Hamiltonian} below).

\subsection{Getting rid of the Lagrange multipliers}
While a generic component of the curvature may contain up to $s$ time derivatives, the twisted self-duality conditions (\ref{key3}) contain only the first-order time derivatives $\dot{h}_{i_1 \cdots i_s}$ and $\dot{f}_{i_1 \cdots i_s}$.   One can give the fields $h_{i_1 \cdots i_s}$ and $f_{i_1 \cdots i_s}$ as Cauchy data on the spacelike hypersurface $x^0 = 0$.  The subsequent values of these fields are determined by the twisted self-duality conditions up to gauge ambiguities.  The Cauchy data $h_{i_1 \cdots i_s}$ and $f_{i_1 \cdots i_s}$ cannot be taken arbitrarily but must be such that their respective electric fields are both traceless since this follows from ${\mathcal E} = \pm {\mathcal B}$ and the fact that the magnetic field is traceless.  The constraints are equivalent to the condition that the traces of the Einstein tensors of both $h$ and $f$ should be zero,
\be
\bar{G}^{i_1 \cdots i_{s-2}} [h] = 0, \; \; \; \; \bar{G}^{i_1 \cdots i_{s-2}} [f] = 0 \label{constraints0}
\ee

The twisted self-duality conditions involve also the mixed components $h_{0i_2 \cdots i_s}$ and $f_{0i_2 \cdots i_s}$.  These are pure gauge variables, which act as Lagrange multipliers for constraints in the Hamiltonian formalism.  It is useful for the subsequent discussion to get rid of them.  Since they occur only in the magnetic fields, and through a gradient, this can be achieved by simply taking a curl on the first index.    Explicitly, from the twisted self-duality conditions (\ref{key3}) rewritten as
\be
{\mathcal E}^{a \, i_1 \cdots i_s} = \epsilon^{a}_{\; \; b} \, {\mathcal B}^{b \, i_1 \cdots i_s} \label{key4}
\ee
(${\mathcal E}^{a \, i_1 \cdots i_s}  \equiv {\mathcal E}^{ i_1 \cdots i_s} [h^a]$, ${\mathcal B}^{a \, i_1 \cdots i_s}  \equiv {\mathcal B}^{ i_1 \cdots i_s} [h^a]$, $a=1,2$, $(h^a) = (h,f)$, $\epsilon_{ab} = - \epsilon_{ba}$, $\epsilon_{12} = 1$), follows obviously the equation
\be
\epsilon_{jki_1} \partial^{k} {\mathcal E}^{a \, i_1 \cdots i_s} = \epsilon^{a}_{\; \; b} \, \epsilon_{jki_1} \partial^{k}{\mathcal B}^{b \, i_1 \cdots i_s} \label{key5}
\ee
which does not involve the mixed components $h_{0i_2 \cdots i_s}$ or $f_{0i_2 \cdots i_s}$ any more.

The equations (\ref{key5}) are physically completely equivalent to (\ref{key4}).  Indeed, it follows from (\ref{key5}) that
\be
{\mathcal E}^{a \, i_1 \cdots i_s} = \epsilon^{a}_{\; \; b} \, \tilde{ {\mathcal B}}^{b \, i_1 \cdots i_s}
\ee
where $\tilde{ {\mathcal B}}^{b \, i_1 \cdots i_s}$ differs from the true magnetic field ${\mathcal B}^{b \, i_1 \cdots i_s}$ by an arbitrary gradient in $i_1$, or, in terms of the corresponding curvature components
\be
\tilde{R}^a_{0i_1 j_2 k_2 \cdots j_s k_s} = R^a_{0i_1 j_2 k_2 \cdots j_s k_s} + \partial_{i_1} \mu^a_{j_2 k_2 \cdots j_s k_s}
\ee
for some arbitrary $\mu^a_{j_2 k_2 \cdots j_s k_s}$ with Young symmetry type
$$
\overbrace{\yng(9,9)}^{\text{$s-1$ boxes}}.
$$
Now, the cyclic identity fulfilled by the curvature implies $\partial_{[i_1} \mu^a_{j_2 k_2] \cdots j_s k_s} = 0$, i.e., in index-free notation, $d_{(s-1)} \mu^a =0$, and this yields $\mu^a = d_{(s-1)}^{s-1} \nu^a$ for some symmetric $\nu^a_{j_2 \cdots j_s}$ \cite{DuboisViolette:1999rd,DuboisViolette:2001jk}.  Comparing with (\ref{ambiguity}), we see that this is just the ambiguity in $R^a_{0i_1 j_2 k_2 \cdots j_s k_s}$ due to the presence of $h^a_{0j_2 \cdots j_s}$.  Therefore, one can absorb $\mu^a_{j_2 k_2 \cdots j_s k_s}$ in a redefinition of the pure gauge variables $h^a_{0j_2 \cdots j_s}$ and get thereby the equations (\ref{key4}).

It is in the form (\ref{key5}) that we shall derive the twisted self-duality conditions from a variational principle.

\section{Variational principle}
\label{VarPri}
\setcounter{equation}{0}
\subsection{Prepotentials}
The searched-for variational principle involves as basic dynamical variables not the fields $h^a_{i_1 \cdots i_s}$, which are constrained, but rather ``prepotentials" that solve the constraints (\ref{constraints0}) and can be varied freely in the action.  The general solution of the constraint equation $\bar{G}^{a \, i_1 \cdots i_{s-2}} = 0$ was worked out in \cite{Henneaux:2015cda} and implies the existence of prepotentials $Z^a_{i_1 \cdots i_s}$ from which $h^a_{i_1 \cdots i_s}$ derives, such that the Einstein tensor $G^{a\,  i_1 \cdots i_s}$ of $h^a_{i_1 \cdots i_s}$ is equal to the Cotton tensor $D^{a\, i_1 \cdots i_s}$ of $Z^a_{i_1 \cdots i_s}$.

The Cotton tensor $D^{a\,  i_1 \cdots i_s}$ involves $2s-1$ derivatives of the prepotentials and possesses the property of being invariant under spin-$s$ diffeomorphisms and Weyl symmetries,
\be
\delta Z^a_{i_1 \cdots i_s} = s \partial_{(i_1} \rho^a_{i_2 \cdots i_s)} + \frac{s(s-1)}{2} \delta_{(i_1 i_2} \sigma^a_{i_3 \cdots i_s)}. \label{gaugeZ}
\ee
It is symmetric, transverse and traceless.  It was introduced for general spins in \cite{Damour:1987vm,Pope:1989vj} and \cite{Henneaux:2015cda} (where it was denoted $B$), and used extensively in three-dimensional higher spin models in \cite{Bergshoeff:2009tb,Bergshoeff:2011pm,Nilsson:2013tva,Nilsson:2015pua,Linander:2016brv,Kuzenko:2016bnv,Kuzenko:2016qdw}.

Explicitly, the Cotton tensor of $Z^a_{i_1 \cdots i_s}$ is given by
\begin{eqnarray}
D^{ai_1 i_2  \cdots i_s} [Z] &=& \varepsilon^{i_1 j_1 k_1}\varepsilon^{i_2 j_2 k_2} \cdots \varepsilon^{i_{s-1} j_{s-1} k_{s-1}} \nonumber \\
&& \hspace{.5cm} \partial_{j_1} \partial_{j_2} \cdots \partial_{j_{s-1}} S^{a\hspace{1.38cm} i_s}_{k_1 k_2 \cdots k_{s-1}} [Z] \nonumber
\end{eqnarray}
where $S^{a \, i_1 \cdots i_s}[Z] $ is the Schouten tensor of $Z^a_{i_1 \cdots i_s}$, related to the Einstein tensor of $Z^a_{i_1 \cdots i_s}$ through
\begin{eqnarray}
S^{a \, i_1 \cdots i_s}[Z] &=& G^{a \, i_1 \cdots i_s} [Z] \nonumber \\
&& + \sum_{n=1}^{[\frac{n}{2}]} c_n  \delta^{(i_1 i_2}  \cdots \delta^{i_{2n-1} i_{2n}} G_{[n]}^{a \, i_{2n+1}  \cdots i_s)} [Z] \hspace{.5cm} \nonumber
\end{eqnarray}
with
$$
c_n = \frac{(-1)^n}{4^n} \frac{s}{n!} \frac{(s-n-1)!}{(s-2n)!}, \; \; \; (n\geq 1)
$$
(see \cite{Henneaux:2015cda}).

Because of the gauge symmetries, the solution of the equation $G^{a\,  i_1 \cdots i_s}[h]= D^{a\,  i_1 \cdots i_s}[Z]$ for $h^a_{i_1 \cdots i_s}$ involves ambiguities.  To any given solution $h^a[Z]$ one can add an arbitrary variation of $h^a_{i_1 \cdots i_s}$ under spin-$s$ diffeomorphisms.   Furthermore $Z^a_{i_1 \cdots i_s}$ and $Z^a_{i_1 \cdots i_s} + \delta Z^a_{i_1 \cdots i_s}$ (with $\delta Z^a_{i_1 \cdots i_s}$ given by (\ref{gaugeZ})) yield $h^a[Z]$'s that differ by a spin-$s$ diffeomorphism.

The expression for the spin-$s$ field $h_{i_1 \cdots i_s}$ in terms of the prepotential $Z_{i_1 \cdots i_s}$ contains $s-1$ derivatives in order to match the number of derivatives ($s$) of the Einstein tensor $G[h]$  with the number of derivatives ($2s-1$) of the Cotton tensor $D[Z]$. This number is odd (even) when $s$ is even (odd) and therefore, in order to match the indices of $h_{i_1 \cdots i_s}$ with those of $\partial_{k_1} \cdots \partial_{k_{s-1}} Z_{j_1 \cdots j_s}$, one needs one $\epsilon^{ijk}$ when $s$ is even and  no $\epsilon^{ijk}$ when it is odd, together with products of $\delta_{ij}$'s.

\subsubsection{Even Spins}

We first turn to the even $s$ case.  We recall that in the spin-$2$ case, a particular solution is given by \cite{Henneaux:2004jw}
\begin{eqnarray}
h_{ij} &=& \epsilon_{(i\vert kl} \partial^k Z^l_{\ \vert j)} .
\end{eqnarray}
where the indices between the symbol $\vert \; \; \vert$ are omitted in the symmetrization -- which is as usual carried with weight one such that it is a projector.  The gauge freedom of the prepotential is given by
\begin{eqnarray}
\delta Z_{ij} &=&
\delta_{ij} \sigma
\ + \ 2 \ \partial_{(i} \rho_{j)} ,
\end{eqnarray}
\noindent which generates the particular diffeomorphism $\delta h_{ij} = \partial_{(i} \theta_{j)}$ of the field, where $\theta_i = \epsilon_{ikl} \partial^k \rho^l$ (it is a diffeomorphism whose parameter is divergenceless).  The generalization of this formula to general even spin $s=2n$ is given in Appendix \ref{EvenSpin}.

We give here for definiteness the expression of the spin $4$ field $h_{ijkl}$ in terms of its prepotential $\phi_{ijkl}$.  One has
\begin{eqnarray}
h_{ijkl} &=&
\epsilon_{(i\vert mn} \partial^m \left[
- \ \Delta Z^n_{\phantom{n} \vert jkl)}
\ + \  \frac{1}{2} \ \delta_{\vert jk} \Delta \bar{Z}^n_{\phantom{n}l)}
\right. \nonumber \\
&& \left. - \ \frac{1}{2} \ \delta_{\vert jk} \partial^p \partial^q Z^n_{\phantom{n} l)pq}
\right] . \label{hZ4}
\end{eqnarray}
The gauge freedom of the prepotential is given by :
\begin{eqnarray}
\delta Z_{ijkl} &=&
4 \ \partial_{(i} \rho_{jkl)}
\ + \ 6 \ \delta_{(ij} \sigma_{kl)} ,
\end{eqnarray}
which implies :
\be
\delta h_{ijkl} =
\partial_{(i} \theta_{jkl)} ,
\ee
where
\begin{eqnarray}
\theta_{ijk} &=&
\epsilon_{(i\vert mn} \partial^m \mu^n_{\phantom{n} \vert jk)} ,
\\
\mu_{ijk} &=&
- \ 3 \  \Delta \rho_{ijk}
\   + \ \frac{1}{2}\delta_{(ij} \left[
\Delta \bar{\rho}_{k)}
\ - \ \partial^p \partial^q \rho_{k)pq}
\ \right. \nonumber \\
&& \left. \hspace{2cm} - \ 4 \  \partial^p  \sigma_{k) p} \right] .
\end{eqnarray}
In fact, as discussed in Appendix \ref{EvenSpin}, the expression (\ref{hZ4}) is, up to a multiplicative factor,  the only one (with the requested number of derivatives) that implies that a gauge variation of $Z$ gives a gauge variation of $h$.

\subsubsection{Odd Spins}
In the odd spin case, the number of derivatives on the prepotential is even, so that the expression relating $h$ to $Z$ does not involve the Levi-Civita tensor.  The expression for the spin-$3$ field in terms of its prepotential is explicitly given in \cite{Henneaux:2015cda}
\begin{eqnarray}
h_{ijk} &=& - \Delta Z_{ijk} + \frac34 \delta_{(ij} \Delta \bar{Z}_{k)} \nonumber \\
&& - \frac34 \delta_{(ij} \partial^r \partial^s Z_{k)rs} + \frac{3}{10} \delta_{(ij} \partial_{k)} \partial^r \bar{Z}_r . \label{SolG=B}
\end{eqnarray}
The last term in (\ref{SolG=B}) is actually not necessary but included so that $\delta h_{ijk} = 0$ under Weyl transformations of $Z$.   One easily verifies that a gauge transformation of the prepotential induces a gauge transformation of the spin-$3$ field.

The expression of $h_{i_1 \cdots i_s}$ in terms of $Z_{i_1 \cdots i_s}$ is given in  Appendix \ref{OddSpin} for general odd spin.

\subsection{Twisted self-duality and prepotentials}
In terms of the prepotentials, the electric fields are given by
\be
{\mathcal E}^{a \, i_1 \cdots i_s} = D^{a i_1 \cdots i_s}[Z]
\ee
while the magnetic fields have the property
\be
\epsilon_j^{\; \;  i_1k} \partial_{k}{\mathcal B}^{a \, ji_2 \cdots i_s} = \dot{D}^{a i_1 \cdots i_s}[Z]
\ee
It follows that the twisted self-duality conditions take the form
\be
\epsilon^{i_1}_{\; \; jk} \partial^{j} D^{a \, k i_2 \cdots i_s}[Z] = \epsilon^{a}_{\; \; b} \dot{D}^{b i_1 \cdots i_s}[Z]  \label{key6}
\ee in terms of the prepotentials: the curl of the Cotton tensor of one prepotential is equal to ($\pm$) the time derivative of the other.

\subsection{Action}
In their form (\ref{key6}), the twisted self-duality conditions are easily checked to derive from the following variational principle,
\be
S[Z] = \int dx^0 \left[ \int d^3x \ \frac{1}{2}\varepsilon_{ab} D^{a\, i_1 \cdots i_s} \dot{Z}^b_{i_1 \cdots i_s} - H \right] \label{ActionPrepot00}
\ee
where the Hamitonian $H$ reads
\be
H = \int d^3x \delta_{ab} \left(\sum_{k=0}^{[\frac{s}{2}]} a_k  G^{[k] a \, i_1 \cdots i_{s-2k}}G^{[k] b}_{\; \; \; \; \; \; \; i_1 \cdots i_{s-2k}}  \right) \label{HAM11}
\ee
where $G^{[k] a \, i_1 \cdots i_{s-2n}}$ stands for the $k$-th trace of the Einstein tensor  $G^{a \, i_1 \cdots i_s}[Z]$ of the prepotential $Z^a_{i_1 \cdots i_s}$. A lengthy but conceptually direct computation shows that the coefficients  $a_k$ are explicitly given by
$$
 a_k =  \left( - \right)^k \frac{n!}{\left(n-k\right)!k!}
\frac{\left(2n-k-1\right)! \left(2n-1\right)!! }{2^k \left(2n-1\right)!\left(2n-2k-1\right)!!} \frac{1}{2}
$$
for even spin $s=2n$, and
$$
a_k =
\left( - \right)^k \frac{n!}{\left(n-k\right)!k!}
\frac{\left(2n-k\right)! \left(2n+1\right)!! }{2^k \left(2n\right)!\left(2n-2k+1\right)!!} \frac{1}{2}
$$ for odd spin $s = 2n +1$, where the definition of the double factorial is recalled in the appendix.
These coefficients are in fact uniquely determined up to an overall factor by the property that the action is invariant, up to a surface term, under the gauge symmetries (\ref{gaugeZ}) of the prepotentials.  Invariance under spin-$s$ diffeomorphisms is manifest, while invariance under spin-$s$ Weyl symmetry forces $a_k$ to be given by the above expression (up to an overall factor).

We close this section by observing that the Hamiltonian (\ref{HAM11}) can be rewritten more simply as:
\be
H =  \frac{1}{2} \int d^3x \, \delta_{ab} D^{a\, i_1 \cdots i_s} \, {\epsilon^{mn}}_{i_1}\, \partial_m{Z}^b_{n i_2 \cdots i_s},
\ee
an expression that more clearly exhibits its gauge invariance\footnote{ We are grateful to Victor Lekeu for pointing this out to us.}.

\section{Hamiltonian formalism}
\label{Hamiltonian}
\setcounter{equation}{0}

\subsection{Constraints and Hamiltonian}
It turns out that the action (\ref{ActionPrepot00}) is exactly the action that one obtains by rewriting the Fronsdal action action in Hamiltonian form and solving the constraints.

The procedure to establish this fact proceeds as follows.
\begin{enumerate}
\item First one writes the Fronsdal action in Hamiltonian form \cite{Metsaev:2011iz,Campoleoni:2016uwr}.  The Hamiltonian canonical variables are the spatial components $h_{i_1 \cdots i_s}$ of the spin-$s$ field, their conjugate momenta $\pi^{i_1 \cdots i_s}$, the variables $\alpha_{i_1 \cdots i_{s-3}}$ equal to $h_{000 i_1 \cdots i_{s-3}} - 3 \delta^{kl} h_{0 i_1 \cdots i_{s-3} kl}$ and their conjugate momenta $\tilde{\Pi}^{i_1 \cdots i_{s-3}}$.  The canonical action takes the form
\begin{eqnarray}
&& S[h_{i_1 \cdots i_s}, \pi^{i_1 \cdots i_s}, \alpha_{i_1 \cdots i_{s-3}}, \tilde{\Pi}^{i_1 \cdots i_{s-3}}, {\mathcal N}^{i_1 \cdots i_{s-2} } , N^{i_1 \cdots i_{s-1} }] \nonumber \\
&& = \int dx^0\left[ \int d^3x (\pi^{i_1 \cdots i_s} \dot{h}_{i_1 \cdots i_s} + \tilde{\Pi}^{i_1 \cdots i_{s-3}} \dot{\alpha}_{i_1 \cdots i_{s-3}})  \right. \nonumber \\
&& \left. - H
  - \int d^3 x ({\mathcal N}^{i_1 \cdots i_{s-2} } {\mathcal C}_{i_1 \cdots i_{s-2}}  \right. \nonumber \\
  && \left. \hspace{3cm} +N^{i_1 \cdots i_{s-1} } {\mathcal C}_{i_1 \cdots i_{s-1}}  ) \right]
\end{eqnarray}
where ${\mathcal C}_{i_1 \cdots i_{s-2}}$ and ${\mathcal C}_{i_1 \cdots i_{s-1}}$ are the constraint-generators related to temporal ($\epsilon_{0 i_1 \cdots i_{s-2}}$) and spacelike ($\epsilon_{ i_1 \cdots i_{s-1}}$) spin-$s$ diffeomorphisms, respectively, and ${\mathcal N}_{i_1 \cdots i_{s-2} } = h_{00i_1 \cdots i_{s-2}}$ and $N_{i_1 \cdots i_{s-1} } = h_{0i_1 \cdots i_{s-1}}$ are the corresponding Lagrange multipliers. The explicit form of the constraints is rather cumbersome and has been given in  \cite{Campoleoni:2016uwr}.  The function $H$ is the Hamiltonian.  It is the integral over space of a density ${\mathcal H}$ which is quadratic in the conjugate momenta and in the first spatial derivatives of $h_{i_1 \cdots i_s}, \alpha_{i_1 \cdots i_{s-3}}$, $H = \int d^3x {\mathcal H}$. We shall not need here the explicit expression of ${\mathcal H}$ in terms of $\partial_k h_{i_1 \cdots i_s}, \pi^{i_1 \cdots i_s}, \partial_k \alpha_{i_1 \cdots i_{s-3}}, \tilde{\Pi}^{i_1 \cdots i_{s-3}}$, which is also cumbersome.
By anology with the spin-$2$ case, we shall call the constraint
\be
{\mathcal C}_{i_1 \cdots i_{s-2}} = 0
\ee
the ``Hamiltonian constraint" and the constraint
\be
{\mathcal C}_{i_1 \cdots i_{s-1}} = 0
\ee
the ``momentum constraint".
\item The second step is to solve the constraints in terms of prepotentials $Z^a_{i_1 \cdots i_s}$, $s=1,2$.     One needs two prepotentials, one for solving the Hamiltonian constraint, the other one for solving the momentum constraint.  The procedure uses the conformal tools developed in \cite{Henneaux:2015cda} and follows exactly the same pattern as for spins $2$ and $3$. It is displayed in the next two sections.
\item One then inserts the expression for the canonical variables in terms of the prepotentials inside the action and obtains (\ref{ActionPrepot00})
\end{enumerate}

\subsection{Solving the momentum constraint}
We first solve the momentum constraint.  This constraint reads \cite{Campoleoni:2016uwr}
\be
{\mathcal C}^{i_1 \cdots i_{s-1}} \equiv \partial_k \pi^{ki_1 \cdots i_{s-1}} + \hbox{``more"}= 0
\ee
where ``more" stands for terms that are linear in the second order derivatives of $\alpha_{i_1 \cdots i_{s-3}}$, which one can set to zero by a suitable gauge transformation.  In the gauges where ``more" vanishes, the constraint reduces to
\be
\partial_k \pi^{ki_1 \cdots i_{s-1}} = 0,
\ee
the general solution of which is given by $\pi^{i_1 \cdots i_{s}} = G^{i_1 \cdots i_{s}}[P]$ \cite{DuboisViolette:1999rd,DuboisViolette:2001jk}.  Here $G^{i_1 \cdots i_{s}}[P]$ is the Einstein tensor of some prepotential  $P_{i_1 \cdots i_s}$ which is totally symmetric.

For fixed momentum $\pi^{i_1 \cdots i_s}$, the prepotential $P_{i_1 \cdots i_s}$ is determined up to a spin-$s$ diffeomorphism.  However, there is a residual gauge freedom in the above gauges, so that $\pi^{i_1 \cdots i_s}$ is not completely fixed.  It is straightforward but somewhat tedious to check that the residual gauge symmetry is accounted for by a spin-$s$ Weyl transformation of the prepotential $P_{i_1 \cdots i_s}$, which therefore enjoys all the gauge symmetries of a conformal spin-$s$ field.

These results extend what was  found earlier  for spins $2$ \cite{Henneaux:2004jw} and $3$ \cite{Henneaux:2015cda}.  It is instructive to exhibit explicitly the formulas in the case of spin $4$,  which illustrates all the points and still yields readable expressions.

The momentum constraint reads in this case
\begin{eqnarray}
0 &=&
4 \ \partial^n \pi_{klmn}
\ + \ 6 \ \delta_{(kl} \Delta \alpha_{m)} \nonumber \\
& - & 10 \ \delta_{(kl} \partial_{m)} \partial^n \alpha_n . \label{constr_2}
\end{eqnarray}
and the  gauge freedom is:
\begin{eqnarray}
\delta \pi_{klmn} &=&
- \ 12 \ \partial_{(k} \partial_l \Xi_{mn)} \nonumber \\
&& + \ 12 \ \delta_{(kl} \left( \Delta \Xi_{mn)}\ + \ \partial_m \partial^p \Xi_{n)p} \right)
\nonumber \\
& + & 4 \ \delta_{(kl} \delta_{mn)} \left(2 \ \Delta \bar{\Xi} \ + \ 3 \ \partial^p \partial^q \Xi_{pq} \right) ,
\\
\delta \alpha_k &=&
- \ 6 \ \partial^l \Xi_{kl}
\ - \ 2 \ \partial_k \bar{\Xi} .
\end{eqnarray}

The residual gauge transformations in the gauge $3 \ \Delta \alpha_k \ - \ 5 \ \partial_k \partial^l \alpha_l = 0$, which eliminates the $\alpha$-terms from the constraint,  must fulfill
$$
0 = - \ 18 \ \partial^l \Delta \Xi_{kl}
\ + \ 4 \ \partial_k \Delta \bar{\Xi}
\ + \ 30 \ \partial_k \partial^l \partial^m \Xi_{lm} .
$$
The divergence of this equation gives (after acting with $\Delta^{-1}$), $
3 \ \partial^k \partial^l \Xi_{kl}
\ + \ \Delta \bar{\Xi} = 0$.
Substituting this finding in the previous equation yields, after acting again with $\Delta^{-1}$,
$3 \ \partial^l \left(\Xi_{kl} \ + \ \frac{1}{3} \ \delta_{kl} \bar{\Xi}\right) = 0$.
This is the divergence of a symmetric tensor, so the solution is the double divergence of a tensor with the symmetry of the Riemann tensor :
\begin{eqnarray}
\Xi_{kl} \ + \ \frac{1}{3} \ \delta_{kl} \bar{\Xi} &=&
\partial^m \partial^n \Theta_{mknl} .
\end{eqnarray}
Therefore, one has
\begin{eqnarray}
\Xi_{kl} &=&
\partial^m \partial^n \Theta_{mknl}
\ - \ \frac{1}{6} \ \delta_{kl} \partial^m \partial_n \Theta_{mp}^{\phantom{mp}np}.
\end{eqnarray}
This class of gauge transformations can be checked  to give a zero variation not only to the contribution of $\alpha_k$ to the constraint but in fact also to $\alpha_k$ itself.

We can dualize $\Theta_{klmn} = \epsilon_{klp}\epsilon_{mnq} \theta^{pq}$, with a symmetric $\theta_{kl}$, to obtain :
\begin{eqnarray}
\Xi_{kl} &=&
\frac{5}{6} \ \delta_{kl} \left(\Delta \bar{\theta}
\ - \ \partial^m \partial^n \theta_{mn}\right) \nonumber \\
& + &\ 2 \ \partial_{(k} \partial^m \theta_{l)m}
\ - \ \partial_k \partial_l \bar{\theta}
\ - \ \Delta \theta_{kl} . \qquad
\end{eqnarray}
The gauge transformation of $\pi_{klmn}$ with this parameter is found then to be exactly the Einstein tensor of a Weyl diffeomorphism
\begin{eqnarray}
\delta \pi_{klmn} &=&
G_{klmn} \left[12 \ \delta_{(pq} \theta_{rs)}\right] .
\end{eqnarray}

Once the spin-$4$ momentum constraint has been brought in the standard form $\partial^k \pi_{klmn} = 0$ by partial gauge fixing, it can be solved by the familiar techniques recalled at the beginning of this section for general $s$.  As it is known \cite{DuboisViolette:1999rd,DuboisViolette:2001jk}, the general solution of the equation $\partial^k \pi_{klmn} = 0$ is indeed the Einstein tensor of a symmetric tensor $P_{klmn}$, which is the prepotential for the momenta:
$$\pi_{klmn} = G_{klmn} \left[ P \right].$$
Since the gauge freedom of $\pi_{klmn}$ is given by the Einstein tensor of a Weyl transformation, the gauge freedom of the prepotential $P_{klmn}$ will be given by a spin-$4$ Weyl transformation and a spin-$4$ diffeomorphism:
\begin{eqnarray}
\delta P_{klmn} &=&
4 \ \partial_{(k} \xi_{lmn)}
\ + \ 6 \ \delta_{(kl} \lambda_{mn)} ,
\end{eqnarray}
\noindent the first term corresponding to all the transformations of the prepotential leaving $\pi_{klmn}$ invariant and the second to those realizing on it a residual gauge transformation.

The solution in a general gauge will be given by these expressions to which are added general gauge transformation terms, parametrized by further prepotentials that drop from the action by gauge invariance and which are usually not considered for that reason.

\subsection{Solving the Hamiltonian constraint}
We now solve the Hamiltonian constraint.  The functions ${\mathcal C}_{i_1 \cdots i_{s-2}}$ are linear in the second order derivatives of the spin-$s$ field $h_{i_1 \cdots i_s}$ and linear in the first order derivatives of the conjugate momenta $\tilde{\Pi}^{i_1 \cdots i_{s-3}}$.   One may rewrite these constraints in the equivalent form (suppressing indices)
\be
\Psi - d_{(s-2)} \tilde{\Pi} = 0 \label{HamBis}
\ee
where $\Psi$ is the function of the second order derivatives of the spin-$s$ field with Young symmetry
$$\Psi <> \overbrace{\yng(8)}^{(s-2) \text{ boxes}},$$
introduced in \cite{Henneaux:2015cda}, such that $\! ^* \bar{G}  \equiv  \! ^*  G^{[1]}= d_{(s-2)}^{s-2} \Psi $, where $^*$ denotes here the dual on {\em all} indices.

The results of \cite{DuboisViolette:1999rd,DuboisViolette:2001jk} applied to $d_{(s-2)}$ such that $d_{(s-2)}^{s-1}=0$ imply that the equation (\ref{HamBis}) is completely equivalent to $ d_{(s-2)}^{s-2} \Psi = 0$, i.e., $G^{[1]}[h] = 0$.  As we have recalled, this equation implies in turn  the existence of a prepotential $Z$ for $h$ (continuing to omit indices) such that the Einstein tensor of $h$ is equal to the Cotton tensor of $Z$. Once $h$ is expressed in terms of $Z$, the expression $ d_{(s-2)}^{s-2} \Psi[Z]$ identically vanishes, implying according to  the generalized algebraic Poincar\'e lemma of \cite{DuboisViolette:1999rd,DuboisViolette:2001jk} that one can write $\Psi[Z] = d_{(s-2)} \tilde{\Pi}[Z]$, for some $\tilde{\Pi}[Z]$.

This completely solves the Hamiltonian constraint in terms of the prepotential $Z_{i_1 \cdots i_2}$.   By construction, this prepotential has the gauge symmetry of a conformal spin-$s$ field.

The procedure is direct for spins $1$, where there is no Hamiltonian constraint,  and $2$, where one gets directly $G^{[1]}[h] = 0$ without having to differentiate. It was detailed for spin $3$ in \cite{Henneaux:2015cda}.   It is again instructive to illustrate it explicitly for the spin $4$ field, where the formulas remain readable.

The hamiltonian constraint for the spin $4$ is :
\begin{eqnarray}
\mathcal{C}_{kl} &\equiv&
3 \ \partial_{(k} \tilde{\Pi}_{l)}
\ + \ \delta_{kl} \partial^m \tilde{\Pi}_m \nonumber \\
& - & 6 \ \left(
\Delta \bar{h}_{kl}
\ - \ \partial^m \partial^n h_{klmn}
\ + \ \partial_{(k} \partial^m \bar{h}_{l)m}
\ + \ \partial_k \partial_l \bar{\bar{h}} \right) \nonumber \\
& - & 4 \ \delta_{kl} \Delta \bar{\bar{h}}  = 0 , \qquad \label{constr_1}
\end{eqnarray}
The gauge freedom of $ h_{klmn}$ and $\tilde{\Pi}_k$  is :
\begin{eqnarray}
\delta \tilde{\Pi}_k &=&
6 \ \Delta \bar{\xi}_k \ + \ 10 \ \partial_k \partial^l \bar{\xi}_l ,
\\
\delta h_{klmn} &=&
4 \ \partial_{(k} \xi_{lmn)} .
\end{eqnarray}
One can equivalently rewrite the constraint as
\be
\mathcal{C}_{kl} \ - \ \frac{1}{6} \ \delta_{kl} \bar{\mathcal{C}} \ \equiv \ 3 \ \partial_{(k} \tilde{\Pi}_{l)} \ - \ 6 \ \Psi_{kl} = 0,
\ee
where $\bar{\mathcal{C}}$ is the trace of $\mathcal{C}_{kl}$ and
\begin{eqnarray}
\Psi_{kl} &\equiv&
\Delta \bar{h}_{kl}
\ - \ \partial^m \partial^n h_{klmn} \nonumber \\
&+ & \partial_{(k} \partial^m \bar{h}_{l)m}
\ + \ \partial_k \partial_l \bar{\bar{h}} .
\end{eqnarray}
One has
\begin{eqnarray}
\epsilon_{k mp} \epsilon_{l nq} \partial^m \partial^n \Psi^{pq} &=&
\bar{G}_{kl} \left[ h \right]. \qquad \qquad
\end{eqnarray}
where $\bar{G}_{kl}$ is the trace of the Einstein tensor $G_{klmn} \left[ h \right]$ of $h_{klmn}$. So, one gets:
\begin{eqnarray}
\bar{G}_{kl} \left[h\right] &=&
\ - \ \frac{1}{6} \ \epsilon_{k mp} \epsilon_{l nq} \partial^m \partial^n \tilde{\mathcal{C}}^{pq}  .
\end{eqnarray}
with $\tilde {\mathcal C}^{pq} \equiv \mathcal{C}^{pq} \ - \ \frac{1}{6} \ \delta^{pq} \bar{\mathcal{C}}$.

The Hamiltonian constraint implies $\bar{G}_{kl} \left[ h \right] = 0$.  Therefore, the theorem of \cite{Henneaux:2015cda} yields $G_{ijkl} \left[h\right] = B_{ijkl} \left[Z\right]$  for some prepotential $Z_{klmn}$, where $B_{ijkl}$ is the Cotton tensor.  Explicitly,
\begin{eqnarray}
h_{ijkl}\left[Z\right] &=&
\epsilon_{(i\vert mn} \partial^m \left[
- \ \Delta Z^n_{\phantom{n} \vert jkl)}
\ + \  \frac{1}{2} \ \delta_{\vert jk} \Delta \bar{Z}^n_{\phantom{n}l)} \right. \nonumber \\
 & - &\left.  \frac{1}{2} \ \delta_{\vert jk} \partial^p \partial^q Z^n_{\phantom{n} l)pq}
\right] + \ 4 \ \partial_{(i} \omega_{jkl)}, \qquad
\end{eqnarray}
where we have added a spin-$4$ diffeomorphism term parametrized by $\omega_{jkl}$.

Direct substitution gives then
\begin{eqnarray}
\Psi_{ij}  &=&
\partial_{(i\vert} \left[
3 \  \Delta \bar{\omega}_{j)}
\ + \ 5 \ \partial_{\vert j)} \partial^k \bar{\omega}_k \right. \nonumber \\
& - & \left. \frac{1}{8} \ \epsilon_{\vert j ) mn} \partial^m \left(
 \partial^k \Delta \bar{Z}^n_{\phantom{n}k}
\ + \ \partial^p \partial^q \partial^k Z^n_{\phantom{n} kpq} \right)
\right] . \qquad \qquad
\end{eqnarray}
from which one derives, using the constraint, the following expression for $\tilde{\Pi}_i$,
\begin{eqnarray}
\tilde{\Pi}_i &=&
6 \  \Delta \bar{\omega}_{i}
\ + \ 10 \ \partial_{i} \partial^k \bar{\omega}_k \nonumber \\
& - & \frac{1}{4} \ \epsilon_{i mn} \partial^m \left(
  \partial^k \Delta \bar{Z}^n_{\phantom{n}k}
\ + \ \partial^p \partial^q \partial^k Z^n_{\phantom{n} kpq} \right)
, \qquad \qquad
\end{eqnarray}
One could in fact add  a solution $\kappa_i$ of the equation $\partial_{(i} \kappa_{j)} = 0$ (Killing equation) to $\tilde{\Pi}_i $ but we do not consider this possibility here by assuming for instance appropriate boundary conditions (vanishing of all fields at infinity eliminates $\kappa_i \sim C_i + \mu_{ij} x^j$, where $C_i$ and $\mu_{ij} = - \mu_{ji}$ are constants).

\subsection{Hamiltonian Action in terms of prepotentials}

The elimination of the canonical variables in terms of the prepotentials in the action is a rather burdensome task.  However, the derivation can be considerably short-cut  by invariance arguments.

The kinetic term in the action is quadratic in the prepotentials $Z$ and $P$ and involves $2s -1$ spatial derivatives, and one time derivative.  Furthermore, it must be invariant under spin-$s$ diffeomorphisms and spin-$s$ Weyl transformations of both prepotentials.  This implies, making integrations by parts if necessary, that the kinetic term has necessarily the form of the kinetic term of the action (\ref{ActionPrepot00}) upon identification of the prepotential $Z$ with the prepotential $Z^1$ and the prepotential $P$ with the prepotential $Z^2$.

Similarly, the Hamiltonian is the integral of a quadratic expression in the prepotentials $Z$ and $P$ involving $2s$ spatial derivatives.  By spin-$s$ diffeomorphism invariance,  it can be written as the integral of a quadratic expression in their Einstein tensors and their successive traces  -- or equivalently, the Schouten tensors and their successive traces.   As we have seen, Weyl invariance fixes then the coefficients up to an overall rescaling, so that the Hamiltonian takes necessarily the form (\ref{HAM11}), but with $\delta_{ab}$ that might be replaced by a diagonal $\mu_{ab}$ with eigenvalues different from $1$.  However, given that the equations of motion following from  the action (\ref{ActionPrepot00})  are, as we have seen, consequences of the Fronsdal equations, they cannot be in contradiction with  the equations of motion following from the Hamiltonian action (equivalent to the Fronsdal equations) and this is possible only if $\mu_{ab} = \delta_{ab}$.

One thus concludes that the action (\ref{ActionPrepot00}) for twisted self-duality is indeed the Hamiltonian form of the Fronsdal action with the constraints solved for in terms of prepotentials.  This shows in particular that the electric field-magnetic field version of twisted self-duality obtained by considering only the spatial components of (\ref{key1}) form indeed a complete set, as announced  The analysis also shows that duality-conjugate and canonically conjugate are equivalent (up to field-independent factors)

\section{Additional considerations}
\setcounter{equation}{0}
\label{Additional}

\subsection{Higher dimensions and twisted self-duality}
In higher spacetime dimension $D$,  the equations of motion can also be reformulated as twisted self-duality conditions on the curvatures of the spin-$s$ field and its dual. What is new is that the dual of a spin-$s$ field is not given by a symmetric tensor, but by a tensor of mixed Young symmetry type
$$
^\text{$D-3$ boxes}  \overbrace{\left\{ \yng(10,1,1,1,1,1,1) \right.}^{\text{$s$ boxes}}.
$$
Consequently, the curvature tensor and its dual are also tensors of different types.  Nevertherless, the electric (respectively, magnetic) field of the spin-$s$ field is a spatial tensor of the same type as the magnetic (respectively, electric) field of its dual and  the twisted self-duality conditions again equate them (up to $\pm$ similarly to Eq. (\ref{key3})).
The electric and magnetic fields are subject to tracelessness constraints that can be solved in terms of appropriate prepotentials, which are the variables for the variational principle from which the twisted self-duality conditions derive.  Again, this variational principle is equivalent to the Hamiltonian variational principle.

We have not worked out the specific derivation for all spins in higher dimensions $D$, but the  results of \cite{Bunster:2013oaa} for the spin-$2$ case, together with our above analysis, make us confident that this derivation indeed goes through as described here.

\subsection{Manifest $SO(2)$ electric-magnetic duality invariance in $D=4$}
In $D=4$ spacetime dimensions, the spin-$s$ field and its dual are tensors of the same type, as we have seen.  The equations enjoy then $SO(2)$ electric-magnetic duality invariance that rotates the field and its dual in the internal two-dimensional space that they span.  This comes over and above the twisted self-duality reformulation.

The $SO(2)$ electric-magnetic duality invariance amounts to perform rotations in the internal space of the prepotentials.   It is clear that it is also a symmetry of the action (\ref{ActionPrepot00}).  Thus, the prepotential reformulation makes it obvious that $SO(2)$ electric-magnetic duality invariance is a manifest off-shell symmetry, and not just a symmetry of the equations of motion.

\section{Comments and Conclusions}
\label{Conclusions}
\setcounter{equation}{0}

In this paper, we have achieved two things.  (i) First, we have rewritten the equations of motion for higher spin gauge fields as twisted self-duality conditions, in which the spin-$s$ field and its dual are put on exactly the same footing.  (ii) Second,  by introducing prepotentials for the spin-$s$ field and its dual, we have shown how these equations derive from a variational principle, providing thereby a duality symmetric formulation of the theory.

One observes again, for all spins, the intriguing emergence of higher spin Weyl gauge symmetries \cite{Fradkin:1985am,Vasiliev:2001zy,Segal:2002gd,Shaynkman:2004vu,Metsaev:2007rw} for the prepotentials, in addition to spin-$s$ diffeomorphisms.  This generalizes what was found in the spin-$2$ case in \cite{Henneaux:2004jw}.

One should also stress the remarkable simplicity of the final action.  Furthermore, this final action  takes the same form for all spins. This uniformity suggests that the prepotential formalism might perhaps be a good starting point for exploring the symmetries mixing all spins  -- in particular the $sp(8)$-symmetry  in four spacetime dimensions \cite{Fronsdal:1985pd,Gelfond:2015poa}.

We have restricted the analysis to massless fields in flat spacetime.  Extension to constant curvature backgrounds \cite{Julia:2005ze} and to partially massless fields would be of definite interest \cite{Deser:2012qg,Deser:2012qg,Hinterbichler:2016fgl}.

\section*{Acknowledgments}
 We thank Andrea Campoleoni for useful discussions. A.L. is Research Fellow at the Belgian F.R.S.-FNRS. The work of S.H. has been supported by the Fondecyt grant N\textordmasculine \; 3160781. This work was partially supported by the ERC Advanced Grants ``SyDuGraM" and ``High-Spin-Grav", by F.R.S.-FNRS through the conventions PDR-T.1025.14 and IISN-4.4503.15, and by the ``Communaut\'e Fran\c{c}aise de Belgique" through the ARC program. The Centro de Estudios Cient\'ificos (CECs) is funded by the Chilean Government through the Centers of Excellence Base Financing Program of Conicyt.

redpajama_set_name: RedPajamaArXiv


text:
A new Spring Thing competition has been started, and just like last year, I have submitted a game. See the website for details. If you wish to participate as a judge, you'll need to download the games and a good interpreter. Good interpreters that can run all of the games (which are in three different formats) are Gargoyle for Windows and GNU/Linux, and Spatterlight for MacOS X.
The meeting and the birth
Why are we interested in interactive fiction and roleplaying games as new forms of art? Presumably not simply because they are new and relatively unexplored, but because of the interactive aspect in its modes of creativity, complicity, judgement. (Thinking about the artistic modes of interactivity should be one of highest priorities.) Traditionally, a work of art is created by a writer, is the responsibility of the writer and expresses the judgements of the author.. Sessions of playing an RPG or reading a work of interactive fiction may transfer one or more of these wholly or partially to the players and/or readers. Why is this a good thing? What can a work of art that is interactive in this sense do that a non-interactive work can not? But perhaps this is already the wrong way of thinking, if we wish to arrive at a critique of IF and RPGs. First, there may not be a work of art. Is the program or the game book a work of art? It is certainly not the work of art we are looking for. Is
[IF] Meaning and dual authorship
This post only applies to interactive fiction that (1) has or provides the opportunity for theme * and message, in the sense that good literature has themes and may tell us a message about those themes; and (2) takes the reader seriously as a co-author of the piece. In such a case, a problem arises: who should have the last word about the message of the piece? If the player is constantly addressing the theme of the story by making thematically significant choices, but is denied the opportunity to decide the final message of the piece, she will feel disgruntled. ** On the other hand, by giving the player the last word, there is the risk of suppressing the author's view, which may be undesirable as well. There are two basic strategies to overcome this problem, which I will call the parallel and the tangential strategy. In the parallel strategy, both the author and the player state their point of view, without one dominating the other. "I believe this," the author say
[IF] Veiling and unveiling I
Introduction To recap from my previous post: every piece if interactive fiction hasd a space of possibilities. The author can choose to make these possibilities explicit to the player (unveiling them) , or the author can try to hide them (veiling them), relying on hinting, context and inspiration of the player. This post is going to be very exploratory and prelimenary; I'm going to think aloud, and I invite you to think along with me and comment. What are the techniques used for veiling and unveiling? When is veiling useful, when is unveiling useful? How do the two interact? I just deleted a list of general pros and cons of veiling and unveiling. We really need to look at concrete situations if we wish to go any further than mere vagueness. (I also just found out that 'vagaries' does not mean 'vague things'.) The out-in-the-open puzzle An out-in-the-open puzzle is like a chess problem: the situation is clear, the rules are clear, but the very complexity of th
[IF] Veiled and unveiled spaces of possibilities
Introduction: IF and CYOA People who write interactive fiction in the narrow sense often look upon Choose Your Own Adventure-style writing as a lesser form of art. Interactive fiction, they may say, allows the player complete freedom, whereas CYOA only allows the player to choose from a number of predetermined paths. There is something wrong and something right about this statement, and it will be useful to explore it further. Freedom The first thing to notice is that interactive fiction allows the player only unlimited freedom in the very trivial sense of allowing her to type whatever she wishes. The vast majority of commands - even those commands which are written in perfect english and reasonable given the knowledge the player has of the fictional work - will be met with a completely unhelpful response. In any work of IF, it is in principle possible to list all the commands that actually do something: change the state of the world or impart information to the reader. It is the
[IF] Design and time management
A lesson about writing IF I have started work on my second piece of Interactive Fiction, Fate , and development is going a lot faster then when I wrote The Baron . There are several reasons for this. First, I am using Inform 7, which is definitely easier and faster to use than Inform 6. Second, I am more experienced, and thus have to learn less about programming IF - although this benefit is partly negated by having to learn Inform 7. Third, I am writing in English only, and am thus sparing myself the struggles with the Dutch library as well as the final step of translation. But, although all these factors do play a role, I think the most important reason is something else, a hard-learned lesson of time management: The time it is worth to spend implementing a feature is inversely proportional to the chance of a player stumbling upon it. When you are writing a game, you will invariably think of strange things the player might try, and you may have brilliant ideas about what could h
This may be interesting to the readers of the blog: a new MIT press book called Second Person . It contains articles about RPGs (Jonathan Tweet, Greg Costikyan, Kenneth Hite and Paul Czege are among the contributors), it contains articles about interactive fiction (about Shade , Planetfall and Savoir-Faire , among others), and it reprints three Hogshead Press "New Style" RPGs ( Puppetland , Bestial Acts , Baron of Munchhausen ). It certainly is on my wishlist.
[Fantasy] Wisdom literature
I just read A Wizard of Earthsea , the 1971 tale by Ursula Le Guin. It has been marketed as children's literature, but it would be more accurate to say that it stands in a tradition that precedes the distinction between children's literature and adult literature. A Wizard of Earthsea is also definitely not a novel, but a tale. Perhaps I can summarise the difference as follows: novels affirm the truth of the particular, tales affirm the truth of the general. If you take a novel and change all the details, you will have a different book; but if you change all the details of a tale, you will still have the same tale. Faery tales are a good example: you can rewrite Sleeping Beauty as a tale taking place in the 20th century, with chemical substances instead of spells and scientists instead of princes, and you'll end up with Sleeping Beauty. On the other hand, it is difficult to imagine Crime and Punishment taking place anywhere else than a late-nineteenth century eastern-Euro
Forays into Gamism
For years, I played only pen-&-paper games that fell either into the broad category of Narrativism, or into the special class of funny games, such as Great Ork Gods. (Yes, yes, all usual caveats about games not being G, N or S apply, but you know what I mean.) But, lo and behold, I have recently made some forays into gamism, by playing all three editions of Dungeons and Dragons. The results were, shall we say, mixed . Dungeons & Dragons 1st edition , red book, is a relatively easy system. I played a "play this without a GM" adventure together with Jasper Polane. I have forgotten the adventure's title, but it was an official TSR offering, and consisted of exploring an old, abandoned castle in a swamp. The game was hilarious, but for all the wrong reasons. First, the system doesn't really seem to facilitate tactics at all. Character creation options are minimal, and there appeared to be an utter lack of interesting combat manoeuvres as well. Our elf could

redpajama_set_name: RedPajamaCommonCrawl


text:
Osiris-Rex: Chasing Asteroid Bennu – Out There
animationasteroidBennuEarthexplorationlaunchrobotrocketssciencesolar systemspacespace rocksspacecraftstar stuffsunVehicles
NASA's OSIRIS-REx space vehicle launched from Cape Canaveral on September 8, 2016, riding an Atlas V rocket into a seven year long mission to map the asteroid Bennu and the bring a sample of it back to Earth. From AstroidMission.org:
OSIRIS-REx seeks answers to the questions that are central to the human experience: Where did we come from? What is our destiny? Asteroids, the leftover debris from the solar system formation process, can answer these questions and teach us about the history of the sun and planets.
The OSIRIS-REx spacecraft is traveling to Bennu, a carbonaceous asteroid whose regolith may record the earliest history of our solar system. Bennu may contain the molecular precursors to the origin of life and the Earth's oceans. Bennu is also one of the most potentially hazardous asteroids, as it has a relatively high probability of impacting the Earth late in the 22nd century. OSIRIS-REx will determine Bennu's physical and chemical properties, which will be critical to know in the event of an impact mitigation mission. Finally, asteroids like Bennu contain natural resources such as water, organics, and precious metals. In the future, these asteroids may one day fuel the exploration of the solar system by robotic and manned spacecraft.
Get a closer look at its path to Bennu and back in this New York Times feature, a complement to the Out There NYT video above.
Plus, watch the launch below. Favorite moment (after launch) starts at 4m15s.
Follow this vid with Space Rocks: Comets, asteroids, meteors, & meteorites.
The Captured Ice Moon: Voyager 2 and Neptune's moon Triton
Rion Nakaya November 6, 2014 June 17, 2015
The Most Astounding Fact – Dr. Neil deGrasse Tyson
Rion Nakaya March 6, 2012 August 20, 2018
Stunning Views of Earth From the International Space Station
Rion Nakaya April 6, 2015 October 13, 2015
Fistful of Stars, a 360° experience through the lens of the Hubble Telescope
Rion Nakaya June 6, 2018
Carl Sagan's 'Pale Blue Dot'
Rion Nakaya November 9, 2016 November 9, 2020
Wanderers: Humanity's Future Expansion into the Solar System
Rion Nakaya December 2, 2014 September 22, 2015
How NASA's TESS Spacecraft Will Hunt Exoplanets
Rion Nakaya April 22, 2018 October 30, 2019
The Rosetta Mission – A claymation tale of science & adventure
Rion Nakaya October 8, 2015 July 12, 2020
Taking the very first picture of a black hole – Black Hole Hunters
Rion Nakaya June 17, 2015 February 11, 2016


Urban Factory (UF) launched its exclusive women collections at the Bangalore Fashion Week for the first time in India, with the models showcasing the clothing line on the runway. UF created a meaningful fashion that will enhance every Indian woman's lifestyle. UF showcased an avid range of unique designs, soft fabrics, elegant styles, vibrant colours, sleek cut works and patterns to suit every Indian woman's style. The launch collection is exclusively available at www.allmydibs.com e-commerce platform for people to buy them.
1. Indigo Blue – Encompasses different tones of blue in the garments with straight line cuts and geometrical prints, whilst being comfortably and fashionable.
Urban Factory (UF) is a fashion start-up that brings competitive trend western fashion to India. UF believes in Radical transparency. UF creates meaningful fashion for the urban Indian woman that enhances their lifestyle. Since its launch in August 2015 UF has maintained a steady growth, has developed a strong image in the fashion industry that provides appealing, elegant and stylish western clothing for women. UF brings to the plate an avid range of unique designs, soft fabrics, elegant styles, vibrant colors, sleek cut works and patterns to suit every woman in India.


text:
(In) The landscape darling © Kate Elliott
Wishing you all a happy 2014!
Open Factory - 18 December
The month-long occupation of the Farringdon Factory culminates in a one day event on 18 December from
13:00 - midnight. For information on times of screenings and events click here.
The Factory © Kate Elliott 2013
To an outsider 20 Farringdon Street appears to be out-of-service. An unregulated and unlit building whose surfaces have lost their gleam; an out-of-date monument to the not-so-distant past. Situated in the City of London, the surrounding architecture is permanently illuminated as the bulk of multinational corporations forms the backdrop to the labours of a workforce that operates into the night. 20 Farringdon Street is a seven-story building that has been stripped back to its skeletal structure. It is a hermetically sealed space formed of a series of cavernous L-shaped rooms which each encompass an entire floor of the building.
Between the 25 November and 18 December, this empty space operates as the Farringdon Factory; an open studio complex for live events, screenings and installations, performances and talks.
The Factory Cinema is located on the ground floor and will host a programme of short films made by both resident and invited artist/filmmakers. This curated programme will seek to connect the studio practice upstairs with both visitors and the pedestrians on the street, locating the building itself as a unique site for observation and discussion.
The Factory builds upon research by artists Natasha Cox and Keira Greene, whose collaborative practice engages with the construction of the photographic image and the mechanisms of cinema.
Resident artists include:
Max Atkins, Cilla Berg, Verity Birt, Lucy Clarke, Alex Culshaw, Amy Dickson, Hazel Dowling, Kate Elliott, Stephen Emerson, Sara Hibbert, Elizabeth Homersham, Emily Iremonger, Rebecca James, Benji Jeffrey, Ann-Marie LeQuesne, Genevieve Lutkin, Girolamo Marri, Bella Marrin, Ella McCartney, Emma McGarry, Isobel Mei, Justine Melford-Colegate, Jenny Berger Myhre, Karolina Magnusson Murray, Mette Boel Olesen, Karolina Raczynski, Annette Robinson, Jack Strange, Will Ward, Bea Wilson.
Click here to visit the Farringdon Factory website, and here for the Farringdon Factory's Facebook page.
Farringdon Factory - The Seagull
This work is being made as part of the Farringdon Factory. Click here for further information.


text:
package org.bouncycastle.jcajce.provider.test;

import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Security;
import java.security.interfaces.XECKey;
import java.security.interfaces.XECPrivateKey;
import java.security.interfaces.XECPublicKey;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.NamedParameterSpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;

import javax.crypto.KeyAgreement;

import org.bouncycastle.jcajce.interfaces.XDHPrivateKey;
import org.bouncycastle.jcajce.interfaces.XDHPublicKey;
import org.bouncycastle.jcajce.spec.RawEncodedKeySpec;
import org.bouncycastle.jcajce.spec.XDHParameterSpec;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.Arrays;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Exercise the Java 11 XEC keys and NamedParameterSpec
 */
public class XDHKeyTest
    extends TestCase
{

    public static final String BC = "BC";

    public void setUp()
    {
        if (Security.getProvider(BC) == null)
        {
            Security.insertProviderAt(new BouncyCastleProvider(), 1);
        }
    }

    public void testShouldRecogniseX448Key()
        throws Exception
    {
        KeyPairGenerator kpGen = KeyPairGenerator.getInstance("X448", BC);

        KeyPair kp = kpGen.generateKeyPair();

        assertTrue(kp.getPrivate() instanceof XECPrivateKey);
        assertTrue(kp.getPublic() instanceof XECPublicKey);

        keyFactoryCheck(kp);
    }

    public void testShouldRecogniseX25519Key()
        throws Exception
    {
        KeyPairGenerator kpGen = KeyPairGenerator.getInstance("X25519", BC);

        KeyPair kp = kpGen.generateKeyPair();

        assertTrue(kp.getPrivate() instanceof XECPrivateKey);
        assertTrue(kp.getPublic() instanceof XECPublicKey);

        keyFactoryCheck(kp);
    }

    public void testShouldRecogniseNamedParamSpec()
        throws Exception
    {
        KeyPairGenerator kpGen = KeyPairGenerator.getInstance("XDH", BC);

        kpGen.initialize(new NamedParameterSpec("X448"));

        KeyPair kp = kpGen.generateKeyPair();

        assertTrue(kp.getPrivate() instanceof XECPrivateKey);
        assertTrue(kp.getPublic() instanceof XECPublicKey);
        assertTrue(kp.getPrivate() instanceof XDHPrivateKey);
        assertTrue(kp.getPublic() instanceof XDHPublicKey);

        kpGen.initialize(new NamedParameterSpec("X25519"));

        kp = kpGen.generateKeyPair();

        assertTrue(kp.getPrivate() instanceof XECPrivateKey);
        assertTrue(kp.getPublic() instanceof XECPublicKey);
        assertTrue(kp.getPrivate() instanceof XDHPrivateKey);
        assertTrue(kp.getPublic() instanceof XDHPublicKey);
    }

    public void testShouldReturnNamedParamSpec()
        throws Exception
    {
        {
            KeyPairGenerator kpGen = KeyPairGenerator.getInstance("X25519", BC);
            KeyPair kp = kpGen.generateKeyPair();
            checkNamedParamSpecXECKey(kp.getPrivate(), "X25519");
            checkNamedParamSpecXECKey(kp.getPublic(), "X25519");
        }
        {
            KeyPairGenerator kpGen = KeyPairGenerator.getInstance("X448", BC);
            KeyPair kp = kpGen.generateKeyPair();
            checkNamedParamSpecXECKey(kp.getPrivate(), "X448");
            checkNamedParamSpecXECKey(kp.getPublic(), "X448");
        }
        {
            KeyPairGenerator kpGen = KeyPairGenerator.getInstance("XDH", BC);
            kpGen.initialize(255);
            KeyPair kp = kpGen.generateKeyPair();
            checkNamedParamSpecXECKey(kp.getPrivate(), "X25519");
            checkNamedParamSpecXECKey(kp.getPublic(), "X25519");
        }
        {
            KeyPairGenerator kpGen = KeyPairGenerator.getInstance("XDH", BC);
            kpGen.initialize(448);
            KeyPair kp = kpGen.generateKeyPair();
            checkNamedParamSpecXECKey(kp.getPrivate(), "X448");
            checkNamedParamSpecXECKey(kp.getPublic(), "X448");
        }
    }

    public void testShouldEncodeJVMKey()
        throws Exception
    {
        KeyPairGenerator kpGen = KeyPairGenerator.getInstance("XDH", "SunEC");

        kpGen.initialize(new NamedParameterSpec("X448"));

        KeyPair kp = kpGen.generateKeyPair();

        KeyFactory kFact = KeyFactory.getInstance("XDH", BC);

        PublicKey pubX448 = kFact.generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));

        assertEquals(((XECPublicKey)kp.getPublic()).getU(), ((XECPublicKey)pubX448).getU());

        PrivateKey privX448 = kFact.generatePrivate(new PKCS8EncodedKeySpec(kp.getPrivate().getEncoded()));

        assertTrue(Arrays.areEqual(
            ((XECPrivateKey)kp.getPrivate()).getScalar().get(), ((XECPrivateKey)privX448).getScalar().get()));

        kpGen.initialize(new NamedParameterSpec("X25519"));

        kp = kpGen.generateKeyPair();

        PublicKey pubX25519 = kFact.generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));

        assertEquals(((XECPublicKey)kp.getPublic()).getU(), ((XECPublicKey)pubX25519).getU());

        PrivateKey privX25519 = kFact.generatePrivate(new PKCS8EncodedKeySpec(kp.getPrivate().getEncoded()));

        assertTrue(Arrays.areEqual(
            ((XECPrivateKey)kp.getPrivate()).getScalar().get(), ((XECPrivateKey)privX25519).getScalar().get()));
    }

    private void keyFactoryCheck(KeyPair kp)
        throws Exception
    {
        KeyFactory kFact = KeyFactory.getInstance("XDH", BC);

        PublicKey publicKey = kFact.generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));
        PrivateKey privateKey = kFact.generatePrivate(new PKCS8EncodedKeySpec(kp.getPrivate().getEncoded()));

        assertTrue(
            publicKey instanceof XDHPublicKey);
        assertTrue(
            privateKey instanceof XDHPrivateKey);
        assertTrue(
            publicKey instanceof XECPublicKey);
        assertTrue(
            privateKey instanceof XECPrivateKey);
    }

    public void testInteropX25519()
        throws Exception
    {
        implTestInterop("X25519");
    }

    public void testInteropX448()
        throws Exception
    {
        implTestInterop("X448");
    }

    private void implTestInterop(String algorithm)
        throws Exception
    {
        KeyPairGenerator kpgSunEC = KeyPairGenerator.getInstance(algorithm, "SunEC");
        KeyPairGenerator kpgBC = KeyPairGenerator.getInstance(algorithm, "BC");

        KeyAgreement keyAgreementSunEC = KeyAgreement.getInstance(algorithm, "SunEC");
        KeyAgreement keyAgreementBC = KeyAgreement.getInstance(algorithm, "BC");

        for (int i = 0; i < 10; ++i)
        {
            implTestInteropCase(kpgBC, kpgBC, keyAgreementBC);
            implTestInteropCase(kpgBC, kpgSunEC, keyAgreementBC);
            implTestInteropCase(kpgSunEC, kpgSunEC, keyAgreementBC);
            implTestInteropCase(kpgBC, kpgBC, keyAgreementSunEC);
            implTestInteropCase(kpgBC, kpgSunEC, keyAgreementSunEC);
//            implTestInteropCase(kpgSunEC, kpgSunEC, keyAgreementSunEC);
        }
    }

    private void implTestInteropCase(KeyPairGenerator kpg1, KeyPairGenerator kpg2, KeyAgreement keyAgreement)
        throws Exception
    {
        KeyPair kp1 = kpg1.generateKeyPair();
        KeyPair kp2 = kpg2.generateKeyPair();

        keyAgreement.init(kp1.getPrivate());
        keyAgreement.doPhase(kp2.getPublic(), true);
        byte[] sec1 = keyAgreement.generateSecret();

        keyAgreement.init(kp2.getPrivate());
        keyAgreement.doPhase(kp1.getPublic(), true);
        byte[] sec2 = keyAgreement.generateSecret();

        assertTrue(Arrays.areEqual(sec1, sec2));

        if (kp1.getPrivate() instanceof XDHPrivateKey)
        {
            keyAgreement.init(kp2.getPrivate());
            keyAgreement.doPhase(((XDHPrivateKey)kp1.getPrivate()).getPublicKey(), true);
            byte[] sec3 = keyAgreement.generateSecret();

            assertTrue(Arrays.areEqual(sec1, sec3));
        }
    }

    public void testRawEncodedKeySpec()
        throws Exception
    {
        KeyPair xd1 = generateKP("X448", new XDHParameterSpec(XDHParameterSpec.X448));

        checkRaw(xd1.getPublic(), "X448");

        KeyPair xd2 = generateKP("X25519", new XDHParameterSpec(XDHParameterSpec.X25519));

        checkRaw(xd2.getPublic(), "X25519");
    }

    private KeyPair generateKP(String algorithm, AlgorithmParameterSpec spec)
        throws Exception
    {
        KeyPairGenerator kpGen = KeyPairGenerator.getInstance(algorithm, "BC");

        kpGen.initialize(spec);

        return kpGen.generateKeyPair();
    }

    private void checkRaw(PublicKey key, String algorithm)
        throws Exception
    {
        KeyFactory kf = KeyFactory.getInstance(algorithm, "BC");

        RawEncodedKeySpec rawSpec = (RawEncodedKeySpec)kf.getKeySpec(key, RawEncodedKeySpec.class);

        PublicKey pub = kf.generatePublic(rawSpec);

        assertEquals(key, pub);
    }

    private void checkNamedParamSpecXECKey(Key key, String name)
    {
        assertTrue(key instanceof XECKey);
        AlgorithmParameterSpec params = ((XECKey)key).getParams();
        assertTrue(params instanceof NamedParameterSpec);
        NamedParameterSpec spec = (NamedParameterSpec)params;
        assertEquals(name, spec.getName());
    }

    public static void main(String args[])
    {
        junit.textui.TestRunner.run(XDHKeyTest.class);
    }

    public static Test suite()
        throws Exception
    {
        return new TestSuite(XDHKeyTest.class);
    }
}

redpajama_set_name: RedPajamaGithub


text:
6 min read 6 min 1 Comment 1
Authored by: Jay O. Oct 24, 2010
When we did the Bubble Blast review we expressed the opinion that when it comes to games Android still had a ways to go if it wants to catch up to the iPhone. Today we're reviewing Yumsters, an interesting game that Android game fans might enjoy. Read on to find out how it scored with us.
1.0.3 1.14.50
Yumsters!
At first I couldn't help but wonder what this game is all about. The app's description is interesting, but it doesn't give that many clues as to what actually happens in the game.
These are Yumsters! Just settle them in your mobile phone and you'll forget the boredom forever! These adorable hole-dwelling creatures will please everyone. They are mad about fruit and even participate in a world fruit-eating cup.
Sounds like some kind of Tamagotchi. But, seeing as the app's Market rating is a staggering 4.87 stars out of 5, we thought we'd give it a go.
Let me start by saying that Yumsters has nothing to do with Tamagotchis, which got really old really fast (mine's been lying in a drawer for years, thirsting after new battery life). Yumsters, on the other hand, is fun. It's one of those apps that has a great gameplay as well as a big charm factor, starting off with a squeaky but cute little tune, the nice graphics, and the images that have obviously been designed very thoughtfully.
So what's Yumsters all about? Yumsters are snake/worm hybrids that are competing in a fruit-eating world cup (sounds dodgy, but seeing as there's a mobile-phone-throwing world cup in Finland, I'm no longer surprised by anything). In order to build a team they travel the world aiding their kind to eat fruit. There's Egypt, Greece, Hawaii, Japan, North America, South America, and France. That makes for a lot of levels! Sounds interesting, but what next?
Each level is composed of a sort of grid. Depending on the level of difficulty this grid has more and more spaces and holes. Fruit can appear in any of these spaces and Yumsters can appear in the holes. The fruit (pears, strawberries, blue berries, etc.) comes in different colors as do the Yumsters. The goal of the game is to get the Yumsters to eat as many fruit as possible, and, as you might have guessed, a Yumster can only eat fruit that has the same color as it. Fruit keep popping up and you have to be strategic so that it is eaten in the right sequence so that the grid doesn't overflow (this terminates the game). Pull the Yumster from the hole towards the fruit and it will start eating it. This may take some time. Sounds easy? It isn't!
Yumsters can only eat the fruit they can reach, which means that if a red Yumster should eat a red (strawberry) fruit, it can only reach it if the way isn't blocked by different colored fruit. And because the Yumsters stretch to get the food they sometimes also block the path for other Yumsters. They can't climb over or under each other, but they can "live" in every single hole. In order to get a Yumster to change hole simply tap on it and then tap the empty hole. If there's another Yumster in the given hole these two Yumsters will switch places.
The most interesting aspect is the option to make bonus points. The further a Yumster has to stretch, the more points you'll receive. If a Yumster stretches over several fruit of the same (right) color, he can eat all of them in one go and you get extra points again. There are also special worms located in specific countries: in Egypt you will find "Commander Din", and when this Yumsters is eating all the other Yumsters eat much faster. You'll also receive bonus points when all the Yumsters are eating at the same time. At the end of the level there are gold coins lying on every fruit-free space. These coins also appear throughout the game. The Yumsters have to eat all the fruit located at the top of the display. This is where the gold coins will appear; tap them in order to collect them.
That's not all. If fruit has been lying around for a while without being eaten it begins to freeze. As long as they're not completely frozen yet you can tap them and they'll defrost. Once they freeze they block the way for the Yumsters. They also can't the fruit that have butterflies sitting on them. Simply touch the butterflies and they'll fly away. There are also bugs that will freeze the fruit or harm the Yumsters. So, despite the simple-sounding gameplay the game is diversified and keeps you on your toes.
The other features are also well thought-out: great help option, a link towards the forum, online scores and achievements. Trophies are allotted to exceptional scores: when all 600 worms are eating at the same time, or if 100 fruit were eaten in one level, or 2000, or you made over 2000 cold coins, etc.
I'm sure the 5 star rating will cause some discussion, but I thought long and hard before I decided to dole out the highest rating; I simply couldn't find one single negative aspects. As far as I know there is no other gameplay like it, there's a lot of action that generates motivation, it's a lot of fun, and I'm addicted! Whether you like this game or not is a question of personal preferences and interests, but there's no denying that it's well done!
Bottom line: give it a go, you'll have a blast!
The word I'm looking for to describe the design is "cute". You start off with the easiest level. The design has obviously been made with attention to detail, for instance when the worms don't get anything to eat for a while they look really bored. The loading screen is Yumster logo that gets gobbled up. So, as I said: it's really cute!
Yumsters successfully combines fun with nice graphics: a shining example of what games should be like.
I did notice one small issue: sometimes the worm can't seem to reach the fruit which you're pulling it towards, which makes the game seem like it's lacking in a tiny bit of precision. That being said, this didn't happen often enough for it to really be a problem.
No crashing or any other problems to report. Yumsters takes a while to load, up to 10 seconds per level. This didn't bother me, but seems like a while.
Yumsters costs 0.99 British Pounds, just over one Euro or dollar. It's a great game, so I say it's worth it. Furthermore, there's a lite version if you want to test it out before committing.
steve Sep 29, 2016 Link to comment
GAME OF YUMSTERS.


Italy is among the top tourist destinations in the world. If you plan a trip to this destination, then you are sure of enjoying a number of things such as the local cuisine, art, cultures, history as well as the beauty of the place. Italy as a tourist destinations receives many visitors every year for purposes of culture, history, adventures, and many other reasons. Some of the most common tourist attractions are listed below.
The first tourist attractions that are most visited in Italy is the Naples. The Naples is the home of the pizza and spaghetti and therefore attracts many culinary tourists. These foods are always prepared and served perfectly by great chefs thus promoting the culture of the place. You can also visit the bays of Pompeii as well as the Naples to enjoy more about what natural scenic of this town. Night life and shopping tourism are the other options that you can have while on your trip.
The second unique attraction that you must visit in Italy is the lake district. The lake regions has many scenic and adventures attractions and lies to the north of Italy. The valley meadows in the southern part of Italy are also a must visit. Also to the South of Italy are the Como and Garda watercourses that are common spots for boats and walking activities. The lake district also has some of the best ancient monasteries and museums that promotes its cultural tourism.
The islands of Sicily is the other tourist destination that you must visit while on vacation to Italy. The islands of Sicily is inhabited by the Mediterranean indigenous people. You will be able to learn about the art, history, and culture of Italy if you opted to visit Italy during your trip. The temples and churches in Agrigento and Mount Etna make Sicily the best place to visit during your vacation to Italy.
The city of Rome, which is known as the romance capital of the world is another tourist attraction that you should not forget including it in your basket list of attractions while in Italy. While on your vacation, you should not forget during a trip to Rome and experience for yourself why it is regarded as the city of romance. You will be able to find the best charms while in the city of love. Rome is one of the places in Italy where you are sure of finding the best local food as well as fashion. You can decide to take a guided tour of the city in order to learn more about Rome.
You should click this page and learn more info about the best places that you can visit during your vacation to Italy.


text:
Q: Expandable ListView call getGroupCount() method again and again I have used BaseExpandableListAdapter for my expandable List View. It calls getGroupCount() again and again which decreases application performance.
Here is my code:
public class ExpandableCustomAdapter extends BaseExpandableListAdapter {

    private LayoutInflater inflater;
    ArrayList<MenuItem> menuItem;
    Context context;
    private Map<String, ArrayList<MenuItem>> parent;

    public ExpandableCustomAdapter(Context context, Map<String, ArrayList<MenuItem>> mParent) {
        parent = mParent;
        inflater = LayoutInflater.from(context);
        this.context = context;
    }

    @Override
    // counts the number of group/parent items so the list knows how many
    // times calls getGroupView() method
    public int getGroupCount() {
        int size = parent.size();

        return size;
    }

    @Override
    // counts the number of children items so the list knows how many times
    // calls getChildView() method
    public int getChildrenCount(int i) {
        List<String> copyOfKeys = new ArrayList<String>(parent.keySet());
        menuItem = parent.get(copyOfKeys.get(i));

        return menuItem.size();
    }

    @Override
    public Object getChild(int groupPosition, int childPosition) {
        List<String> copyOfKeys = new ArrayList<String>(parent.keySet());
        menuItem = parent.get(copyOfKeys.get(groupPosition));
        Object obj = menuItem.get(childPosition);

        return obj;
    }

    @Override
    // in this method you must set the text to see the parent/group on the
    // list
    public View getGroupView(int i, boolean b, View view, ViewGroup viewGroup) {

        ParentViewHolder holder;
        System.out.println("getview:" + i);

        if (view == null)
        {
            holder = new ParentViewHolder();
            LayoutInflater infalInflater = (LayoutInflater) instance.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = infalInflater.inflate(
                    R.layout.bannerlayoutparentinflater, null);
            holder.backgroundRelative = (RelativeLayout) view
                    .findViewById(R.id.mainlayoutparent);

            view.setTag(holder);
        }

        else
        {
            holder = (ParentViewHolder) view.getTag();
        }

        // Beverages_Cocktails_banner
        List<String> copyOfKeys = new ArrayList<String>(parent.keySet());
        menuItem = parent.get(copyOfKeys.get(i));
        String course = menuItem.get(0).course;
        Drawable background = new BitmapDrawable(getResources(), ImageList
                .getInstance().getImageBitmap(value);
        holder.backgroundRelative.setBackground(background);

        // set Image indicator
        holder.indicator = (ImageView) view.findViewById(R.id.imageView1);

        if (b)
        {
            holder.indicator.setRotation(180);
        }

        else
        {
            Bitmap menuIndBitmapicatorBitmap = ImageList.getInstance()
                    .getImageBitmap(ImageNames.SECTION_HEADER_ARROW_IMAGE);
            holder.indicator.setImageBitmap(menuIndBitmapicatorBitmap);
            holder.indicator.setRotation(360);
        }

        // return the entire view
        return view;
    }

    @Override
    // in this method you must set the text to see the children on the list
    public View getChildView(int i, int i1, boolean b, View view,
            ViewGroup viewGroup) {

        ChildViewHolder childHolder;

        if (view == null) {
            childHolder = new ChildViewHolder();
            inflater = LayoutInflater.from(context);
            LayoutInflater infalInflater = (LayoutInflater) instance.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = infalInflater.inflate(
                    R.layout.bannerlayoutchildinflater, null);
            childHolder.backgroundRelativeChild = (RelativeLayout) view
                    .findViewById(R.id.mainlayoutchild);

            view.setTag(childHolder);
        }

        else
        {
            childHolder = (ChildViewHolder) view.getTag();
        }

        //childHolder.backgroundRelativeChild.removeAllViews();

        List<String> copyOfKeys = new ArrayList<String>(parent.keySet());
        menuItem = new ArrayList<MenuItem>();
        menuItem = parent.get(copyOfKeys.get(i));

        // removeAllViews();

        CategoryCourseMenuList menuList1 = new CategoryCourseMenuList(
                instance, null, 0, menuItem);
        MenuItem menu=menuItem.get(i1);
        menuList1.addLayoutMenu(menu);

    //  menuList1.setCourseMenuList(menuItem);

        LayoutParams menuListParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
        menuListParams.topMargin = Utils.getPixelValue(2);
        menuListParams.bottomMargin = Utils.getPixelValue(2);
        childHolder.backgroundRelativeChild.addView(menuList1, menuListParams);
        Animation animation = AnimationUtils.loadAnimation(context, R.anim.list_animation);

        // view.startAnimation(animation);
        // animation = null;

        // return the entire view
        return view;
    }

    @Override
    public void registerDataSetObserver(DataSetObserver observer) {

        /* used to make the notifyDataSetChanged() method work */
        super.registerDataSetObserver(observer);
    }

    @Override
    public Object getGroup(int groupPosition) {
        Object obj = parent.get(groupPosition);

        return obj;
    }

    @Override
    public long getGroupId(int groupPosition) {
        return groupPosition;
    }

    @Override
    public long getChildId(int groupPosition, int childPosition) {
        return childPosition;
    }

    @Override
    public boolean hasStableIds() {
        return false;
    }

    @Override
    public boolean isChildSelectable(int groupPosition, int childPosition) {
        return true;
    }
}

Any Idea?

redpajama_set_name: RedPajamaStackExchange


text:
iran universities
Iran, Mexico universities ink MoC
Maraghe (IP) - The University of Maragheh of Iran has signed an educational and research memorandum with the Autonomous University of Queretaro, Mexico.
Iran, Romanian Universities expand scientific relations
Tehran (IP)- The head of the University of Tehran expressed hope that a new chapter of scientific relations and joint research activities will be formed between the University of Tehran and the universities of Romania.
Baqiyatallah University holds scientific meeting
Wednesday, 24 February 2021 20:23
Tehran (IP) - The first annual faculty scientific meeting of the Baqiyatallah University of Medical Sciences was held on February 24, 2021, considered a milestone in the short history of the university.
Iranian universities stand tall among world most cited universities
Semnan (IP) - The president of Semnan University said that the name of this university, according to the methodology of the Islamic World Science Citation (ISC) database, is among the most cited universities in the world at one percent.
E- Learing underway at Iran's universities amid coronavirus outbreak
Tehran(IP)- Coronavirus outbreak and its continuation made inevitable changes in people's lives worldwide. One of these huge changes was in the educational system which switched to E-learning completely, and like different parts of the world, E-Learning is underway at Iran's universities. 104/216