\section*{Abstract}
{\bf
Isotropic fluids in two spatial dimensions can break parity symmetry and sustain transverse stresses which do not lead to dissipation. Corresponding transport coefficients include odd viscosity, odd torque, and odd pressure. We consider an isotropic Galilean invariant fluid dynamics in the adiabatic regime with momentum and particle density conservation.  We find conditions on transport coefficients that correspond to dissipationless and separately to Hamiltonian fluid dynamics. The restriction on the transport coefficients will help identify what kind of hydrodynamics can be obtained by coarse-graining a microscopic Hamiltonian system. Interestingly, not all parity-breaking transport coefficients lead to energy conservation and, generally, the fluid dynamics is energy conserving but not Hamiltonian. We show how this dynamics can be realized by imposing a nonholonomic constraint on the Hamiltonian system.
}

\vspace{10pt}
\noindent\rule{\textwidth}{1pt}
\tableofcontents\thispagestyle{fancy}
\noindent\rule{\textwidth}{1pt}
\vspace{10pt}

\section{Introduction}
\label{sec:intro}
In fluid dynamics, viscosities appear as transport coefficients in the first-order derivative expansion of the stress tensor. Viscosity terms preserve both mass and momentum conservation laws but usually spoil the energy conservation due to their dissipative nature. For example, shear viscosity $(\eta)$ introduces friction between adjacent fluid layers that do not flow with the same velocity, whereas the bulk viscosity $(\zeta)$ provides resistance to compression or expansion of the fluid.

In two spatial dimensions, there exist viscosity coefficients within the first-order hydrodynamics that break parity symmetry and preserve both the fluid isotropy and energy conservation. Odd viscosity ($\eta_H$) is undoubtedly the most famous of the parity-breaking viscosity terms, first showing up in the study of plasma physics~\cite{lifshitz1981physical} and later on as a new quantized response in quantum Hall systems~\cite{avron1995viscosity}. It was introduced in the hydrodynamic context by Avron in~\cite{avron1998odd} and was recently experimentally observed in both electron fluids~\cite{berdyugin2019measuring} and active matter systems~\cite{soni2018free}.

In quantum Hall systems, the odd viscosity is associated with the intrinsic angular momentum density of the electron fluid~\cite{read2009non,haldane2011geometrical,abanov2013effective}. In classical systems, the intrinsic angular momentum density ($\ell$) is an independent dynamical variable with its own continuity equation. On the other hand, odd viscosity is a transport coefficient, that is, a function of density and temperature. If we initialize  $\ell$ to be proportional to density, this relationship is preserved for all times since both quantities satisfy similar continuity equations (in the absence of internal torque). This class of initial conditions with $\ell\propto \rho$ corresponds to a projected Hamiltonian system. In general, such a projection need not lead to a new Hamiltonian system. However, $\ell\propto \rho$ does not spoil the underlying Poisson algebra as shown in Ref.~\cite{lingam2015hall}. Together with a velocity redefinition \cite{abanov2013effective}, this projection gives rise to odd viscosity terms in the momentum conservation equation. Physically, this projection ($\ell\propto \rho$) can be realized in systems where fluid intrinsic angular momentum equilibrates much faster than the other hydrodynamic quantities~\cite{banerjee2017odd}.

Recently, it was shown in~Ref.~\cite{markovich2020odd} that odd viscosity could also arise in the equation of motion from a non-Hamiltonian reduction of the intrinsic angular momentum $\ell$. For that, the authors introduced dissipative terms and an external drive to a Hamiltonian system. The out-of-equilibrium dynamics leads to the relaxation of the fluid intrinsic angular momentum, giving rise to the odd viscosity term in the Navier-Stokes equation. The non-Hamiltonian projection in Ref.~\cite{markovich2020odd}, odd viscosity is a linear function of the mass density, but it depends explicitly on the external drive. Although Refs.~\cite{lingam2015hall,banerjee2017odd,markovich2020odd} describe different physical systems, all of them obtain odd viscosity through relaxation of the intrinsic angular momentum. However, odd viscosity is not the only parity odd coefficient in two dimensions and it is not {\it a priori} clear if some or all of these other coefficients can be obtained starting from a microscopic Hamiltonian system. In fact, the identification of Hamiltonian systems provides a benchmark for idealized dissipationless systems about which the dissipative contributions can be introduced.

In this work, we start from the most general first-order hydrodynamic equations of motion and derive under which conditions the density dependent viscosity coefficients can be derived from a Hamiltonian system. Throughout the paper, we only consider adiabatic flows, neglecting heat transport~\footnote{Adiabatic conditions are satisfied when the fluid contracts or expands so fast that there is no time to exchange heat between its adjacent layers. The adiabaticity ensures that energy conservation follows directly from mass and momentum conservation laws.}. There are in total $6$ independent viscosity coefficients which preserve fluid isotropy and satisfy Galilean symmetry in two dimensions. Half of these transport coefficients are even under parity symmetry, and the other half is parity odd~\footnote{Throughout this paper, we denote parity-breaking terms with a subscript $H$\label{Subscript-H}}. In general, parity-violating forces are transverse to the fluid motion and perform no work. Therefore, such terms are expected not to dissipate energy. However, it is not apparent whether a 2D hydrodynamical system with parity-odd coefficients possesses conserved energy in general. In addition, even if the conserved energy exists, it is not obvious that the corresponding system is Hamiltonian.  We show that not all parity-breaking transport coefficients amount to energy conservation. For a hydrodynamic system whose energy is conserved, we derive constraints on the transport coefficients for the system to be Hamiltonian. As a consequence, we obtain that an energy-conserving hydrodynamic system is Hamiltonian only if there exists a conserved quantity, $\rho v_i+\epsilon_{ij}\partial_j\eta_H$, which satisfies the diffeomorphism algebra. This quantity is associated with the ``molecular'' center-of-mass momentum density, as pointed out in~\cite{markovich2020odd}. The energy-conserving cases that fail to be Hamiltonian systems are closely related to projections of the intrinsic angular momentum incompatible with the Poisson algebra. We discuss the projection of the intrinsic angular momentum to a function of mass density and the breakdown of the Hamiltonian system from the point of view of nonholonomic constraints.

This paper is organized as follows: we begin by defining our hydrodynamic system in Sec~\ref{sec:hydro-eq} and present the conditions for the fluid energy to be conserved. In Sec.~\ref{sec:ham}, we derive under which conditions the aforementioned energy-conserving systems are Hamiltonian. In Sec.~\ref{sec:nonhol}, we study the connection between dynamical intrinsic angular momentum and odd viscosity as well as its implications towards non-Hamiltonian systems with conserved energy density. We close the paper with conclusions and discussions. Some technical details are relegated to appendices.

\section{Energy conservation in 2D fluid dynamics}
 \label{sec:hydro-eq}

Hydrodynamic equations consist of local conservation laws for mass and momentum, assuming all other relevant quantities are equilibrated. These equations are supplemented by constitutive relations between the conserved quantities. The presence of a finite mean-free-path and a finite characteristic relaxation time of the interacting system modify the dynamics at small length scales and at transient times, giving rise to derivative corrections in these constitutive relations. This means that constitutive relations can be formally written as an expansion in derivatives, both in time and space, and the hydrodynamic equations are obtained by truncating this series at some particular order. In non-relativistic hydrodynamics, spatial and time derivatives do not scale the same way, and only terms with a single spatial derivative enter in the constitutive relations in the first-order derivative expansion. Mass (the continuity equation) and momentum conservation can be written in terms of the mass density ($\rho$) and velocity ($v_i$) as
\begin{align}
 \partial_t\rho+\partial_i(\rho v_i)&=0\,, \label{eq:continuity}
 \\
 \partial_tv_j+v_i\partial_iv_j&=\frac{1}{\rho}\partial_iT_{ij}\,. \label{eq:momentum}
\end{align}
Here, the stress tensor $T_{ij}$ is of first-order in spatial gradients and is given by
\begin{align}
T_{ij}= -p(\rho)\,\delta_{ij}+\eta_{ijkl}(\rho)\,\partial_kv_l\,, \label{stress}
\end{align}
where $\eta_{ijkl}$ is the viscosity tensor. In principle, all transport coefficients must be functions of density and temperature, however, for adiabatic flows, temperature can be expressed in terms of fluid density. The relation between pressure and mass density for adiabatic flows gives us the equation of state,
\begin{equation}
    p(\rho)=\rho\,\varepsilon'(\rho)-\varepsilon(\rho),
 \label{eq:pressure}
\end{equation}
where $\varepsilon(\rho)$ is the internal energy density of the fluid.

In first-order hydrodynamics, the fluid velocity cannot be uniquely defined, leading to different hydrodynamic frames~\cite{landau2013fluid, jensen2012parity, Dubovsky2011, haehl2015adiabatic}. Even though hydrodynamic equations depend on the specific parametrization of momentum density in terms of the fluid velocity, the momentum conservation must not rely on any particular definition of the fluid velocity. In this work, we {\it define} the fluid velocity such that the momentum density is expressed as $\rho v_i$. Equations~(\ref{eq:continuity}, \ref{eq:momentum}) must be invariant under the Galilean symmetry, that is,
\begin{align*}
    t\rightarrow t,\quad x_i\rightarrow x_i-V_i\, t, \quad\text{and}\quad v_i\rightarrow v_i+V_i\, ,
\end{align*}
for a constant boost velocity $V_i$. Consequently, the divergence of the stress tensor must be invariant under this Galilean symmetry; that is, the force must be independent of the boost velocity. Moreover, this also implies that the mass current can only differ from the momentum density by some ``magnetization current", which does not modify the equations of motion~(\ref{eq:continuity}, \ref{eq:momentum}).

The isotropic condition imposes that there are only 6 independent viscosity coefficients in two dimensions, that is,
\begin{align}
    \eta_{ijkl} &= \eta\left(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{jk}-\delta_{ij}\delta_{kl}\right)+\zeta\,\delta_{ij}\delta_{kl}+\Gamma\,\epsilon_{ij}\epsilon_{kl}
 \nonumber \\
    &\,+\eta_H\left(\epsilon_{ik}\delta_{jl}+\epsilon_{jl}\delta_{ik}\right)+\zeta_H\,\delta_{ij}\epsilon_{kl}+\Gamma_H\epsilon_{ij}\delta_{kl}\,.
 \label{eq:eta}
\end{align}
Here and in the following, we suppress the dependence of all coefficients on density using the notation $\eta(\rho)\to \eta$, etc.

As previously mentioned, $\eta$, $\zeta$, and $\eta_H$ are shear, bulk, and odd viscosities, respectively. The quantity $\zeta_H$ is the odd pressure coefficient, $\Gamma$ is the rotational viscosity, and we refer to the $\Gamma_H$ term as the odd torque coefficient. Rotational viscosity gives rise to torque when the fluid vorticity is non-zero, and the odd pressure coefficient generates pressure when fluid vorticity does not vanish. Finally, the odd torque coefficient $\Gamma_H$ generates torque when the fluid expands or compresses~\footnote{For a hydrodynamic system without any internal torque, the stress tensor must be symmetric, which imposes that $\Gamma=\Gamma_H=0$.}.

A close inspection of Eqs.~(\ref{stress}) and (\ref{eq:eta}) shows that there is a symmetry among transport coefficients that leaves Eq.~(\ref{eq:momentum}) invariant. Indeed, under the transformation
\begin{align}
    \eta\rightarrow \eta+c_1,\qquad &\zeta\rightarrow \zeta-c_1,\qquad \Gamma\rightarrow \Gamma-c_1,
 \label{even} \\
    \eta_H\rightarrow \eta_H+c_2,\quad &\zeta_H\rightarrow \zeta_H-c_2,\quad \Gamma_H\rightarrow \Gamma_H+c_2.
 \label{odd}
\end{align}
with two arbitrary constants $c_1$ and $c_2$, we obtain
\begin{equation}
    \partial_iT_{ij}\rightarrow \partial_i[T_{ij}+2\partial_i^*\left(c_1\,v_j^*+c_2\, v_j\right)]=\partial_iT_{ij}.
 \label{stress-red}
\end{equation}
Here and in the following, we define the star operation as  $a_i^*\equiv \epsilon_{ij}a_j$. Since we are only interested in equations of motion and not in a particular form of the stress tensor, we will ignore these redundancies for the rest of this work. The particular form of the stress tensor, however, is crucial for the free surface problems for which a no-stress boundary condition is imposed~\cite{abanov2019hydro}.

For reasons that will be clear later, it is convenient to parametrize the parity-breaking part of Eq.~(\ref{eq:eta}), i.e., viscosity coefficients with subscript $H$, as
\begin{align}
    \eta^{H}_{ijkl} &= \bar\eta_{ijkl} -\rho G'\delta_{ij}\epsilon_{kl}\,.
 \label{etaH}
\end{align}
Here we have introduced the tensor
\begin{equation}
    \bar\eta_{ijkl}=\eta_H\left(\epsilon_{ik}\delta_{jl}+\epsilon_{jl}\delta_{ik}\right)+\Gamma_H\left(\epsilon_{ij}\delta_{kl}-\delta_{ij}\epsilon_{kl}\right)\,,
 \label{eta-bar}
\end{equation}
which is anti-symmetric with respect to the interchange of following pairs of indices
\begin{align}
    \bar\eta_{ijkl}=-\bar\eta_{klij} \,.
 \label{as}
\end{align}
Comparing (\ref{eq:eta}) with (\ref{etaH},\ref{eta-bar}), we see that the newly introduced function $G(\rho)$ is related to $\zeta_H$ by
\begin{align}
    \zeta_H &= -\Gamma_H-\rho G'\,.
 \label{zetaH}
\end{align}

In order to study the Hamiltonian structure of Eqs.~(\ref{eq:continuity}-\ref{stress},\ref{eq:eta}) the first step is to obtain under which conditions these equations allow for a third conserved quantity, namely, energy. We are looking for a conserved energy density $\mathscr{E}$ satisfying
\begin{equation}
    \partial_t\mathscr E+\partial_iQ_i=0\,\label{energy-current}
\end{equation}
with some local energy current $Q_i$. To be consistent with zeroth-order hydrodynamics, that is, $\eta_{ijkl}\rightarrow0$, the energy density should have the form
\begin{equation}
    \mathscr E=\tfrac{1}{2}\rho v_i^2+\varepsilon(\rho)+\ldots\,, \label{eq:energy-dens0}
\end{equation}
where dots denote terms of higher order in spatial gradients of density and velocity fields. Here and in the following, we use $v_i^2$ instead of $v_i v_i$ to shorten up the notation.

We now state the general condition (up to the redundancies~(\ref{even}-\ref{stress-red}) in the stress tensor) for the energy conservation while leaving the full details of the calculation to the Appendix~\ref{app:energycons}.
\begin{statement}
 \label{st1}
The energy of a hydrodynamic system described by Eqs.~(\ref{eq:continuity}-\ref{eq:eta}) is only conserved when the parity-preserving viscosity coefficients vanish, that is, $\eta=\zeta=\Gamma=0$, and when the parity-breaking viscosity coefficients satisfy one of the following two conditions \\
\mbox{}\\
Case 1:  For $\eta_H(\rho)$ and $\Gamma_H(\rho)$ arbitrary and
    $$G=0\,.$$
Case 2: For an arbitrary function $G(\rho)$ and an arbitrary constant parameter $c$, along with
$$\begin{array}{ccl}
        \eta_H &=& cG \,, \\
        \Gamma_H &=& c(G-2\rho G')\,.

\end{array}$$
\end{statement}
From Eq.~(\ref{zetaH}), we obtain that $\zeta_H=-\Gamma_H$ in the first case and $\zeta_H=-c(G-2\rho G')-\rho G'$ in the  second one. The conserved energy density in both cases can be generically written as
\begin{align}
    \mathscr E &=\tfrac{1}{2}\rho v_i^2+\varepsilon +v_i\partial_i^*G+\frac{c}{\rho}(\partial_iG)^2\,.
 \label{eq:energy-dens02}
\end{align}
Note that when $G=0$ (Case 1), the energy density has the same functional form as in the inviscid case.

The dissipative nature of viscosities $\eta,\zeta,\Gamma$ is well known. It is not known however that an arbitrary choice of odd viscosities $\eta_H,\zeta_H,\Gamma_H$ may not lead to dissipationless fluid dynamics. The energy density equation can be deduced from Eqs.~(\ref{eq:continuity}-\ref{stress}) and can be written as
\begin{align}
    \partial_t &\left(\varepsilon+\tfrac{1}{2}\rho v_i^2\right) +\partial_i\left[\left(\varepsilon'+\tfrac{1}{2}v_j^2\right)\rho v_i-\eta_{ijkl}v_j\partial_k v_l\right]
 \nonumber \\
    &= -\eta_{ijkl}\partial_i v_j\partial_k v_l\,.
 \label{encons1}
\end{align}
In Case 1, the viscosity tensor is given by $\bar\eta_{ijkl}$ which forces the right hand side of (\ref{encons1}) to vanish due to the antisymmetry property~(\ref{as}), leading to conserved energy density.

The second condition of Statement I is more subtle, and we refer the reader to Appendix~\ref{app:energycons} for details. For the particular case of $c=0$, the only nonvanishing viscosity coefficient is $\zeta_H=-\rho G'$. For this particular case, the corresponding stress is diagonal and can be considered a modification of the pressure term in the Euler equation so that $p\to p-\zeta_H\omega$. Here $\omega=\partial_1v_2-\partial_2 v_1$ is the fluid vorticity.

In the next section, we will address when the energy-conserving fluid dynamics described in Statement~\ref{st1} can be endowed with the Hamiltonian structure.

\section{Hamiltonian fluid dynamics in two dimensions}
 \label{sec:ham}

A fluid dynamic system is Hamiltonian if its hydrodynamic equations can be generated by a Hamiltonian function (total energy of the fluid) and a set of Poisson brackets. In other words, both mass and momentum conservation laws can be written as Hamilton's equations. We often refer to the Hamiltonian function together with the Poisson algebra as the Hamiltonian structure. In contrast to the standard textbook examples, here we have both the Hamiltonian, i.e., the integrated energy density of the fluid  (Eq.~(\ref{eq:energy-dens02})) and the equations of motion (Eqs.~(\ref{eq:continuity}-\ref{stress})) together with the conditions of Statement~\ref{st1}. Our goal is to derive, when it exists, the Poisson algebra for these systems. As a result of our analysis, we show that not all cases in Statement~\ref{st1} can possess Hamiltonian structure.

\subsection{Hamiltonian structure of zeroth-order hydrodynamics}

Before we proceed to study the cases of Statement I, let us briefly review the well-known Hamiltonian formulation for the inviscid or, more precisely, the zeroth-order hydrodynamics~\cite{zakharov1971hamiltonian,1997-ZakharovKuznetsov,morrison1998hamiltonian}. Let us consider the set of Eqs.~(\ref{eq:continuity}-\ref{stress}) with $\eta_{ijkl}=0$. Here it is convenient to write the hydrodynamic equations in terms of conserved quantities since they are frame-independent.  Indeed, it is straightforward to check that both equations (\ref{eq:continuity}) and (\ref{eq:momentum}), written in terms of $\rho$ and $\text{\textctj}_i\equiv\rho v_i$, are generated by the Hamiltonian
\begin{equation}
    H_0=\int \left[\frac{\text{\textctj}_i^2}{2\rho}+\varepsilon(\rho)\right]d^2x\,,
 \label{H0}
\end{equation}
along with the following Poisson brackets
\begin{align}
    \{\rho(\boldsymbol x),\rho(\boldsymbol y)\}&=0,
 \label{rho-rho} \\
    \{\rho(\boldsymbol x),\text{\textctj}_i(\boldsymbol y)\}&=-\rho(\boldsymbol y)\frac{\partial}{\partial y_i}\delta(\boldsymbol x-\boldsymbol y),
 \label{rho-j} \\
    \{\text{\textctj}_i(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\}&=\left[\text{\textctj}_k(\boldsymbol x)\frac{\partial}{\partial x_i}-\text{\textctj}_i(\boldsymbol y)\frac{\partial}{\partial y_k}\right]\delta(\boldsymbol x-\boldsymbol y)\,.
 \label{j-j}
\end{align}

The subalgebra defined in Eq.~(\ref{j-j}) is the diffeomorphism algebra so that the momentum density $\text{\textctj}_i$ is the generator of ``local translations" (diffeomorphisms). The Lie-Poisson algebra defined in Eqs.~(\ref{rho-rho}-\ref{j-j}) is a semidirect product algebra which we will refer to simply as Extended Diffeomorphism Algebra (EDA) hereon. The time evolution of any quantity is defined by $\partial_t Q=\{H,Q\}$~\footnote{Here, we follow the notation convention in Ref.~\cite{zakharov1971hamiltonian}. The algebra presented here may differ by an overall negative sign from some other references in the literature.}. In particular, for the time evolution of density and momentum density fields, one proceeds as
\begin{align}
    &\partial_t\rho(\boldsymbol x)=\{H,\rho(\boldsymbol x)\} \label{eq:rho-dot}
    \\
    &=\int \left[\frac{\delta H}{\delta \rho(\boldsymbol y)}\{\rho(\boldsymbol y),\rho(\boldsymbol x)\}+\frac{\delta H}{\delta \text{\textctj}_i(\boldsymbol y)}\{\text{\textctj}_i(\boldsymbol y),\rho(\boldsymbol x)\}\right]d^2y\,, \nonumber
  \\
     &\partial_t\text{\textctj}_i(\boldsymbol x)=\{H,\text{\textctj}_i(\boldsymbol x)\} \label{eq:j-dot}
     \\
     &=\int \left[\frac{\delta H}{\delta \rho(\boldsymbol y)}\{\rho(\boldsymbol y),\text{\textctj}_i(\boldsymbol x)\}+\frac{\delta H}{\delta \text{\textctj}_k(\boldsymbol y)}\{\text{\textctj}_k(\boldsymbol y),\text{\textctj}_i(\boldsymbol x)\}\right]d^2y\,. \nonumber
\end{align}
It can be checked that substituting Poisson's brackets (\ref{rho-rho}-\ref{j-j}) into the above equations one obtains the correct evolution equations for $\rho$ and $\text{\textctj}_i=\rho v_i$ equivalent to (\ref{eq:continuity},\ref{eq:momentum}).

Using (\ref{rho-rho}-\ref{j-j}) one can compute Poisson brackets of any two functionals of $\rho$ and $\text{\textctj}_i$. Poisson brackets between two functions (or functionals) of $\rho$ and $\text{\textctj}_i$ must satisfy two conditions: (1) antisymmetry
\begin{align}
    \{Q,R\}=-\{R,Q\}
 \label{FG-anti}
\end{align}
and (2) Jacobi identity
\begin{align}
    \mathscr{J}\big\{Q,R,S\big\} &\equiv \{\{Q,R\},S\}+\{\{S,Q\},R\}+\{\{R,S\},Q\}
 \nonumber \\
    &=0\,.
 \label{EFG-Jacobi}
\end{align}
Here $\mathscr{J}(Q,R,S)$, defined in the first line of~(\ref{EFG-Jacobi}), is referred as the \emph{Jacobiator} of three functionals $Q,R,S$ of $\rho$ and $\text{\textctj}_i$. The Jacobi identity is the statement that the Jacobiator vanishes for any three functionals~\footnote{Jacobi identity is associated to the existence of local canonical coordinates.}.
It can be checked that (\ref{rho-rho}-\ref{j-j}) satisfy antisymmetry condition and Jacobi identity (\ref{FG-anti},\ref{EFG-Jacobi}).

\subsection{Modification of brackets for the first-order hydrodynamics}

Since not all dynamical systems with conserved energy are Hamiltonian systems~\cite{arnol2013mathematical, arnold2007mathematical, bloch2003nonholonomic}, the scope of this section is to find under which conditions the systems defined in the Statement~\ref{st1} are Hamiltonian. For that, we must obtain the brackets that, together with the Hamiltonian
\begin{align}
    H &= \int\left[\frac{\text{\textctj}_i^2}{2\rho}+\varepsilon+\frac{\text{\textctj}_i}{\rho}\partial_i^*G+\frac{c}{\rho}(\partial_iG)^2\right]d^2x\,,
 \label{H2}
\end{align}
generate Eqs.~(\ref{eq:continuity},\ref{eq:momentum}), where the stress tensor satisfy both Eqs.~(\ref{stress}-\ref{eq:eta}) and the Statement~\ref{st1}. The Hamiltonian~(\ref{H2}) is obtained by integrating the energy density~(\ref{eq:energy-dens02}). It is important to point out that this choice of Hamiltonian is not only natural, but it recovers the ideal fluid Hamiltonian in the limit when $\eta_{ijkl}\rightarrow0$.

We find that the continuity equation can be generated by the brackets (\ref{rho-rho},\ref{rho-j}), while the bracket (\ref{j-j}) must be modified in order to provide us the correct momentum conservation equation. After such deformation, the momentum density algebra becomes
\begin{align}
    \{\text{\textctj}_i(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\}&=\left[\text{\textctj}_k(\boldsymbol x)\frac{\partial}{\partial x_i}-\text{\textctj}_i(\boldsymbol y)\frac{\partial}{\partial y_k}\right]\delta(\boldsymbol x-\boldsymbol y)
 \nonumber \\
    &-\frac{\partial}{\partial x_j}\left[\bar\eta_{jil k}\big(\rho(\boldsymbol x)\big)\frac{\partial}{\partial x_l}\delta(\boldsymbol x-\boldsymbol y)\right],
 \label{j-j-mod}
\end{align}
where $\bar\eta_{ijkl}$ is defined in~(\ref{eta-bar}). The antisymmetry property of $\bar\eta_{ijkl}$ (Eq.~(\ref{as}))  together with the identities
\begin{align*}
f(\boldsymbol x)\,\delta(\boldsymbol x-\boldsymbol y)&=f(\boldsymbol y)\,\delta(\boldsymbol x-\boldsymbol y)\,,
\\
\frac{\partial}{\partial x_m}\delta(\boldsymbol x-\boldsymbol y)&=-\frac{\partial}{\partial y_m}\delta(\boldsymbol x-\boldsymbol y)\,,
\end{align*}
guarantees the antisymmetry of the bracket~(\ref{j-j-mod}). Here, we assume that the bracket deformation is local and recovers the diffeomorphism algebra~(\ref{j-j}) in the limit of an ideal fluid. The algebra~(\ref{rho-rho},\ref{rho-j},\ref{j-j-mod}) is sometime called \emph{almost} Poisson brackets~\cite{bloch2003nonholonomic}, since it satisfies the property~(\ref{FG-anti}), but not necessarily the Jacobi identity~(\ref{EFG-Jacobi}).

The direct computation of equations of motion generated by the Hamiltonian (\ref{H2}) with the algebra (\ref{rho-rho},\ref{rho-j},\ref{j-j-mod}) provides us the following hydrodynamic equations
\begin{align}
    \partial_t\rho &=-\partial_i\text{\textctj}_i\,,
 \label{continuity-j} \\
    \partial_t\text{\textctj}_k &=-\partial_i\left[\frac{\text{\textctj}_i\text{\textctj}_k}{\rho}+p\,\delta_{ik}-\eta^H_{iklm}\,\partial_l\Big(\frac{\text{\textctj}_m}{\rho}\Big) \right]\,,
 \label{momentum-2}
\end{align}
with $\eta^{H}_{ijkl}$ defined by (\ref{etaH},\ref{eta-bar}) with parameters specified in the Statement~\ref{st1}. More specifically, in Case 1, both $\eta_H$ and $\Gamma_H$ are independent functions of density in the bracket~(\ref{j-j-mod}) and the Hamiltonian is obtained by taking $G=0$ in the Eq.~(\ref{H2}). In Case 2, we must substitute $\eta_H=c G$ and $\Gamma_H=c(G-2\rho G')$ in the bracket~(\ref{j-j-mod}). It is easy to see that this system of equations is equivalent to Eqs.~(\ref{eq:continuity},\ref{eq:momentum}), when the stress tensor is given by Eqs.~(\ref{stress}-\ref{eq:eta}) and the viscosity tensor satisfies one of the the cases in the Statement~\ref{st1}. Because these equations are generated by antisymmetric brackets, the Hamiltonian~(\ref{H2}) itself is automatically conserved, since $\partial_tH =\{H,H\}=0$. In the following, we will check if these {\it almost} Poisson brackets satisfy the Jacobi identity.

\subsection{Constraints imposed by Jacobi identity}

{\it Prima facie} one might think that the identification of antisymmetric brackets (\ref{j-j-mod}) means that all energy-conserving cases specified by Statement~\ref{st1} are Hamiltonian. However, for the system to be Hamiltonian, brackets must also satisfy the Jacobi identity (\ref{EFG-Jacobi}). We now present the main condition for which the brackets in Eqs.~(\ref{rho-rho},\ref{rho-j},\ref{j-j-mod}) satisfy the Jacobi identity~(\ref{EFG-Jacobi}).
\begin{statement}
 \label{st2}
    The antisymmetric brackets from Eqs.~(\ref{rho-rho},\ref{rho-j},\ref{j-j-mod}) are Poisson brackets, i.e, satisfy Jacobi identity if and only if
\begin{align}
    \Gamma_H(\rho)=\eta_H(\rho)-\rho\,\eta'_H(\rho)\,.
 \label{jacobi-cond}
\end{align}
When this condition holds, there exists a locally conserved quantity, namely
\begin{align}
   J_i &\equiv \text{\textctj}_i+\partial_i^*\eta_H(\rho)\,,
 \label{mod-j}
\end{align}
which satisfies the diffeomorphism algebra.
\end{statement}

To see the origin of the condition (\ref{jacobi-cond}) let us consider the modified momentum density $J_i$ (\ref{mod-j}). It is clear that the bracket $\{\rho(\boldsymbol x),J_i(\boldsymbol y)\}$ is not modified and coincides with  (\ref{rho-j}).

Using brackets (\ref{rho-rho},\ref{rho-j},\ref{j-j-mod}) it is straightforward to compute
\begin{align}
   &\Big\{J_i(\boldsymbol x),J_k(\boldsymbol y)\Big\}
   = \nonumber
   \\
   &\left[J_k(\boldsymbol x)\frac{\partial}{\partial x^i}-J_i(\boldsymbol y)\frac{\partial}{\partial y^k}\right]\delta(\boldsymbol x-\boldsymbol y)-(\epsilon_{ji}\delta_{lk}-\delta_{ji}\epsilon_{lk})
 \nonumber \\
    & \times\frac{\partial}{\partial x^j}\left[\big(\Gamma_H-\eta_H+\rho\eta_H'\big)(\boldsymbol x)\frac{\partial}{\partial x^l}\delta(\boldsymbol x-\boldsymbol y)\right].
 \label{diffeo-mod0}
\end{align}
One immediately notices that the condition (\ref{jacobi-cond}) annihilates the second term in the right hand side of Eq.~(\ref{diffeo-mod0}) and the algebra of brackets of $\rho$ and $J_i$ becomes identical to the original diffeomorphism algebra (\ref{rho-rho}-\ref{j-j}) thereby satisfying the Jacobi identity. Throughout the rest of the paper we will use $J_i$ to refer to the diffeomorphism generators.

In Appendix~\ref{sec:Jacobi-identity}, we perform more direct computation showing that the condition (\ref{jacobi-cond}) is also necessary for brackets (\ref{rho-rho},\ref{rho-j},\ref{j-j-mod}) to satisfy the Jacobi identity. The key point of that computation is that the Jacobiator (see Eq.~(\ref{EFG-Jacobi})) is given by
\begin{align}
    &\mathscr J\Big\{\text{\textctj}_i(x),\text{\textctj}_k(y),\text{\textctj}_m(z)\Big\}  = \nonumber
    \\
    &\left[\epsilon_{km}\frac{\partial}{\partial x_i}\frac{\partial}{\partial y_l}\frac{\partial}{\partial z_l}+\epsilon_{ik}\frac{\partial}{\partial x_l}\frac{\partial}{\partial y_l}\frac{\partial}{\partial z_m}+\epsilon_{mi}\frac{\partial}{\partial x_l}\frac{\partial}{\partial y_k}\frac{\partial}{\partial z_l}\right]
 \nonumber \\
    &\Big[2(\eta_H-\rho\eta_H'-\Gamma_H)\delta(\boldsymbol x -\boldsymbol y)\delta(\boldsymbol x -\boldsymbol z)\Big].
\end{align}
The Jacobiator $\mathscr J$  vanishes only when (\ref{jacobi-cond}) holds completing the proof of Statement~\ref{st2}.

We now discuss the physical picture behind the constraint (\ref{jacobi-cond}). The constraint can be rewritten as $\Gamma_H/\rho+\rho(\eta_H/\rho)'=0$. We consider the angular momentum per particle $\ell/\rho=\eta_H/\rho$ and notice that if it is itself $\rho$-independent, the constraint requires $\Gamma_H=0$. We see that if one compresses the fluid of rotating particles, no intrinsic torque is needed if the angular momentum of each particle does not depend on the particles' density. If $\eta_H(\rho)$ is nonlinear in $\rho$, the compression would require an additional torque applied to each particle. If (\ref{jacobi-cond}) is satisfied, this torque can be provided by the intrinsic torque $\Gamma_H$ of the fluid. If the condition (\ref{jacobi-cond}) is not met, additional ``constraint forces'' are needed rendering the system non-Hamiltonian.

\subsection{Conditions for Hamiltonian hydrodynamics}

For the first-order hydrodynamics defined by Eqs.~(\ref{eq:continuity}-\ref{eq:eta}) to be Hamiltonian the viscous stress coefficients in Eq.~(\ref{eq:eta}) must jointly satisfy Statement~\ref{st1} and Statement~\ref{st2}. Case 1 of Statement~\ref{st1} defines a Hamiltonian system as long as $\Gamma_H=-\zeta_H=\eta_H(\rho)-\rho\,\eta'_H(\rho)$. For the Case 2, the Jacobi identity constraint is incompatible with the energy conservation condition unless $c=0$. We summarize these findings in the following statement.
\begin{statement}
 \label{st3}
The hydrodynamics Eqs.~(\ref{eq:continuity}-\ref{eq:eta}) is Hamiltonian only in the following cases\\
Case 1: For arbitrary $\eta_H(\rho)$, $G=0$, and
    $$\Gamma_H(\rho)=-\zeta_H(\rho)=\eta_H(\rho)-\rho\,\eta'_H(\rho)\,.$$
Case 2: For arbitrary $G(\rho)$ and
    $$\zeta_H(\rho)=-\rho G'(\rho)\,,\quad\Gamma_H(\rho)=\eta_H(\rho)=0\,.$$
\end{statement}

Furthermore, Case 2 itself comes with a corollary.
\begin{corollary}
\label{corollary}
If the momentum density satisfies the diffeomorphism algebra~(\ref{j-j}) the only allowed viscosity term in the Hamiltonian is the odd pressure term $\zeta_H$.
\end{corollary}

In both cases, the hydrodynamic equations are obtained from the Hamiltonian~(\ref{H2}) and the Poisson brackets~(\ref{rho-rho},\ref{rho-j}) and (\ref{j-j-mod}), with the viscosity coefficients satisfying one of the conditions in the Statement~\ref{st3}. Note that the Hamiltonian function for Case 1 has the same form as the inviscid Hamiltonian~(\ref{H0}). In addition to that, we would like to emphasize that the Hamiltonian hydrodynamics corresponding to Case 1 could be equivalently written in terms of the diffeomorphism generator $J_i$ defined in~(\ref{mod-j}). In these new variables, the Poisson algebra becomes the EDA and the equation of motion for the ``modified momentum density" $J_i$ posses higher-order derivative terms and no odd viscosity stress (only odd pressure).
This was already pointed out in several references, such as~\cite{lingam2015hall,abanov2019hydro,markovich2020odd} for the particular case of $\Gamma_H=0$. When $\Gamma_H=0$, the Jacobi identity condition~(\ref{jacobi-cond}) imposes that $\eta_H(\rho)=\nu_o\rho$, where $\nu_o$ is a constant kinematic odd viscosity. In fact, in the Ref.~\cite{markovich2020odd}, the authors identify the generators of diffeomorphism $J_i$ to the ``molecular'' center-of-mass momentum density.

For Case 2, the Hamiltonian is different from that of the inviscid case and can be written as
\begin{align}
    H &= \int\left[\frac{\text{\textctj}_i^2}{2\rho}+\varepsilon+\frac{\text{\textctj}_i}{\rho}\partial_i^*G\right]d^2x\,.
 \label{H32}
\end{align}
However, the Poisson brackets remain the same as in the inviscid zeroth-order hydrodynamics, i.e., EDA given by (\ref{rho-rho},\ref{rho-j},\ref{j-j}). In this case the full stress tensor is explicitly given by
\begin{align}
    T_{ij} &= -\Big(p+\rho G'\omega\Big)\delta_{ij}\,,
 \label{stress-odd-pressure}
\end{align}
which proves the Corollary~\ref{corollary}.

\subsection{Generalized Hamiltonian hydrodynamics}
 \label{sec:cscheme}

In the previous sections, we showed that the Hamiltonian structure is intimately related to the existence of hydrodynamic variables $\rho$ and $J_i$, which satisfy the EDA. This way, we can easily generalize our results and propose the most general Hamiltonian hydrodynamics within an appropriate counting scheme.

It is not hard to see that the Poisson algebra~(\ref{rho-rho},\ref{rho-j},\ref{j-j}) is invariant under the scaling
\begin{equation}
\text{\textctj}_i\rightarrow\alpha \text{\textctj}_i\,,\qquad\partial_i\rightarrow \alpha\partial_i\,,\qquad\rho\rightarrow\rho\,. \label{scaling}
\end{equation}
Hence, the diffeomorphism generators $J_i$, defined in Eq.~(\ref{mod-j}) also scales as $J_i\rightarrow\alpha J_i$.
This new counting scheme differs from the original derivative expansion of the stress tensor. Under this scaling, first-order hydrodynamic terms, such as viscous terms in the stress tensor, show up in the same order as the following second-order hydrodynamic terms
\[
\tau_{ijkl}(\rho)\,\partial_k\rho\,\partial_l\rho+\sigma_{ijkl}(\rho)\,\partial_k\partial_l\rho\,.
\]
In the following, we refer to them as Madelung terms~\footnote{These terms generalize the ``quantum pressure'' arising from the Madelung transformations in Schr{\"o}dinger equation.}.

Note that Eq.~(\ref{scaling}) together with the continuity equation impose that $\partial_t$ must be of order $\alpha^2$. The scaling~(\ref{scaling}) is similar to the one used for energy conservation in Appendix~\ref{app:energycons} and gives us that the energy density of the fluid must scale in the same way as the fluid stress tensor. Thus, within this counting scheme, the most general Hamiltonian dynamics is given by the following simple prescription. Let us first take the most general Hamiltonian of the second order in $\alpha$, that is,
\begin{align}
    H &= \int\left[\frac{J_i^2}{2\rho}+\varepsilon+\frac{J_i}{\rho}\partial_i^*\mathscr G + \frac{1}{2\rho} (\partial_i K)^2\right]d^2x\,,
 \label{H40}
\end{align}
where $J_i$ is the diffeomorphism generator, $\mathscr G$ and $K$ are arbitrary functions of $\rho$. Let us assume conventional EDA brackets (\ref{rho-rho}-\ref{j-j}) and generate equations of motion for $\rho$ and $J_i$. The equation for $\rho$ is the standard continuity equation
\begin{equation}
    \partial_t\rho+\partial_iJ_i=0\,,
\end{equation}
while the one for $J_i$ is
\begin{equation}
    \partial_tJ_k+\partial_i\left(\frac{J_iJ_k}{\rho}-T_{ik}\right)=0\,,
\end{equation}
with
\begin{align}
    T_{ij} &= -\frac{1}{\rho}\partial_i K\partial_j K-\left[p+\rho\, \mathscr G'\partial_k\Big(\frac{J_k^*}{\rho}\Big) -K'\Delta K\right]\delta_{ij}\,.
 \label{stress-gen}
\end{align}
Once again, pressure is given by (\ref{eq:pressure}). In this form the only viscous term present is the odd pressure term with $\zeta_H=-\rho \mathscr G'$ and primes denote derivatives with respect to $\rho$.

Let us now shift the momentum density according to (\ref{mod-j}), i.e., $J_i= \text{\textctj}_i+\partial_i^*\eta_H$,
where $\eta_H(\rho)$ is an arbitrary function of $\rho$. As a result, we obtain the hydrodynamic system in terms of these new variables~\footnote{There is a certain ambiguity in the form of the stress tensor resulting from the freedom to add to the stress arbitrary divergenceless terms. These additions, however, do not change the equations of motion.}, that is,
\begin{align}
    \partial_t\rho+\partial_i\text{\textctj}_i&=0\,,
    \\
    \partial_t\text{\textctj}_k+\partial_i\left(\frac{\text{\textctj}_i\text{\textctj}_k}{\rho}-T_{ik}^H\right)&=0\,,
\end{align}
where the new stress tensor $T_{ij}^H$ is given by
\begin{equation}
    T_{ij}^H = \eta_{ijkl}^H\partial_k\Big(\frac{\text{\textctj}_l}{\rho}\Big) -\frac{A}{\rho}\partial_i\rho\,\partial_j\rho -\delta_{ij}\Big[p-B (\nabla\rho)^2-C\Delta\rho\Big],
 \label{stress-gen-shift}
\end{equation}
with
\begin{align}
    \zeta_H &= -\eta_H-\rho \mathscr G'\,, \qquad \Gamma_H=\eta_H-\rho\eta_H'\,,
 \label{hall-gen-1}\\
    A &= K'^2-{\eta_H'}^2\,,\quad C= A+ \eta_H'(\mathscr G'+\eta_H')\,,
\label{hall-gen-2} \\
    B &= \frac{1}{2}A'+(\mathscr G'+\eta_H')\left(\eta_H''-\frac{\eta_H'}{\rho}\right)\,. \label{hall-gen-3}
\end{align}

We notice that the modified stress tensor's parity-breaking part is generally defined by two independent functions $\eta_H(\rho)$ and $\mathscr G(\rho)$. An additional free function $K(\rho)$ contributes to Madelung terms. The expressions~(\ref{hall-gen-1}-\ref{hall-gen-3}) are the most general relations on parity-odd coefficients compatible with Hamiltonian hydrodynamics. If by some reason one requires that Madelung term vanish one obtains $K=\pm \eta_H$ and $(\mathscr G'+\eta_H')\eta_H'=0$. The latter equation has two solutions $\mathscr G=-\eta_H$ or $\eta_H=0$. These two solutions give Cases 1 and 2 of the Statement~\ref{st3}, respectively.It is interesting to note that the odd viscosity term $\eta_H$ appears in this construction not as a parameter of the Hamiltonian (\ref{H40}) but as the parameter of the momentum density shift or equivalently as a modification of Poisson's brackets.

We remark here that it is relatively straightforward to generate all Hamiltonian systems. One can start with a general local form of the Hamiltonian (\ref{H40}), generate equations using (\ref{rho-rho}-\ref{j-j}) and then consider redefinitions of hydrodynamic fields (\ref{mod-j}) preserving the structure of equations of motion. However, this procedure is based on the assumption that there are no non-trivial extensions of the EDA within the order in derivatives used in this work. {\it A priori} one might have a non-trivial extension of Poisson algebra similar to the central extensions considered in \cite{janssens2015central}.  The authors are not aware of the theorem on the absence of such extensions, and one should consider the computations done in Appendix~\ref{sec:Jacobi-identity} as an explicit proof of such a theorem within our counting scheme.

\section{Energy conservation and nonholonomic constraints}
 \label{sec:nonhol}

The absence of Hamiltonian structure in energy-conserving systems is one of the prominent features of so-called nonholonomic systems. These systems are described as systems with restrictions on types of motion. Typical examples include systems like rolling balls and rolling wheels as well as skates with rolling constraints and skating constraints, respectively \cite{bloch2003nonholonomic,arnold2007mathematical,goldstein2002classical}. In these systems, the constraints imposed on velocities are not integrable and, therefore, cannot be reduced to the constraints on the configurational space of the dynamic system. Such constraints are called nonholonomic and are related to the break down of the Jacobi identity in the Hamiltonian framework~\cite{bloch2003nonholonomic, VanDerSchaft-1994}.

In this section, we consider the fluid dynamics described by Case 1 of Statement~\ref{st1}, but not satisfying the condition of Statement~\ref{st2}. We show that it arises from Hamiltonian fluid dynamics with internal angular momentum degree of freedom subject to a nonholonomic constraint. The constraint pins the internal angular momentum density to the function of the density of the fluid, preserving energy conservation but breaking the Hamiltonian structure.

Let us consider the following Hamiltonian
\begin{equation}
    H_\lambda=\int d^2x\left[\frac{\text{\textctj}_i^2}{2\rho}+\varepsilon(\rho)+\lambda\left(\ell+2\eta_H(\rho)\right)^2\right]\,.
 \label{H-lambda}
\end{equation}
This Hamiltonian is a functional of hydrodynamic fields $\rho$ and $\text{\textctj}_i$ as well as of the new field $\ell$, which corresponds to the internal angular momentum density of the fluid. The numerical constant $\lambda>0$ couples the internal angular momentum density to a function of the density of the fluid $\eta_H(\rho)$. For large $\lambda$, it is energetically favorable for the system to have $\ell\approx-2\eta_H$.

Let us assume that the fields obey the Lie-Poisson algebra given by the brackets
\begin{align}
    &\{\rho(\boldsymbol x),\rho(\boldsymbol y)\}=\{\ell(\boldsymbol x),\rho(\boldsymbol y)\}=\{\ell(\boldsymbol x),\ell(\boldsymbol y)\}=0,
 \label{rho-rho-100}\\
    &\{\rho(\boldsymbol x), \text{\textctj}_i(\boldsymbol y)\}=-\rho(\boldsymbol y)\frac{\partial}{\partial y^i}\delta(\boldsymbol x-\boldsymbol y)\,,
 \label{rho-j-100}\\
    &\{\ell(\boldsymbol x), \text{\textctj}_i(\boldsymbol y)\}=\Big[2\Gamma_H(\rho(\boldsymbol x))\frac{\partial}{\partial x^i}-\ell(\boldsymbol y)\frac{\partial}{\partial y^i}\Big]\delta(\boldsymbol x-\boldsymbol y)\,,
 \label{l-j-100}\\
   &\left\{\text{\textctj}_i(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\right\}
   = \left[\text{\textctj}_k(\boldsymbol x)\frac{\partial}{\partial x^i}-\text{\textctj}_i(\boldsymbol y)\frac{\partial}{\partial y^k}\right]\delta(\boldsymbol x-\boldsymbol y)
 \nonumber \\
    &+ (\epsilon_{ik}\delta_{jl}+\delta_{ik}\epsilon_{jl}) \frac{\partial}{\partial x^j}\left[\frac{\ell(\boldsymbol x)}{2}\frac{\partial}{\partial x^l}\delta(\boldsymbol x-\boldsymbol y)\right]
 \nonumber \\
    &- (\delta_{ij}\epsilon_{kl}-\epsilon_{ij}\delta_{kl}) \frac{\partial}{\partial x^j}\left[\Gamma_H(\rho(\boldsymbol x))\frac{\partial}{\partial x^l}\delta(\boldsymbol x-\boldsymbol y)\right] \,.
 \label{j-j-100}
\end{align}
One can check that these brackets do satisfy the Jacobi identity. In fact, this is true by construction, since the brackets involving $\ell$ were derived from replacing $\eta_H$ by the new variable $-\tfrac{1}{2}\ell$ in Eqs.~(\ref{eta-rho}, \ref{eta-j}). Furthermore, we can recover the conventional EDA presented in~\cite{lingam2015hall,markovich2020odd} if we rewrite this algebra in terms of the quantities $J_i,\rho,L$, which are defined by
 \begin{align}
   J_i&=\text{\textctj}_i-\tfrac{1}{2}\partial_i^*\ell\,,
   \\
   L&=\ell+M\,,
 \end{align}
 with
 \begin{equation}
   \Gamma_H=\tfrac{1}{2}(M-\rho M')\,.
 \end{equation}

The Hamiltonian (\ref{H-lambda}) with these brackets define a Hamiltonian fluid dynamics, whose equations of motion are given by
\begin{align}
    &\partial_t\rho +\partial_i(\rho v_i) =0\,,
 \label{cont-100}\\
    &\partial_t\ell+\partial_i\left(\ell v_i\right) =-2\Gamma_H\,\partial_iv_i,
 \label{l-lambda} \\
    &\partial_t\text{\textctj}_j +\partial_i\left(\rho v_i v_j+\tilde p\,\delta_{ij}\right) = \partial_i\Big[\eta_{ijkl}^\ell\partial_kv_l\Big] \,,
 \label{j-lambda} \\
    &\eta_{ijkl}^\ell =-\tfrac{1}{2}\ell\,(\delta_{ik}\epsilon_{jl}+\delta_{jl}\epsilon_{ik})  +\Gamma_H\,(\delta_{ij}\epsilon_{kl}-\epsilon_{ij}\delta_{kl}) \,,
 \label{eta-l}\\
    &\tilde p = \rho\varepsilon'-\varepsilon +\lambda(\delta\ell)^2 -4\lambda(\eta_H-\rho\eta_H'-\Gamma_H)\delta\ell\,.
 \label{p-l}
\end{align}
Here we introduced the notation $\delta\ell=\ell+2\eta_H$ and $v_i=\text{\textctj}_i/\rho$. Notice that the form of the viscous tensor~(\ref{eta-l}) is identical to (\ref{eta-bar}) with the replacement $\ell\to -2\eta_H$.

It is important to understand that the dynamical system (\ref{cont-100}-\ref{p-l}) is Hamiltonian for any value of the parameter $\lambda$ as it is generated by the Hamiltonian (\ref{H-lambda}) with the use of Poisson brackets (\ref{rho-rho-100}-\ref{j-j-100}). It is clear that, at finite energy, the intrinsic angular momentum $\ell$ should follow $-2\eta_H(\rho)$, in the limit $\lambda\to \infty$. However, from (\ref{cont-100},\ref{l-lambda}) we obtain that
\begin{align}
    \partial_t(\delta\ell) +\partial_i(\delta\ell\,v_i) &=-2 (\Gamma_H-\eta_H+\rho\eta_H')\partial_i v_i\,.
 \label{leta-evolution}
\end{align}
If the condition (\ref{jacobi-cond}) is satisfied, the right hand side of (\ref{leta-evolution}) vanishes. In this case one can start with initial conditions $\ell=-2\eta_H(\rho)$ and the dynamics (\ref{leta-evolution}) will preserve these conditions at all times. The constraint
\begin{align}
    -\tfrac{1}{2}\ell =\eta_H(\rho)
 \label{l-eta-constraint}
\end{align}
in this case is the first-class constraint~\cite{dirac2001lectures} and the substitution of $\ell=-2\eta_H(\rho)$ in all brackets, Hamiltonian and equations is consistent and produces the Hamiltonian dynamics of $\rho$ and $\text{\textctj}_i$ specified in the Statement~\ref{st3}, Case 1.

Let us assume now that (\ref{jacobi-cond}) does not hold. In this case, imposing the constraint~(\ref{l-eta-constraint}) cannot be reduced to just a choice of initial conditions. Choosing initial conditions satisfying $\ell=-2\eta_H$ we find that, for large but finite $\lambda$, $\ell$ will deviate from $-2\eta_H$ in time, due to~(\ref{leta-evolution}). However, this deviation creates a large pressure term~(\ref{p-l}) proportional to $\lambda$ which will lead the flow to be incompressible, that is, $\partial_iv_i=0$.
Consequently, the right hand side of Eq.~(\ref{leta-evolution}) vanishes, making sure that $\ell\approx -2\eta_H$. The limiting solution at $\lambda\to \infty$ will satisfy the constraint~(\ref{l-eta-constraint}) at all times, however it constrains the flow to be incompressible. In other words, in the absence of the restriction~(\ref{jacobi-cond}), the time evolution of the constraint (\ref{l-eta-constraint}) gives rise to incompressibility, which is a second-class constraint~\cite{dirac2001lectures}. The system with both constraints, that is, Eq.~(\ref{l-eta-constraint}) together with $\partial_iv_i=0$, can be written from a Hamiltonian principle by working out the Dirac brackets of the system~\cite{dirac2001lectures}, which will turn out to be non-local. If, on the other hand, we insist in imposing only the constraint~(\ref{l-eta-constraint}), without the incompressibility condition, i.e., neglecting Eq.~(\ref{leta-evolution}), we end up with a \textbf{nonholonomic} constraint. This can be directly observed, if we substitute $\ell$ by $-2\eta_H(\rho)$ in the Poisson bracket~(\ref{l-j-100}). This replacement is inconsistent to Eq.~(\ref{rho-j-100}).

In the following, we explore a possible origin of energy-conserving but non-Hamiltonian fluid dynamics as coming from Hamiltonian systems with additional degrees of freedom through dynamical nonholonomic constraints. The problem of realizing nonholonomic constraints has been considered in the context of dynamical systems. The realization of constraints is not always unique and might result in different equations of motion. We refer the reader to the original article \cite{kozlov1992problem} and reviews \cite{arnold2007mathematical,bloch2003nonholonomic}. The discussion here is heuristic and is closely related to the so-called vakonomic mechanics~\cite{Kozlov1983}.

Let us introduce a relaxation term proportional to $\delta\ell$ on the right hand side of Eq.~(\ref{l-lambda}), that is,
\begin{equation}
    \partial_t\ell+\partial_i(\ell v_i)=-2\Gamma_H\partial_iv_i-\gamma \lambda(\delta\ell)\,,
 \label{l-diss}
\end{equation}
with $\gamma>0$. The energy equation acquires a dissipative term
\begin{equation}
\partial_t\mathscr E+\partial_iQ_i=-\gamma \lambda^2 (\delta \ell)^2\,. \label{energy-lambda}
\end{equation}
This regularization procedure allows us to take the limit $\lambda\rightarrow\infty$ without imposing the incompressibility condition. Solving Eq.~(\ref{l-diss}) in powers of $1/\lambda$ gives us
\begin{equation}
    \ell=-2\eta_H-\frac{2}{\gamma\lambda}(\Gamma_H-\eta_H+\rho\eta_H')\,\partial_i v_i+ O(\lambda^{-2})\,.
\end{equation}
Plugging this expression back in the Eqs.~(\ref{j-lambda}-\ref{p-l}), we obtain the regularized stress tensor
\begin{equation}
    T_{ij}=(-p+\zeta\,\partial_kv_k)\delta_{ij}+\bar\eta_{ijkl}\partial_k v_l\,, \label{stress-gamma}
\end{equation}
with the bulk viscosity given by
\begin{equation}
    \zeta=\frac{8}{\gamma}(\Gamma_H-\eta_H+\rho\eta_H')^2\,.
 \label{bulk}
\end{equation}

The intrinsic angular momentum relaxation introduces a bulk viscosity in the system and spoils the energy conservation.  With the dissipative regularization (\ref{l-diss}) the limit $\lambda\rightarrow\infty$ can be taken. The energy equation (\ref{energy-lambda}) in this limit becomes
\begin{equation}
    \partial_t\mathscr E+\partial_iQ_i=-\zeta (\partial_iv_i)^2\,,
\end{equation}
where the bulk viscosity is given by Eq.~(\ref{bulk}). We observe that the limit $\lambda\to \infty$ produced a family of hydrodynamic equations characterized by the parameter $\gamma$ (compare with \cite{Kozlov1983, kozlov1992problem}). Within this family for $\gamma\rightarrow 0$, the bulk viscosity becomes infinite and forces the fluid to be incompressible. This way, we recover the Hamiltonian case with second-class constraints, discussed previously. In the opposite limit $\gamma\rightarrow\infty$, the bulk viscosity vanishes, and the system conserves energy, even though it cannot be written from a Hamiltonian principle.

\section{Discussion and conclusions}
 \label{sec:concl}

We considered a space of two-dimensional fluid dynamics with parity-breaking terms in the viscous stress tensor in this work. We started by identifying the subset of energy-conserving fluids within this space (Statement~\ref{st1}). Surprisingly, not all parity-odd viscosity coefficients lead to energy conservation in first-order hydrodynamics. For example, for a hydrodynamic system with $\eta_{ijkl}=\Gamma_H\epsilon_{ij}\delta_{kl}$, Eqs.~(\ref{eq:G}-\ref{eq:W3}) give us
\begin{equation}
    \partial_t\mathscr E+\partial_iQ_i =-\left[\left(\frac{\Gamma_H}{\rho^2}\right)'\Gamma_H(\partial_i\rho)^2 +\frac{\Gamma_H^2}{\rho^2}\Delta\rho\right]\partial_jv_j\,.
 \nonumber
\end{equation}
The right hand side can be either positive or negative, depending on the flow and the density distribution. Hydrodynamic systems which neither conserve energy nor are exclusively dissipative may be realized in active matter systems, where the driving is local. If, however, we insist on having both energy conservation and $(\eta_H, \Gamma_H, \zeta_H)$ being independent functions, we must allow for Madelung terms in the stress tensor, which is the subject of future work.
Some of the hydrodynamical systems considered in this work turn out to be energy-conserving but not Hamiltonian. An obstacle for the system to be Hamiltonian is that the brackets generating equations of motion fail to satisfy the Jacobi identity. We found that this condition amounts to (\ref{jacobi-cond}) defining what we might refer to as Hamiltonian fluids. We also observed that the bracket generating equations of Hamiltonian fluids could always be transformed to the conventional extended diffeomorphism algebra (EDA) (\ref{rho-rho}-\ref{j-j}) by changing hydrodynamic variables (Statement~\ref{st2}). In particular, if the momentum density satisfies the EDA, the only allowed viscosity term in the Hamiltonian dynamics is the odd pressure $\zeta_H$. The main results supporting the described structure of the space of theories are formulated as Statements~\ref{st1}-\ref{st3} with some details of derivations relegated to appendices.

The study of the space of parity-violating hydrodynamic equations in 2+1 dimensions have been done before both in relativistic \cite{jensen2012parity} and nonrelativistic \cite{kaminski2014nonrelativistic,lucas2014phenomenology} context. In this work, we focus on the Hamiltonian fluids. We use a nonrelativistic counting scheme, described in~\ref{sec:cscheme}, to make sure that there are only a finite number of terms in the stress tensor at any given order of the counting scheme. We find the most general Hamiltonian fluid dynamics within the second-order of that counting scheme. This dynamics is characterized by three independent functions of density. The stress tensor~(\ref{stress-gen-shift}) and the correspondent transport coefficients are given by Eqs~(\ref{hall-gen-1}-\ref{hall-gen-3}).

\begin{figure}
    \centering
    \includegraphics[scale=0.43]{Venn-diagram.pdf}
    \caption{The space of parity breaking barotropic Galilean fluids in two dimensions. In addition to the internal energy density $\varepsilon(\rho)$, the space is parametrized by viscosity coefficients that are considered to be arbitrary functions of density.}
 \label{fig:schematic}
\end{figure}

In Section~\ref{sec:nonhol}, we provided a possible origin of nonholonomic fluid dynamics as originating from fully Hamiltonian extended dynamics with nonholonomic constraints imposed on an additional degree of freedom. This additional degree of freedom, in our case, has a meaning of an intrinsic angular momentum density of the fluid. We introduced an energy cost term in the Hamiltonian (\ref{H-lambda}), such that, in the limit of infinite rigidity ($\lambda\to \infty$), the intrinsic angular momentum $(\ell)$ is pinned to the odd viscosity, $\eta_H(\rho)$. Solving for $\ell$, with a particular regularization procedure, we obtain an effective dissipative hydrodynamic system with the stress tensor given by Eqs.~(\ref{stress-gamma},\ref{bulk}). Therefore, ``integrating out'' the intrinsic angular momentum density provides us a one-parameter family $(\gamma)$ of a dissipative hydrodynamic system. Interestingly enough, we can recover the energy conservation for $\gamma\rightarrow0$ and $\gamma\rightarrow\infty$. In the former case, the hydrodynamic system is Hamiltonian and subjected to the incompressibility condition, i.e., $\partial_iv_i=0$. In the latter, we obtain an energy-conserving system, described in Case 1 of the Statement~\ref{st1}, yet not Hamiltonian, since it does not satisfy the condition of the Statement~\ref{st2}.

To conclude, if the stress tensor contains gradient terms, there are both Hamiltonian and energy-conserving nonholonomic fluids. We note that the stability analysis is very different for Hamiltonian and nonholonomic systems \cite{bloch2003nonholonomic}.  In particular, additional instabilities are expected to occur in nonholonomic systems realizable in active matter.

\section*{Acknowledgements}
We want to thank Tom Lubensky, Tomer Markovich,  and Boris Khesin for helpful discussions. We specially thank Boris Khesin for bringing  Ref.~\cite{janssens2015central} to our attention and Tomer Markovich for carefully reading and suggesting improvements to the manuscript.

\paragraph{Funding information}
This work is supported by NSF CAREER Grant No. DMR-1944967 (SG) and partly from PSC-CUNY Award. GMM was supported by 21st century foundation startup award from CCNY. This research was supported by grants NSF DMR-1606591 (AGA) and US DOE DESC-0017662 (AGA).

\begin{appendix}

\section{Conditions for energy conservation}
\label{app:energycons}

Let us consider Eqs.~(\ref{eq:continuity}-\ref{eq:eta}) and let us work out under which conditions this set of equations allows for a third conserved quantity, namely, energy conservation. One way to do so is to determine the most general form of the energy density and then match all the transport coefficients such that the energy density $\mathscr E$ satisfies Eq.~(\ref{energy-current}). To determine the form of $\mathscr E$, we need to study the symmetries of Eqs.~(\ref{eq:continuity}-\ref{eq:momentum}). The continuity equation
\[
\partial_t\rho+\partial_i(\rho v_i)=0\,,
\]
is invariant under the following scaling
\begin{align}
    x_i\rightarrow x_i/\alpha\,,\quad t\rightarrow t/\beta\,, \quad \text{and} \quad v_i\rightarrow v_i \beta/\alpha\,. \label{eq:v-scale}
\end{align}
Plugging this scaling into equation
\[
\partial_tv_j+v_i\partial_iv_j=\frac{1}{\rho}\partial_iT_{ij}=\frac{1}{\rho}\partial_i\left[-p(\rho)\,\delta_{ij}+\eta_{ijkl}(\rho)\,\partial_kv_l\right],
\]
and choosing that $\rho\rightarrow\rho$, we obtain
\begin{equation}
T_{ij}\rightarrow(\beta/\alpha)^2T_{ij}.
\end{equation}
This means that all viscosity coefficients scale as $\beta/\alpha^2$. Since they are only functions of $\rho$, they should have no scaling, which imposes that $\beta=\alpha^2$. Here, one could argue that pressure is also only a function of the density and, thus, should not scale. However, we must note that $p'(\rho)=c_s^2$, where $c_s$ is the sound velocity. Since $c_s$ scales as the velocity flow, we obtain that pressure must scale as $(\beta/\alpha)^2$. The scaling~(\ref{eq:v-scale}) with $\beta=\alpha^2$ fixes the form of energy density. Hence, the most general energy density of order $\alpha^2$, up to total derivatives, is given by
\begin{equation}
\mathscr E=\tfrac{1}{2}\rho v_i^2+\varepsilon(\rho)+F(\rho)\,\kappa+G(\rho)\,\omega+\tfrac{1}{2}W(\rho)\,(\partial_i\rho)^2\,, \label{eq:energy-dens}
\end{equation}
where $\omega=\partial_iv_i^*$ is the fluid vorticity, $\kappa=\partial_iv_i$ is the flow compressibility and the functions $F(\rho)$, $G(\rho)$ and $W(\rho)$ must be determined in terms of the viscosity coefficients. {\it Note that this counting scheme differs from the original derivative expansion and set Madelung terms, such as $\gamma_{ijkl}(\rho)\,\partial_k\rho\partial_l\rho+\sigma_{ijkl}(\rho)\,\partial_k\partial_l\rho$, to be of the same order as viscous terms.}. For the inviscid case the well-known conserved energy is recovered by setting $F=G=W=0$.

Taking the time derivative of Eq.~(\ref{eq:energy-dens}) give us
\begin{equation}
    \partial_t\mathscr E=-\partial_iQ_i+F'(\rho)\varepsilon''(\rho)(\partial_i\rho)^2+A_{ijkl}\,\partial_iv_j\partial_kv_l+B_{ijkl}\,\partial_i\rho\,\partial_j\rho\,\partial_kv_l+C_{ijkl}\,\partial_i\partial_j\rho\,\partial_kv_l\,,
\end{equation}
where
\begin{align}
    &Q_i=\mathscr E v_i+T_{ij}v_j-\frac{F\,\delta_{ik}+G\,\epsilon_{ik}}{\rho}\,\partial_jT_{jk}+\rho\kappa W\partial_i\rho-\frac{F'\,\delta_{jm}+G'\,\epsilon_{jm}}{\rho}\,\eta_{imkl}\,\partial_j\rho\,\partial_kv_l,
    \\
    &A_{ijkl}=-\eta_{ijkl}+\frac{F}{2}\epsilon_{ij}\epsilon_{kl}+\frac{F}{2}\left(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{jk}-\delta_{ij}\delta_{kl}\right)+\left(\frac{F}{2}-\rho F'\right)\delta_{ij}\delta_{kl}-\rho\, G'\delta_{ij}\epsilon_{kl}\,, \label{eq:A}
    \\
    &B_{ijkl}=\left(\frac{F'}{\rho}\delta_{jm}+\frac{G'}{\rho}\epsilon_{jm}\right)'\eta_{imkl}+\frac{\rho\,W'}{2}\delta_{ij}\delta_{kl}-\frac{W}{2}\left(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{ik}-\delta_{ij}\delta_{kl}\right),\label{eq:B}
    \\
    &C_{ijkl}=\left(\frac{F'}{\rho}\delta_{jm}+\frac{G'}{\rho}\epsilon_{jm}\right)\eta_{imkl}+\rho\, W\,\delta_{ij}\delta_{kl}\,. \label{eq:C}
\end{align}
The term $F'\varepsilon''(\partial_i\rho)^2$ is velocity independent and must vanish by itself for the energy to be conserved. This means that either $F'(\rho)=0$ or $\varepsilon''(\rho)=0$. However, the sound velocity on a fluid is given by
\[
c_s=\sqrt{\rho\varepsilon''(\rho)},
\]
which implies that $F'(\rho)$ must necessarily vanish to guarantee energy conservation. Since the energy density is only defined up to total derivatives, we obtain that
\begin{equation}
F(\rho)=0\,, \label{eq:F}
\end{equation}
which substantially simplifies Eqs.~(\ref{eq:A}-\ref{eq:C}).

The term $A_{ijkl}\,\partial_iv_j\,\partial_kv_l$ is a quadratic form and cannot be written as a total derivative unless $\Gamma=\zeta=-\eta=c_1$. However, as mentioned in the main text, we ignore this particular case, since it does not modify the equations of motion in flat space. Thus, $A_{ijkl}\,\partial_iv_j\,\partial_kv_l$ must necessarily vanish to ensure energy conservation. This is obtained when $A_{ijkl}=-A_{kl ij}$ and, after imposing Eq.~(\ref{eq:F}), we end up with
\begin{align}
&\eta(\rho)=\zeta(\rho)=\Gamma(\rho)=0\,, \label{eq:diss}
\\
&\zeta_H(\rho)+\Gamma_H(\rho)+\rho\, G'(\rho)=0\,. \label{eq:G}
\end{align}
Let us now turn our attention to the last two terms. They give us
\begin{align}
    &B_{ijkl}\,\partial_i\rho\,\partial_j\rho\,\partial_kv_l+C_{ijkl}\,\partial_i\partial_j\rho\,\partial_kv_l=\partial_i\left(\frac{\kappa\partial_i\rho-\partial_j\rho\,\partial_jv_i}{\rho}\,2\eta_HG'\right)+\left(\frac{\Gamma_H-\eta_H}{\rho}G'+\rho W\right)\kappa\Delta\rho\nonumber
    \\
    &+\left[\left(\frac{G'}{\rho}\right)'(\Gamma_H-\eta_H)-\frac{\eta_H'G'}{\rho}+\frac{\rho W'}{2}\right]\kappa\,(\partial_i\rho)^2+\left[\frac{\eta_H'G'}{\rho}-\frac{W}{2}\right]\partial_i\rho\,\partial_j\rho\,(\partial_iv_j+\partial_jv_i-\delta_{ij}\kappa)\,. \label{eq:BeC}
\end{align}
In order to write the right hand side of Eq.~(\ref{eq:BeC}) as a total derivative, we must impose that
\begin{align}
  \frac{\eta_H'G'}{\rho}-\frac{W}{2}&=0\,, \label{eq:W1}
  \\
  \frac{G'}{\rho}(\Gamma_H-\eta_H)+\rho W&=0\,, \label{eq:W2}
  \\
  \left(\frac{G'}{\rho}\right)'(\Gamma_H-\eta_H)-\frac{\eta_H'G'}{\rho}+\frac{\rho W'}{2}&=0\,. \label{eq:W3}
\end{align}
Equation~(\ref{eq:G}) allows us to express $G(\rho)$ in terms of $\zeta_H(\rho)$ and $\Gamma_H(\rho)$. This means that there are four variables $(\eta_H,\zeta_H,\Gamma_H,W)$ and 3 equations. Unless Eqs.~(\ref{eq:W1}-\ref{eq:W3}) are linearly dependent, there is no way to satisfy them for $\eta_H(\rho)$, $\zeta_H(\rho)$ and $\Gamma_H(\rho)$ independent. Plugging Eq.~(\ref{eq:W1}) into Eq.~(\ref{eq:W2}), we find that
\begin{equation}
\left(\Gamma_H-\eta_H+2\rho\eta_H'\right)G'=0\,. \label{G-constraint}
\end{equation}
This breaks into two possible cases, namely, $G'(\rho)=0$ or $G'(\rho)\neq0$.

\subsection{Case I: $G'(\rho)=0$}

Let us first consider the case when $G'(\rho)=0$. Plugging this into Eq.~(\ref{eq:W1}) gives us $W=0$, which is consistent with Eq.~(\ref{eq:W3}). From Eq.~(\ref{eq:G}), we see that this case is simply the condition
\begin{equation}
\zeta_H(\rho)=-\Gamma_H(\rho)
\end{equation}
or equivalently
\begin{equation}
\eta_{ijkl}(\rho)=\bar\eta_{ijkl}(\rho),
\end{equation}
where $\bar\eta_{ijkl}$ is defined in Eq.~(\ref{eta-bar}).

\subsection{Case II: $G'(\rho)\neq0$}

In this case, Eq.~(\ref{G-constraint}) imposes that
\begin{equation}
\Gamma_H(\rho)-\eta_H(\rho)+2\rho\eta_H'(\rho)=0\,.
\end{equation}
and Eq.~(\ref{eq:W3}) can be written solely in terms of $G'(\rho)$ and $\eta_H(\rho)$. Plugging Eq.~(\ref{eq:W1}) into Eq.~(\ref{eq:W3}) and expressing $\Gamma_H(\rho)$ in term of $\eta_H(\rho)$ gives us
\begin{equation}
\eta_H'(\rho)G''(\rho)-\eta_H''(\rho) G'(\rho)=0\,. \label{eq:G-etaH}
\end{equation}

Note that $G'(\rho)\neq0$, otherwise we recover the case I. Therefore, we can express $\eta_H'(\rho)$ in terms of $G'(\rho)$. This gives us
\begin{equation}
\eta'_H(\rho)=c\,G'(\rho), \label{eq:G-etaH-C}
\end{equation}
for a constant $c$. Hence, we obtain
\begin{align}
    \eta_H(\rho)&=c\,G(\rho)+c_2,
    \\
    \Gamma_H(\rho)&=c\left[G(\rho)-2\rho\,G'(\rho)\right]+c_2,
    \\
    \zeta_H(\rho)&=-c\,G(\rho)+(2c-1)\rho\,G'(\rho)-c_2,
    \\
    W(\rho)&=\frac{2c}{\rho}\Big(G'(\rho)\Big)^2.
\end{align}
for a generic function $G(\rho)$ and some constant $c_2$. However, if we focus on the stress tensor, we see that
\begin{align}
T_{ij}=&-\left[p(\rho)+(2c-1)\rho\, G'(\rho)\,\omega\right]\delta_{ij}-2\,c\rho\,G'(\rho)\,\kappa\,\epsilon_{ij}\nonumber
\\
&+\left[c\,G(\rho)+c_2\right]\epsilon_{ik}\,\partial_kv_j\,.
\end{align}
The constant $c_2$ in the last term does not contribute to equations of motion and we can set it to zero without loss of generality. Moreover, when $c=0$, only odd pressure is present and the stress tensor becomes diagonal.

\section{Condition to satisfy the Jacobi identity}
 \label{sec:Jacobi-identity}

For the system to be Hamiltonian, the algebra defined through expressions~(\ref{rho-rho}), (\ref{rho-j}), and (\ref{j-j-mod}) must satisfy the Jacobi identity. Let us define
\begin{equation}
F_A=\int\left(f_A\,\rho+\text{\textctj}_i\,\xi^i_A\right)d^2x\,,
\end{equation}
for some test functions $f_A$, $\xi_A^1$ and $\xi^2_B$. In this notation, Jacobi identity can be written as
\begin{equation}
\epsilon^{ABC}\{\{F_A,F_B\},F_C\}=0. \label{Jacobi}
\end{equation}

Using equation~(\ref{rho-rho}), we find that the brackets between $F_A$ and $F_B$ is given by
\begin{align}
\{F_A,F_B\}&=\iint d^2x\,d^2y\left[\left(f_A(\boldsymbol x)\,\xi^i_B(\boldsymbol y)-f_B(\boldsymbol x)\xi^i_A(\boldsymbol y)\right)\{\rho(\boldsymbol x),\text{\textctj}_i(\boldsymbol y)\}+\xi_A^i(\boldsymbol x)\xi_B^k(\boldsymbol y)\{\text{\textctj}_i(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\}\right],\nonumber
\\
\{F_A,F_B\}&=\int d^2x\left[\rho\left(\xi_A^i\partial_if_B-\xi_B^i\partial_if_A\right)+\text{\textctj}_i\left(\xi_A^k\partial_k\xi_B^i-\xi_B^k\partial_k\xi_A^i\right)+\bar\eta_{ji\ell k}\,\partial^j\xi_A^i\partial^\ell\xi_B^k\right]. \label{FA-FB}
\end{align}
Plugging the expression~(\ref{FA-FB}) into equation~(\ref{Jacobi}), we find
\begin{align}
   &\epsilon^{ABC}\{\{F_A,F_B\},F_C\}=\epsilon^{ABC}\iint d^2x\,d^2y\left[2\left(\xi_C^i(\boldsymbol y)\xi_A^k(\boldsymbol x)\frac{\partial f_B}{\partial x^k}(\boldsymbol x)-f_C(\boldsymbol x)\xi_A^k(\boldsymbol y)\frac{\partial \xi^i_B}{\partial x^k}(\boldsymbol x)\right)\right.\nonumber
   \\
   &\times\{\rho(\boldsymbol x),\text{\textctj}_i(\boldsymbol y)\}+2\xi_C^k(\boldsymbol x)\xi_A^\ell(\boldsymbol y)\frac{\partial \xi^i_B}{\partial x^\ell}(\boldsymbol x)\{\text{\textctj}_i(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\}+f_C(\boldsymbol y)\frac{\partial \xi^i_A}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_B}{\partial x_\ell}(\boldsymbol x)\{\bar\eta_{ji\ell k}(\boldsymbol x),\rho(\boldsymbol y)\} \nonumber
   \\
   &+\left.\xi_C^m(\boldsymbol y)\frac{\partial \xi^i_A}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_B}{\partial x_\ell}(\boldsymbol x)\{\bar\eta_{ji\ell k}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]. \label{FA-FB-FC}
\end{align}
Note that there are two types of terms in equation~(\ref{FA-FB-FC}), i.e., some of them depend on 3 vectors $(\xi_A,\xi_B,\xi_C)$, whereas the others depend on 2 vectors $(\xi_A,\xi_B)$ and one function $f_C$. Since they are independent, each type of term must vanish separately. Let us now focus on terms with 2 vectors $(\xi_A,\xi_B)$ and one function $f_C$. The Jacobi identity imposes that
\begin{align}
    &\epsilon^{ABC}\int d^2x\left[2\rho(\boldsymbol x)\xi_A^i(\boldsymbol x)\xi_B^k\frac{\partial^2 f_C}{\partial x^i\partial x^k}(\boldsymbol x)- \frac{\partial \xi^i_A}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_B}{\partial x_\ell}(\boldsymbol x)\int d^2y f_C(\boldsymbol y)\{\bar\eta_{ji\ell k}(\boldsymbol x),\rho(\boldsymbol y)\}\right]=0\,,\nonumber
    \\
    &\epsilon^{ABC}\iint d^2x\, d^2y\,\frac{\partial \xi^i_A}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_B}{\partial x_\ell}(\boldsymbol x)f_C(\boldsymbol y)\{\bar\eta_{ji\ell k}(\boldsymbol x),\rho(\boldsymbol y)\}=0\,, \label{Jacobi-f}
\end{align}
where in the second line we used that $\epsilon^{ABC}\xi_A^i\xi^k_B$ is antisymmetric in the indices $(i,k)$. Equation~(\ref{Jacobi-f}) imposes that
\begin{equation}
\{\bar\eta_{ji\ell k}(\boldsymbol x),\rho(\boldsymbol y)\}=0\,, \label{eta-rho}
\end{equation}
which is automatically satisfied when the components $\bar\eta_{ijk\ell}$ are functions solely of $\rho$.

Let us now turn our attention to terms in equation~(\ref{FA-FB-FC}) with 3 vectors $(\xi_A,\xi_B,\xi_C)$,
\begin{align}
    & \epsilon^{ABC}\int d^2x\left[2\,\bar\eta_{ji \ell k}(\boldsymbol x)\frac{\partial\xi_C^k}{\partial x_\ell}(\boldsymbol x)\frac{\partial}{\partial x_j}\left(\xi^m_A\frac{\partial\xi_B^i}{\partial x^m}\right)(\boldsymbol x)-2\text{\textctj}_i(\boldsymbol x)\xi^k_A(\boldsymbol x)\xi_B^j(\boldsymbol x)\frac{\partial^2 \xi^i_C}{\partial x^k\partial x^j}(\boldsymbol x)\right.\nonumber
     \\
     &\left.+\int d^2y\,\xi_C^m(\boldsymbol y)\frac{\partial \xi^i_A}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_B}{\partial x_\ell}(\boldsymbol x)\{\bar\eta_{ji\ell k}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]=0\,,\nonumber
     \\
    & \epsilon^{ABC}\int d^2x\left[\bar\eta_{ji \ell k}(\boldsymbol x)\left(\xi^m_A(\boldsymbol x)\frac{\partial}{\partial x^m}\left(\frac{\partial\xi_B^i}{\partial x_j}\frac{\partial\xi_C^k}{\partial x_\ell}\right)(\boldsymbol x)+2\frac{\partial\xi_A^m}{\partial x_j}(\boldsymbol x)\frac{\partial\xi_B^i}{\partial x^m}(\boldsymbol x)\frac{\partial\xi_C^k}{\partial x_\ell}(\boldsymbol x)\right)\right. \nonumber
     \\
     &\left.+\int d^2y\,\xi_C^m(\boldsymbol y)\frac{\partial \xi^i_A}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_B}{\partial x_\ell}(\boldsymbol x)\{\bar\eta_{ji\ell k}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]=0\,,\label{Jacobi-xi}
\end{align}
In the third line, we used one more time that $\epsilon^{ABC}\xi_A^k\xi^j_B$ is antisymmetric in the indices $(k,j)$ and that
\[
\epsilon^{ABC}\bar\eta_{ji \ell k}\partial_m\left(\partial^j\xi_B^i\partial^\ell\xi_C^k\right)=\epsilon^{ABC}(\bar\eta_{ji \ell k}-\bar\eta_{ijk\ell})\partial^\ell\xi_C^k\,\partial_m\partial^j\xi_B^i=2\epsilon^{ABC}\bar\eta_{ji \ell k}\partial^\ell\xi_C^k\,\partial_m\partial^j\xi_B^i\,.
\]

Integrating equation~(\ref{Jacobi-xi}) by parts give us
\begin{align}
 &  \epsilon^{ABC}\int d^2x\left[2 \bar\eta_{ji \ell k}(\boldsymbol x)\frac{\partial\xi_A^m}{\partial x_j}(\boldsymbol x)\frac{\partial\xi_B^i}{\partial x^m}(\boldsymbol x)\frac{\partial\xi_C^k}{\partial x_\ell}(\boldsymbol x)- \frac{\partial\xi_B^i}{\partial x_j}(\boldsymbol x)\frac{\partial\xi_C^k}{\partial x_\ell}(\boldsymbol x)\frac{\partial}{\partial x^m}\left(\xi_A^m\,\bar\eta_{ji\ell k}\right)(\boldsymbol x)\right. \nonumber
   \\
   &\left.+\int d^2y\,\xi_A^m(\boldsymbol y)\frac{\partial \xi^i_B}{\partial x_j}(\boldsymbol x)\frac{\partial \xi^k_C}{\partial x_\ell}(\boldsymbol x)\{\bar\eta_{ji\ell k}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]=0\,. \label{eta-j-allD}
\end{align}
Note that equation~(\ref{eta-j-allD}) is valid for any spatial dimensions, since we still have not used the 2-dimensional form of $\bar\eta_{ijk\ell}$. Moreover, if the stress tensor is symmetric, $\bar\eta_{ijk\ell}=\bar\eta_{jik\ell}$ and the first term vanishes identically. Let us now focus on the first term in~(\ref{eta-j-allD}). Hence,
\[
2\epsilon^{ABC} \bar\eta_{ji \ell k}\partial^j\xi_A^m\partial_m\xi_B^i\partial^\ell\xi_C^k=\epsilon^{ABC} \bar\eta_{ji \ell k}\epsilon^{ji}\epsilon_{nr}\partial^n\xi_A^m\partial_m\xi_B^r\partial^\ell\xi_C^k=2\Gamma_H\epsilon_{jk}\delta_{i\ell}\partial^j\xi_A^i\partial^\ell\xi_B^k\partial_m\xi_C^m\,,
\]
and equation~(\ref{eta-j-allD}) becomes
\begin{align}
  &  \epsilon^{ABC}\int d^2x\frac{\partial\xi_B^i}{\partial x_j}(\boldsymbol x)\frac{\partial\xi_C^k}{\partial x_\ell}(\boldsymbol x)\left[\Big( \Gamma_H(\boldsymbol x)(\epsilon_{jk}\delta_{i\ell}+\delta_{jk}\epsilon_{i\ell})- \bar\eta_{ji \ell k}(\boldsymbol x)\Big)\frac{\partial\xi_A^m}{\partial x^m}(\boldsymbol x)- \xi_A^m(\boldsymbol x)\frac{\partial \bar\eta_{ji\ell k}}{\partial x^m}(\boldsymbol x) \right.
 \nonumber \\
    &\left.+\int d^2y\,\xi_A^m(\boldsymbol y)\{\bar\eta_{ji\ell k}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]=0\,.
\end{align}
However, using that $\epsilon^{ABC}\partial_i\xi_A^i\partial_j\xi_B^j=0$, together with
\[
\epsilon_{jk}\delta_{i\ell}+\delta_{jk}\epsilon_{i\ell}=\epsilon_{j\ell}\delta_{ik}+\delta_{j\ell}\epsilon_{ik}\,,
\]
we obtain
\begin{align}
&  \epsilon^{ABC}\int d^2x\frac{\partial\xi_B^i}{\partial x_j}(\boldsymbol x)\frac{\partial\xi_C^k}{\partial x_\ell}(\boldsymbol x)\left[\Big(\epsilon_{j\ell}\delta_{ik}+\delta_{j\ell}\epsilon_{ik}\Big)\left(\big( \Gamma_H(\boldsymbol x)-\eta_H(\boldsymbol x)\big)\frac{\partial\xi_A^m}{\partial x^m}(\boldsymbol x)- \xi_A^m(\boldsymbol x)\frac{\partial \eta_H}{\partial x^m}(\boldsymbol x)\right)\right. \nonumber
   \\
   &-\left.\Big(\epsilon_{ji}\delta_{\ell k}-\delta_{ji}\epsilon_{\ell k}\Big)\xi_A^m(\boldsymbol x)\frac{\partial \Gamma_H}{\partial x^m}(\boldsymbol x)+\int d^2y\,\xi_A^m(\boldsymbol y)\{\bar\eta_{ji\ell k}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]=0\,.  \label{eta-j-2D}
\end{align}
Here is convenient to use that $\Gamma_H$ is a function of $\rho$, that is,
\begin{equation}
\big\{\Gamma_H\big(\rho(\boldsymbol x)\big),\text{\textctj}_m(\boldsymbol y)\big\}=-\Gamma_H'\big(\rho(\boldsymbol x)\big)\rho(\boldsymbol y)\frac{\partial}{\partial y^m}\delta(\boldsymbol x-\boldsymbol y). \label{Gamma-j}
\end{equation}
Plugging equation~(\ref{Gamma-j}) into (\ref{eta-j-2D}), we see that
\begin{align}
     &\epsilon^{ABC}\int d^2x\left[\big( \Gamma_H-\eta_H\big)\frac{\partial\xi_A^m}{\partial x^m}- \xi_A^m\frac{\partial \eta_H}{\partial x^m}+\int d^2y\,\xi_A^m(\boldsymbol y)\{\bar\eta_{H}(\boldsymbol x),\text{\textctj}_m(\boldsymbol y)\}\right]\nonumber
     \\
     &\times(\epsilon_{j\ell}\delta_{ik}+\delta_{j\ell}\epsilon_{ik})\frac{\partial\xi_B^i}{\partial x_j}\frac{\partial\xi_C^k}{\partial x_\ell}=0 \,.  \label{Jacobiator}
\end{align}

The bracket between the odd viscosity and the momentum density is fully determined by Jacobi identity, i.e.,
\begin{align}
\{\eta_H(\boldsymbol x), \text{\textctj}_m(\boldsymbol y)\}&=\left[\Big(\eta_H(\boldsymbol x)-\Gamma_H\big(\rho(\boldsymbol x)\big)\Big)\frac{\partial}{\partial x^m}+\frac{\partial \eta_H}{\partial x^m}(\boldsymbol x)\right]\delta(\boldsymbol x-\boldsymbol y)\,,\nonumber
\\
\{\eta_H(\boldsymbol x), \text{\textctj}_m(\boldsymbol y)\}&=-\left[\eta_H(\boldsymbol y)\frac{\partial}{\partial y^m}+\Gamma_H\big(\rho(\boldsymbol x)\big)\frac{\partial}{\partial x^m}\right]\delta(\boldsymbol x-\boldsymbol y)\,. \label{eta-j}
\end{align}

So far, we have not used that $\eta_H$ is a function of $\rho$. Imposing it into equation~(\ref{Jacobiator}) give us
\begin{equation}
\epsilon^{ABC}(\epsilon_{j\ell}\delta_{ik}+\delta_{j\ell}\epsilon_{ik})\int d^2x\,\Big[ \Gamma_H(\rho)-\eta_H(\rho)+\rho\, \eta_H'(\rho)\Big]\frac{\partial\xi_A^m}{\partial x^m}\frac{\partial\xi_B^i}{\partial x_j}\frac{\partial\xi_C^k}{\partial x_\ell}=0\,,
\end{equation}
in other words, the Jacobi identity is only satisfied when
\begin{equation}
\Gamma_H(\rho)=\eta_H(\rho)-\rho\,\eta_H'(\rho)\,.
\end{equation}

In fact, equation~(\ref{eta-j}) must always be valid, even when $\eta_H$ cannot be expressed in terms of $\rho$. Therefore, equation~(\ref{eta-j}) defines the brackets between the fluid intrinsic angular momentum and momentum density.

Equation~(\ref{eta-j}) however has a deeper implication. Note that
\begin{align}
&\frac{\partial}{\partial x_j}\left[\bar\eta_{ji\ell k}(\boldsymbol x)\frac{\partial}{\partial x_\ell}\right]\delta(\boldsymbol x-\boldsymbol y)=\nonumber
\\
&\frac{\partial}{\partial x_j}\left[\Big(\eta_H(\boldsymbol x)\left(\epsilon_{j\ell}\delta_{ik}+\epsilon_{ik}\delta_{j\ell}\right)+\Gamma_H(\boldsymbol x)(\epsilon_{ji}\delta_{\ell k}-\delta_{ji}\epsilon_{\ell k})\Big)\frac{\partial}{\partial x_\ell}\right]\delta(\boldsymbol x-\boldsymbol y),\nonumber
\\
&\frac{\partial}{\partial x_j}\left[\bar\eta_{ji\ell k}(\boldsymbol x)\frac{\partial}{\partial x_\ell}\right]\delta(\boldsymbol x-\boldsymbol y)=\nonumber
\\
&+\left[\epsilon_{ij}\frac{\partial}{\partial y_j}\left(\eta_H(\boldsymbol y)\frac{\partial}{\partial y^k}\right)-\epsilon_{kj}\frac{\partial}{\partial x_j}\left(\eta_H(\boldsymbol x)\frac{\partial}{\partial x^i}\right)\right]\delta(\boldsymbol x-\boldsymbol y)-\epsilon_{ij}\frac{\partial}{\partial x_j}\left[\Gamma_H(\boldsymbol x)\frac{\partial}{\partial x^k}\right]\delta(\boldsymbol x-\boldsymbol y)\nonumber
\\
&+\epsilon_{kj}\frac{\partial}{\partial y_j}\left[\Gamma_H(\boldsymbol x)\frac{\partial}{\partial y^i}\right]\delta(\boldsymbol x-\boldsymbol y).
\end{align}
Using equation~(\ref{eta-j}), we can eliminate the dependence in $\Gamma_H$, since
\begin{align}
   -\epsilon_{ij}\frac{\partial}{\partial x_j}\left[\Gamma_H(\boldsymbol x)\frac{\partial}{\partial x^k}\right]\delta(\boldsymbol x-\boldsymbol y)&=\{\partial_i^*\eta_H(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\}-\eta_H(\boldsymbol y)\,\epsilon_{ij}\frac{\partial^2}{\partial y_j\partial y^k}\delta(\boldsymbol x-\boldsymbol y)\,,
   \\
   \epsilon_{kj}\frac{\partial}{\partial y_j}\left[\Gamma_H(\boldsymbol x)\frac{\partial}{\partial y^i}\right]\delta(\boldsymbol x-\boldsymbol y)&=\{\text{\textctj}_i(\boldsymbol x),\partial_k^*\eta_H(\boldsymbol y)\}+\eta_H(\boldsymbol x)\,\epsilon_{kj}\frac{\partial^2}{\partial x_j\partial x^i}\delta(\boldsymbol x-\boldsymbol y)\,.
\end{align}

Therefore, we obtain
\begin{align}
\frac{\partial}{\partial x_j}\left[\bar\eta_{ji\ell k}(\boldsymbol x)\frac{\partial}{\partial x_\ell}\right]\delta(\boldsymbol x-\boldsymbol y)=&\,\{\partial_i^*\eta_H(\boldsymbol x),\text{\textctj}_k(\boldsymbol y)\}+\{\text{\textctj}_i(\boldsymbol x),\partial_k^*\eta_H(\boldsymbol y)\}\nonumber
\\
&+\left[\partial_i\eta_H(\boldsymbol y)\frac{\partial}{\partial y^k}-\partial_k^*\eta_H(\boldsymbol x)\frac{\partial}{\partial x^k}\right]\delta(\boldsymbol x-\boldsymbol y)\,.
\end{align}
Combining this with equation~(\ref{j-j-mod}), we see that the quantities $\text{\textctj}_i+\partial_i^*\eta_H$ are the diffeomorphism generators, that is, they satisfy following algebra
\begin{equation}
\left\{\big(\text{\textctj}_i+\partial_i^*\eta_H\big)(\boldsymbol x),\big(\text{\textctj}_k+\partial_k^*\eta_H\big)(\boldsymbol y)\right\}=\left[\big(\text{\textctj}_i+\partial_i^*\eta_H\big)(\boldsymbol y)\frac{\partial}{\partial y^k}-\big(\text{\textctj}_k+\partial_k^*\eta_H\big)(\boldsymbol x)\frac{\partial}{\partial x^i}\right]\delta(\boldsymbol x-\boldsymbol y)\,.
\end{equation}

\end{appendix}