In this paper we enumerate nonhyperelliptic superspecial curves of genus $4$ over prime fields of characteristic $p\le 11$. Our algorithm works for nonhyperelliptic curves over an arbitrary finite field in characteristic $p \ge 5$. We execute the algorithm for prime fields of $p\le 11$ with our implementation on a computer algebra system Magma. Thanks to the fact that the cardinality of $\F_{p^a$-isomorphism classes of superspecial curves over $\F_{p^a$ of a fixed genus depends only on the parity of $a$, this paper contributes to the odd-degree case for genus $4$, whereas \cite{KH16 contributes to the even-degree case.
appendix_PF.tex
%======
\appendix
%======

% \begin{table}[h]
%   \begin{center}
%     \caption{Existence/Non-existence of superspecial curves}\label{tab:ssp}
% \vspace{0.2cm}
%     \scalebox{0.8}{
%     \begin{tabular}{c|l|c|c|l|c|l|l|r|r} \hline
%     $q$ & Case & $s_1$ & Iterations 1 & ~~~~~$t_{mlt}$ & $s_2$ & ~~~~~$t_{GBslv}$ & ~~~~~$t_{total}$ & Iterations 2 & Total time~~~ \\ \hline
% $11$ & {\bf N1} (i) & $8$ & 484 & 0.57188s & $6$ & 1.0036s & 1.0043s & 58564 & 59127.514s \\
%  & & & & & & & & & (about 16.4 hours) \\
%  & {\bf N1} (ii) & $9$ & 22 & 0.40118s & $5$ & 0.0072295s  & 0.010360s & 292820 & 3425.283s\\ 
%  & {\bf N1} (iii) & $8$ & 3456  & 0.19745s & $4$ & 0.0058428s & 0.0092311s & 322102& 3457.706s \\
%  & {\bf N2} & $9$ & 22 & 9.0721s & $5$ & 0.061044s & 0.067900s & 638880 & 45782.984s  \\
%  & & & & & & & & & (about 12.7 hours) \\
%  & Degenerate & $9$ & 40 & 0.39785s & $6$ & 0.30259s & 0.30512s & 48400 & 14794.521s \\ \hline
% 	 \end{tabular}}
%  \end{center}
% \end{table}

%====================================================
\section{Pseudocodes}\label{sec:code}
%====================================================

In this appendix, we collect the pseudocodes of the algorithms proposed in Section \ref{sec:main_results}.
For the notation in each code, see Section \ref{sec:main_results}.
The algorithms are
\begin{itemize}
\item Modified Version of Main Algorithm in \cite{KH16} (pseudocode: Algorithm \ref{alg:enume}),
\item Isomorphism Testing Algorithm (pseudocode: Algorithm \ref{alg:isomorphic_tilde}), and
\item Collecting Isomorphism Classes Algorithm (pseudocode: Algorithm \ref{alg:isomorphic_family}).
\end{itemize}
Recall that Isomorphism Testing Algorithm is a sub-procedure in Collecting Isomorphism Classes Algorithm.

% \begin{algorithm}[htb] 
% \caption{$\texttt{EnumerateSSpCurves} ( Q, P, ( k_1, \ldots , k_{s_1} ), ( i_1, \ldots , i_{s_2} ), \mathcal{A}_1, \mathcal{A}_2, p, \succ)$}
% \label{alg:enume}
% \begin{algorithmic}[1]
% \REQUIRE{A quadratic form $Q$ in $S = K [x, y, z, w]$, a cubic form $P$ of the form \eqref{input_P} in $K [a_1, \ldots , a_t] [x,y,z,w]$, two tuples $( k_1, \ldots , k_{s_1} )$ and $( i_1, \ldots , i_{s_2} )$ with $1 \leq k_1 < \cdots < k_{s_1} \leq t$ and $1 \leq i_1 < \cdots < i_{s_2} \leq k_{s_1}$ such that $\{ i_1, \ldots , i_{s_2} \} \subset \{ k_1, \ldots , k_{s_1} \}$, two subsets $\mathcal{A}_1$ of $K^{t-s_1}$ and $\mathcal{A}_2$ of $K^{s_1-s_2}$, the characteristic $p$ of $K$, and a term order $\succ$ on $a_{i_1}, \ldots , a_{i_t}$}
% \ENSURE{A family $\mathcal{P}$ of cubics $P$ such that the curves $C = V ( P, Q )$ are superspecial}
% \STATE $\mathcal{P}$ $\leftarrow$ $\emptyset$
% \STATE $\mathcal{M}$ $\leftarrow$ the set of the $16$ monomials given in Corollary \ref{cor:HW}
% \STATE $t_1$ $\leftarrow$ $t-s_1$; Write $\{ 1, \ldots , t \} \smallsetminus \{ k_1, \ldots , k_{s_1} \} = \{ k_1^{\prime}, \ldots , k_{t_1}^{\prime} \}$
% \FOR{$( a_{k_1^{\prime}}, \ldots , a_{k_{t_1}^{\prime}} ) \in \mathcal{A}_1$}
% 	\STATE Substitute $( a_{k_1^{\prime}}, \ldots, a_{k_{t_1}^{\prime}} )$ to $P$ /* Keep $a_{i_1}, \ldots , a_{i_{s_1}}$ being indeterminates*/
% 	\STATE $h$ $\leftarrow$ $( P Q )^{p-1}$
% 	\STATE $t_2$ $\leftarrow$ $s_1-s_2$; Write $\{ k_1, \ldots , k_{s_1} \} \smallsetminus \{ i_1, \ldots , i_{s_2} \} = \{ j_1, \ldots , j_{t_2} \}$
% 	\FOR{$\left( a_{j_1}, \ldots , a_{j_{t_2}} \right) \in \mathcal{A}_2$}
% 		\STATE Substitute $\left( a_{j_1}, \ldots, a_{j_{t_2}} \right)$ to $P$ /* Keep $a_{i_1}, \ldots , a_{i_{s_2}}$ being indeterminates*/
% 		\STATE $\mathcal{S}$ $\leftarrow$ $\emptyset$
% 		\FOR{$x^k y^{\ell} z^m w^n \in \mathcal{M}$}
% 			\STATE $f \left( a_{i_1}, \ldots, a_{i_{s_2}} \right)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $h$
% 			\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f \left( a_{i_1}, \ldots, a_{i_{s_2}} \right) \}$
% 		\ENDFOR
% 		\STATE $I$ $\leftarrow$ the ideal $\langle \mathcal{S} \rangle \subset K [ a_{i_1}, \ldots, a_{i_{s_2}} ]$
% 		\STATE Solve the system $f = 0$ for all $f \in \mathcal{S}$ over $K$ by some known algorithm with $\succ$
% 		\STATE $V$ $\leftarrow$ $V(I) = \{ ( a_{i_1}, \ldots , a_{i_{s_2}} ) \in K^{s_2} : f \left( a_{i_1}, \ldots, a_{i_{s_2}} \right) = 0 \mbox{ for all } f \in \mathcal{S} \}$
% 		\IF{$V \neq \emptyset$}
% 			\FOR{$\left( a_{i_1}, \ldots, a_{i_{s_2}} \right) \in V$}
% 				\STATE Substitute $\left( a_{i_1}, \ldots, a_{i_{s_2}} \right)$ to $P$ /* Then $P \in K[x,y,z,w]$ */
% 				\IF{$V ( P, Q )$ is non-singular}
% 					\STATE $\mathcal{P}$ $\leftarrow$ $\mathcal{P} \cup \{ P \}$
% 				\ENDIF
% 			\ENDFOR
% 		\ENDIF
% 	\ENDFOR
% \ENDFOR
% \RETURN $\mathcal{P}$
% \end{algorithmic}
% \end{algorithm}

\begin{algorithm}[htb] 
\caption{$\texttt{EnumerateSSpCurves} ( Q, P, p)$}
\label{alg:enume}
\begin{algorithmic}[1]
\REQUIRE{A quadratic form $Q$ in $S = \mathbb{F}_q [x, y, z, w]$, a cubic form $P$ of the form \eqref{input_P} in $\mathbb{F}_q [a_1, \ldots , a_t] [x,y,z,w]$, and the characteristic $p$ of $\mathbb{F}_q$}
\ENSURE{A list $\mathcal{P}$ of cubics $P$ such that the curves $C = V ( P, Q )$ are superspecial}
\STATE $\mathcal{P}$ $\leftarrow$ $\emptyset$
\STATE $\mathcal{M}$ $\leftarrow$ the set of the $16$ monomials given in Corollary \ref{cor:HW}
\STATE Choose $0 \leq s_1 \leq t$ and $\{ k_1, \ldots , k_{s_1} \} \subset \{ 1, \ldots , t \}$
\STATE $t_1$ $\leftarrow$ $t-s_1$; Write $\{ 1, \ldots , t \} \smallsetminus \{ k_1, \ldots , k_{s_1} \} = \{ k_1^{\prime}, \ldots , k_{t_1}^{\prime} \}$
\STATE Choose $\mathcal{A}_1 \subset \mathbb{F}_q^{\oplus t_1}$
\FOR{$( a_{k_1^{\prime}}, \ldots , a_{k_{t_1}^{\prime}} ) \in \mathcal{A}_1$}
	\STATE Substitute $( a_{k_1^{\prime}}, \ldots, a_{k_{t_1}^{\prime}} )$ to $P$ /* Keep $a_{k_1}, \ldots , a_{k_{s_1}}$ being indeterminates*/
	\STATE $h$ $\leftarrow$ $( P Q )^{p-1}$
	\STATE Choose $0 \leq s_2 \leq s_1$ and $\{ i_1, \ldots , i_{s_2} \} \subset \{ k_1, \ldots , k_{s_1} \}$
	\STATE $t_2$ $\leftarrow$ $s_1-s_2$; Write $\{ k_1, \ldots , k_{s_1} \} \smallsetminus \{ i_1, \ldots , i_{s_2} \} = \{ j_1, \ldots , j_{t_2} \}$
	\STATE Choose $\mathcal{A}_2 \subset \mathbb{F}_q^{\oplus t_2}$
	\FOR{$\left( a_{j_1}, \ldots , a_{j_{t_2}} \right) \in \mathcal{A}_2$}
		\STATE Substitute $\left( a_{j_1}, \ldots, a_{j_{t_2}} \right)$ to $P$ /* Keep $a_{i_1}, \ldots , a_{i_{s_2}}$ being indeterminates*/
		\STATE $\mathcal{S}$ $\leftarrow$ $\{ \mbox{the coefficient of } x^k y^{\ell} z^m w^n : x^k y^{\ell} z^m w^n \in \mathcal{M} \}t$
% 		\FOR{$x^k y^{\ell} z^m w^n \in \mathcal{M}$}
% 			\STATE $f \left( a_{i_1}, \ldots, a_{i_{s_2}} \right)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $h$
% 			\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f \left( a_{i_1}, \ldots, a_{i_{s_2}} \right) \}$
% 		\ENDFOR
		\STATE $I$ $\leftarrow$ the ideal $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ a_{i_1}, \ldots, a_{i_{s_2}} ]$
		\STATE Choose a term ordering on $a_{i_1}, \ldots, a_{i_{s_2}}$
		\STATE Solve the system $f = 0$ for all $f \in \mathcal{S}$ over $K$ by some known algorithm with $\succ$
		\STATE $V$ $\leftarrow$ $V(I) = \{ ( a_{i_1}, \ldots , a_{i_{s_2}} ) \in \mathbb{F}_q^{\oplus s_2} : f \left( a_{i_1}, \ldots, a_{i_{s_2}} \right) = 0 \mbox{ for all } f \in \mathcal{S} \}$
		\IF{$V \neq \emptyset$}
			\FOR{$\left( a_{i_1}, \ldots, a_{i_{s_2}} \right) \in V$}
				\STATE Substitute $\left( a_{i_1}, \ldots, a_{i_{s_2}} \right)$ to $P$ /* Then $P \in \mathbb{F}_q[x,y,z,w]$ */
				\STATE Decide whether $V ( P, Q )$ is non-singular by the non-singularity testing in Section \ref{subsec:singtest}
				\IF{$V ( P, Q )$ is non-singular}
					\STATE $\mathcal{P}$ $\leftarrow$ $\mathcal{P} \cup \{ P \}$
				\ENDIF
			\ENDFOR
		\ENDIF
	\ENDFOR
\ENDFOR
\RETURN $\mathcal{P}$
\end{algorithmic}
\end{algorithm}

%=====================
\paragraph{``Mod $Q$'' function}
%=====================
Let $Q$ be an irreducible quadratic form in $K [x,y,z,w]$, $m_Q$ a monomial in $Q$, and $c_Q$ its coefficient.
Given a cubic form $P \in K [x,y,z,w]$, we give a function to compute ``$P \mbox{ mod } Q$'', where $\mbox{mod }Q$ means here replacing $m_Q$ in $P$ by $- c_Q^{-1} (Q - c_Q m_Q)$ via $m_Q \equiv - c_Q^{-1} (Q - c_Q m_Q) \mbox{ mod }Q$.
In other words, we compute a cubic form $P^{\prime}$ with no monomial divided by $m_Q$ such that $P \equiv P^{\prime} \mbox{ mod } Q$.
% \[
% P \equiv P^{\prime} \quad \mbox{mod } Q.
% \]
This function shall be used as a sub-routine in Algorithm \ref{alg:isomorphic_tilde}.
In Algorithm \ref{alg:modQ}, we write down a pseudocode of the function.

\begin{algorithm}[htb] %
\caption{$\texttt{ModQuad} ( P, Q, m_Q )$}
\label{alg:modQ}
\begin{algorithmic}[1]
\REQUIRE{A cubic form $P \in K [x,y,z,w]$, a quadratic form $Q$ and a monomial $m_Q$ in $Q$}
\ENSURE{A cubic form $P^{\prime}$ with no monomial divided by $m_Q$ such that $P \equiv P^{\prime} \mbox{mod } Q$}
\STATE $c_Q$ $\leftarrow$ the coefficient of $m_Q$ in $Q$
\STATE Write $P = P_0 + m_Q R$ for a cubic form $P_0$ with no term containing $m_Q$, and a linear form $R$
\STATE $P^{\prime}$ $\leftarrow$ $P_0 - c_Q^{-1} (Q - c_Q m_Q) R$
\RETURN $P^{\prime}$
\end{algorithmic}
\end{algorithm}

\begin{algorithm}[htb] %
\caption{$\texttt{IsIsomorphicN1} ( P_1, P_2, q )$}
\label{alg:isomorphic_tilde}
\begin{algorithmic}[1]
\REQUIRE{Two cubic forms $P_1$ and $P_2$ in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
\ENSURE{``\textbf{ISOMORPHIC}'' or ``\textbf{NOT ISOMORPHIC}''}
\STATE $IsomorphicFlag$ $\leftarrow$ $0$
\FOR{$M_{\rm A} \in \mathrm{A}$}
	\FOR{$M_{\rm W} \in \mathrm{W}$}
		\STATE $M_{\tilde{\rm T}}$ $\leftarrow$ $\mathrm{diag} (t_1, t_2, t_3 t_2^{-1}, t_3 t_1^{-1})$
		\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot M_{\tilde{\rm T}} \cdot U_1 (t_4) \cdot U_2 (t_5) \cdot M_{\rm W} \cdot U_1 (t_6) \cdot U_2 (t_7)$
		\STATE Construct a system of algebraic equations with indeterminates $t_i$'s and $\lambda$
		\STATE $P_3$ $\leftarrow$ $\texttt{ModQuad} ( g \cdot P_1 - \lambda P_2, Q, x w)$
	 	\STATE $\mathcal{S}$ $\leftarrow$ $\{ t_i^{q-1} - 1 : 1 \leq i \leq 3 \} \cup \{ t_j^q - t_j : 4 \leq j \leq 7 \} \cup \{ \lambda^{q-1} - 1 \}$
	 	\STATE $\mathrm{Mon}(P_3)$ $\leftarrow$ the set of the monomials in $P_3$
		\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_3)$}
			\STATE $f  (t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_3$
			\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda) \}$
		\ENDFOR
		\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda ]$
		\IF{$\sharp G \neq 1$}
			\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{\rm A}$
		\ENDIF
	\ENDFOR
\ENDFOR
\IF{$IsomorphicFlag = 0$}
	\RETURN ``\textbf{NOT ISOMORPHIC}''
\ELSE
	\RETURN ``\textbf{ISOMORPHIC}''
\ENDIF
\end{algorithmic}
\end{algorithm}


\begin{algorithm}[t] %
\caption{$\texttt{NotIsomorphicListN1} ( \mathcal{P}, q )$}
\label{alg:isomorphic_family}
\begin{algorithmic}[1]
\REQUIRE{A list $\mathcal{P} = ( P_1, \ldots , P_t )$ of cubics in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
\ENSURE{A family $\mathcal{P}^{\prime \prime}$ of cubics in $\mathbb{F}_q [x,y,z,w]$}
\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\emptyset$, $FlagList1$ $\leftarrow$ $( 0 )_{i=1}^t$
\FOR{$i=1$ \TO $t$}
	\IF{$FlagList1[i] = 0$}
		\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\mathcal{P}^{\prime} \cup \{ P_i \}$
		\FOR{$j=i+1$ \TO $t$}
			\STATE Use Algorithm \ref{alg:isomorphic_tilde} not regarding $t_3$ as an indeterminate, but taking $t_3=1$
			\IF{$\texttt{IsIsomorphicN1} ( P_i, P_j, q )$ returns \textbf{ISOMORPHIC}}
				\STATE $FlagList1[j]$ $\leftarrow$ $1$
			\ENDIF
		\ENDFOR
	\ENDIF
\ENDFOR
\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\emptyset$, $FlagList2$ $\leftarrow$ $( 0 )_{i=1}^{\sharp \mathcal{P}^{\prime}}$
\FOR{$i=1$ \TO $\sharp \mathcal{P}^{\prime}$}
	\IF{$FlagList2[i] = 0$}
		\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\mathcal{P}^{\prime \prime} \cup \{ \mathcal{P}^{\prime} [i] \}$
		\FOR{$j=i+1$ \TO $t$}
			\STATE Use Algorithm \ref{alg:isomorphic_tilde} regarding all $t_i$'s as indeterminates 
			\IF{$\texttt{IsIsomorphicN1} ( \mathcal{P}^{\prime} [i], \mathcal{P}^{\prime} [j], q )$ returns \textbf{ISOMORPHIC}}
				\STATE $FlagList2[j]$ $\leftarrow$ $1$
			\ENDIF
		\ENDFOR
	\ENDIF
\ENDFOR
\RETURN $\mathcal{P}^{\prime \prime}$
\end{algorithmic}
\end{algorithm}
preamble.tex
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amscd}
\usepackage{amsmath}
\usepackage[all]{xy}
\usepackage[top=30truemm,bottom=30truemm,left=25truemm,right=25truemm]{geometry}
\usepackage{comment}
\usepackage{algorithmic,algorithm}
\usepackage{here}
\usepackage{graphicx}
\usepackage{color} %
\usepackage{enumerate} %
\usepackage{listliketab}
\usepackage{multirow}
\usepackage{slashbox}

\makeatletter
\c@MaxMatrixCols=14
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
  \renewcommand{\thealgorithm}{%
  \thesubsection.\arabic{algorithm}}
  \@addtoreset{algorithm}{section}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\renewcommand{\algorithmiccomment}[1]{/*#1*/}
\newcommand{\ul}[1]{\underline{#1}}
\renewcommand{\figurename}{Fig.}
\renewcommand{\tablename}{Table }
%%%%%%%%%%%%%%%%%%%%%%%%

%\theorembodyfont{\normalfont}
\theoremstyle{definition}
\newtheorem{pf}{{\it Proof}}
\renewcommand{\thepf}{}

%\theorembodyfont{\normalfont}
\theoremstyle{definition}
\newtheorem{pfT}{{\it Proof} {\rm of Theorem.}}
\renewcommand{\thepfT}{}

\theoremstyle{plain}
\newtheorem{theo}{Theorem}
\renewcommand{\thetheo}{\Alph{theo}}


\theoremstyle{plain}
\newtheorem{theor}{Theorem}
\renewcommand{\thetheor}{\Alph{theor}}

\theoremstyle{plain}
\newtheorem{lemm}{Lemma}[section]


\theoremstyle{plain}
\newtheorem{propp}{Proposition}[section]

\theoremstyle{plain}
\newtheorem{thm}{Theorem}[subsection]
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{ex}[thm]{Example}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{ob}[thm]{Observation}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{nota}[thm]{Notation}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{defin}[thm]{Definition}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{rem}[thm]{Remark}
%\theorembodyfont{\normalfont}

\theoremstyle{plain}
\newtheorem{prop}[thm]{Proposition}
%\theorembodyfont{\normalfont\itshape}



\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma}
%\theorembodyfont{\normalfont}

\theoremstyle{plain}
\newtheorem{cor}[thm]{Corollary}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{code}[thm]{Code}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{Imp}[thm]{Implementation}
%\theorembodyfont{\normalfont}

\theoremstyle{definition}
\newtheorem{conje}[thm]{Conjecture}
%\theorembodyfont{\normalfont}

%\theorembodyfont{\normalfont}
\theoremstyle{definition}
\newtheorem{ack}{Acknowledgements}
% \renewcommand{\theack}{}

\theoremstyle{definition}
\newtheorem{prob}[thm]{Problem}
%\theorembodyfont{\normalfont}

\numberwithin{equation}{subsection}

\def\qed{\hfill $\Box$}
\def\A{\mathbb{A}}
\def\P{\mathbb{P}}
\def\Q{\mathbb{Q}}
\def\Z{\mathbb{Z}}
\def\C{\mathbb{C}}
\def\F{\mathbb{F}}
\def\R{\mathbb{R}}
\def\deg{{\rm deg}}
\def\exp{{\rm exp}}
\def\Div{{\rm Div}}
\def\ord{{\rm ord}}
\def\div{{\rm div}}
\def\Pic{{\rm Pic}}
\def\Coker{{\rm Coker}}
\def\dim{{\rm dim}}
\def\rank{{\rm rank}}
\def\mod{{\rm mod}}
\def\Im{{\rm Im}}
\def\Ker{{\rm Ker}}
\def\T{{\rm T}}
\def\MT{{\rm MT}}
\def\PT{{\rm PT}}
\def\RR{{\rm R}}
\def\pp{{\rm pp}}
\def\qq{{\rm qq}}
\def\labelenumi{(\theenumi)}

\newcommand{\bbA}{{\operatorname{\bf A}}}
\newcommand{\bbB}{{\operatorname{\bf B}}}
\newcommand{\bbC}{{\operatorname{\bf C}}}
\newcommand{\bbD}{{\operatorname{\bf D}}}
\newcommand{\bbE}{{\operatorname{\bf E}}}
\newcommand{\bbF}{{\operatorname{\bf F}}}
\newcommand{\bbG}{{\operatorname{\bf G}}}
\newcommand{\bbH}{{\operatorname{\bf H}}}
\newcommand{\bbI}{{\operatorname{\bf I}}}
\newcommand{\bbJ}{{\operatorname{\bf J}}}
\newcommand{\bbK}{{\operatorname{\bf K}}}
\newcommand{\bbL}{{\operatorname{\bf L}}}
\newcommand{\bbM}{{\operatorname{\bf M}}}
\newcommand{\bbN}{{\operatorname{\bf N}}}
\newcommand{\bbO}{{\operatorname{\bf O}}}
\newcommand{\bbP}{{\operatorname{\bf P}}}
\newcommand{\bbQ}{{\operatorname{\bf Q}}}
\newcommand{\bbR}{{\operatorname{\bf R}}}
\newcommand{\bbS}{{\operatorname{\bf S}}}
\newcommand{\bbT}{{\operatorname{\bf T}}}
\newcommand{\bbU}{{\operatorname{\bf U}}}
\newcommand{\bbV}{{\operatorname{\bf V}}}
\newcommand{\bbW}{{\operatorname{\bf W}}}
\newcommand{\bbX}{{\operatorname{\bf X}}}
\newcommand{\bbY}{{\operatorname{\bf Y}}}
\newcommand{\bbZ}{{\operatorname{\bf Z}}}

\newcommand{\Spec}{\operatorname{Spec}}
\newcommand{\Spf}{\operatorname{Spf}}
\newcommand{\Proj}{\operatorname{Proj}}

\newcommand{\Gal}{\operatorname{Gal}}

\newcommand{\GL}{\operatorname{GL}}
\newcommand{\SL}{\operatorname{SL}}
\newcommand{\PGL}{\operatorname{PGL}}
\newcommand{\Symp}{\operatorname{Sp}}
\newcommand{\GSp}{\operatorname{GSp}}
\newcommand{\PSp}{\operatorname{PSp}}
\newcommand{\GO}{\operatorname{GO}}
\newcommand{\SO}{\operatorname{SO}}
\newcommand{\PSO}{\operatorname{PSO}}
\newcommand{\Spin}{\operatorname{Spin}}
\newcommand{\U}{\operatorname{U}}
\newcommand{\SU}{\operatorname{SU}}
\newcommand{\M}{\operatorname{M}}

\newcommand{\Sym}{\operatorname{Sym}}

\newcommand{\ga}{{\operatorname{a}}}
\newcommand{\gb}{\operatorname{b}}
\newcommand{\gc}{\operatorname{c}}
\newcommand{\gd}{\operatorname{d}}
\newcommand{\goe}{\operatorname{e}}
\newcommand{\gf}{\operatorname{f}}
\newcommand{\gog}{\operatorname{g}}
\newcommand{\gh}{\operatorname{h}}
\newcommand{\gi}{{\operatorname{i}}}
\newcommand{\gj}{{\operatorname{j}}}
\newcommand{\gk}{\operatorname{k}}
\newcommand{\gl}{\operatorname{l}}
\newcommand{\gm}{\operatorname{m}}
\newcommand{\gn}{\operatorname{n}}
\newcommand{\go}{\operatorname{o}}
\newcommand{\gp}{\operatorname{p}}
\newcommand{\gq}{\operatorname{q}}
\newcommand{\gr}{\operatorname{r}}
\newcommand{\gs}{\operatorname{s}}
\newcommand{\gt}{\operatorname{t}}
\newcommand{\gu}{\operatorname{u}}
\newcommand{\gv}{\operatorname{v}}
\newcommand{\gw}{\operatorname{w}}
\newcommand{\gx}{\operatorname{x}}
\newcommand{\gy}{\operatorname{y}}
\newcommand{\gz}{\operatorname{z}}

\newcommand{\gA}{\operatorname{A}}
\newcommand{\gB}{\operatorname{B}}
\newcommand{\gC}{\operatorname{C}}
\newcommand{\gD}{\operatorname{D}}
\newcommand{\gE}{\operatorname{E}}
\newcommand{\gF}{\operatorname{F}}
\newcommand{\gG}{\operatorname{G}}
\newcommand{\gH}{\operatorname{H}}
\newcommand{\gI}{{\operatorname{I}}}
\newcommand{\gJ}{{\operatorname{J}}}
\newcommand{\gK}{\operatorname{K}}
\newcommand{\gL}{\operatorname{L}}
\newcommand{\gM}{\operatorname{M}}
\newcommand{\gN}{\operatorname{N}}
\newcommand{\gO}{\operatorname{O}}
\newcommand{\gP}{\operatorname{P}}
\newcommand{\gQ}{\operatorname{Q}}
\newcommand{\gR}{\operatorname{R}}
\newcommand{\gS}{\operatorname{S}}
\newcommand{\gT}{\operatorname{T}}
\newcommand{\gU}{\operatorname{U}}
\newcommand{\gV}{\operatorname{V}}
\newcommand{\gW}{\operatorname{W}}
\newcommand{\gX}{\operatorname{X}}
\newcommand{\gY}{\operatorname{Y}}
\newcommand{\gZ}{\operatorname{Z}}

\newcommand{\Hom}{\operatorname{Hom}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Ext}{\operatorname{Ext}}
\newcommand{\Aut}{\operatorname{Aut}}
\newcommand{\Iso}{\operatorname{Iso}}
\newcommand{\Isom}{\operatorname{Isom}}

\newcommand{\diag}{\operatorname{diag}}
\newcommand{\pr}{\operatorname{pr}}
\newcommand{\fracfield}{\operatorname{frac}}
\newcommand{\modulo}{\operatorname{mod}}

\newcommand{\fS}{{\mathfrak S}}
\newcommand{\Jac}{\operatorname{Jac}}

\newcommand{\Tr}{\operatorname{Tr}}
\newcommand{\cris}{\operatorname{cris}}
\newcommand{\crys}{\operatorname{crys}}
\newcommand{\dR}{\operatorname{dR}}
section1_PF.tex
\section{Introduction}
\if 0
In 1970, Goppa~\cite{Goppa} discovered algebraic geometric codes.
In algebraic geometric codes, curves with more rational points permit larger threshold of error correction.
A curve $C$ over the finite field $\F_q$ with $q$ elements of genus $g$
is called {\it maximal} (resp. {\it minimal})
if the number of $\F_q$-rational points on $C$ is $q + 1 + 2 g \sqrt{q}$ (resp. $q + 1 - 2 g \sqrt{q}$), which is called the Hasse-Weil upper (resp. lower) bound.
Therefore, maximal curves play a central role in algebraic geometric codes (see e.g. \cite{WCC2015}).
However, for a fixed pair $(g, q)$, maximal curves over $\mathbb{F}_q$ of genus $g$ are very rare, and thus finding maximal curves is well-known as a difficult problem in algebraic geometry.
The notion of {\it superspecial} curves helps us to find maximal curves.
Specifically, a curve over a field $K$ of characteristic $p>0$
is called superspecial if its Jacobian
is isomorphic to a product of supersingular elliptic curves over
the algebraic closure $\overline K$ of $K$.
It is known that any maximal or minimal curve $C$ over $\F_{p^2}$
is superspecial.
Conversely any superspecial curve descends to a maximal or minimal curve
over $\F_{p^2}$, see the proof of \cite[Theorem 1.1]{Ekedahl}.
This work focuses on enumerating superspecial curves for finding all maximal curves.
\fi

In this paper a curve means a non-singular projective variety of dimension one.
A curve over a perfect field $K$ of characteristic $p>0$ is said to be {\it superspecial} if its Jacobian
is isomorphic to a product of supersingular elliptic curves over
the algebraic closure $\overline K$ of $K$.
This paper aims to enumerate nonhyperelliptic superspecial curves of genus $4$ over prime fields $\F_p$ for $p\le 11$.

This work contributes to the problem on finding or enumerating
maximal or minimal curves over $\F_{p^2}$,
since it is known that any maximal or minimal curve over $\F_{p^2}$
is superspecial.
Conversely any superspecial curve descends to a maximal or minimal curve
over $\F_{p^2}$, see the proof of \cite[Theorem 1.1]{Ekedahl}.

The motivation to study the case over {\it prime} fields comes from the fact that
the enumeration over $\F_p$ and $\F_{p^2}$ is essential
for that over general finite fields.
Indeed, in Proposition \ref{PropositionGeneralFiniteFields}
we shall see the general fact that
the number of $\F_{p^a}$-isomorphism classes of
superspecial curves over $\F_{p^a}$ of fixed genus depends only on the parity of $a$,
see also \cite[Theorem 1.3]{XYY16} by Xue, Yang and Yu
for an analogous result in the case of abelian varieties.

\if 0
\renewcommand{\arraystretch}{1.5}
\begin{table}[t]
\centering{
\caption{
Main references to enumerations of $K$-isomorphism classes of superspecial curves of genus $g$ over $\mathbb{F}_q$ for $g\le 4$
(replace ``curves" by ``elliptic curves" if $g=1$).
There are two cases $q=p^{2e-1}$ or $p^{2e}$ for each $g$, where $e$ is a natural number.
}
\label{table:2}
\begin{tabular}
{c||c||c|ccc||c|c||c}
\hline
\backslashbox{~$g$}{$q$~~} &
$p\le 3$
& \multicolumn{1}{c}{$5^{2 e -1}$} & \multicolumn{1}{c}{$5^{2 e}$} & \multicolumn{1}{||c}{~~$7^{2 e-1}$} & \multicolumn{1}{c|}{$7^{2 e}$} & \multicolumn{1}{||c}{~~$11^{2 e-1}$~~} & \multicolumn{1}{c||}{$11^{2 e}$~} & $p\ge 13$\\
\hline \hline
$1$ & \multicolumn{8}{c}{$(K=\overline{\F_q})$: Deuring \cite{Deuring}, \quad $(K=\F_q)$: Xue-Yang-Yu \cite[Prop. 4.4]{XYY16}}  \\ \hline
$2$ & \multicolumn{8}{c}{
$(K=\overline{\F_q})$:
Hashimoto-Ibukiyama \cite{HI} for $p^{2e}$,
Ibukiyama-Katsura \cite{IK} for $p^{2e-1}$
} \\
\hline
$3$ & \multicolumn{8}{c}{
$(K=\overline{\F_q})$: Hashimoto \cite{Hashimoto} for $p^{2e}$,\quad
Existence for $p^{2e-1}$: Ibukiyama \cite{Ibukiyama} 
} \\
\hline
\multirow{2}{*}{$4$} & \multicolumn{1}{c||}{Non-Existence} & ~{\bf Main}~ & \multirow{2}{*}{\cite{FGT}, \cite{KH16}} & \multicolumn{2}{||c||}{Non-Existence} & {\bf Main} &  Existence &No general\\
& \multicolumn{1}{c||}{by Ekedahl~\cite{Ekedahl}} & {\bf Thm.} &
& \multicolumn{2}{||c||}{by \cite{KH16}} & {\bf Thm.}  & (e.g. \cite{ManyPoints})&result\\ \hline
\end{tabular}
}
\end{table}
\fi
In the literature, there are many works on the enumeration of superspecial curves
over algebraically closed field.
%, see Table \ref{table:2} for a summary.
The case of elliptic curves is due to Deuring \cite{Deuring}.
If $g\le 3$, some theoretical approaches
%to finding or enumerating superspecial curves
are available,
since any principally polarized abelian variety of dimension $g\le 3$
is the Jacobian variety of a (possibly reducible) curve, see Oort-Ueno \cite{OU}.
%which are based on Torelli's theorem .
In the case of principally polarized abelian varieties,
the number of isomorphism classes of superspecial ones is described by a class number of
a quaternion unitary group, see Ibukiyama-Katsura-Oort \cite[Theorem 2.10]{IKO},
and the explicit formulae of those class numbers are given by Hashimoto-Ibukiyama \cite{HI} for $g=2$
and by Hashimoto \cite{Hashimoto} for $g=3$.
The enumeration of superspecial curves for $g\le 3$ is done by
removing the contribution of reduced curves.
Contrary to this story over algebraically closed field,
such explicit enumerations over finite fields have not been completed yet,
except for $g=1$ case (cf. Xue-Yang-Yu \cite[Prop. 4.4]{XYY16}).
But some results on the existence are known. For example,
% (Note that the enumeration over general finite fields $\mathbb{F}_{p^a}$
% depends only on the parity of $a$,
% see Proposition \ref{PropositionGeneralFiniteFields} below.)
%
%In particular,
it is shown that
there exists a maximal curve of genus $g$
over $\F_{p^{2e}}$ if $g=2$ and $p^{2e}\ne 4,9$
(cf. Serre \cite[Th\'eor\`eme 3]{Serre1983})
and if $g=3$, $p\ge 3$ and $e$ is odd
(cf. Ibukiyama \cite[Theorem 1]{Ibukiyama}).
See Ibukiyama-Katura \cite{IK} for the enumeration
of principally polarized abelian varieties over $\overline{\F_p}$
which can descend to those over $\F_p$.

If $g\ge 4$,
any theory working for curves of genus $g$ in arbitrary large characteristic $p$
has not been found.
The case of $g=4$ is a next target;
For $p=5$, Fuhrmann-Garcia-Torres~\cite{FGT} found a maximal curve $C_{0}$ of genus $4$ over $K= \F_{25}$, 
and proved that it gives a unique isomorphism class over $\overline{K}$.
For $p \leq 7$, all superspecial curves of genus $4$ over $\F_{p^2}$ were computationally enumerated in \cite{KH16}.
In particular, the result of~\cite{KH16} enumerated all the maximal curves over $K=\mathbb{F}_{25}$, which are included in the unique isomorphism class of $C_0$ over $\overline{K}$.
The result over $\F_{49}$,
together with results in Serre~\cite{Serre}, Howe~\cite{Howe}
and Howe-Lauter \cite{Howe-Lauter},
determined the exact value of the maximal number $N_{49}(4)$ of
the rational points of curves of genus $4$ over $\F_{49}$,
see \cite[Corollary 5.1.3]{KH16}.
This contributed to the table at {\tt manypoints.org}~\cite{ManyPoints}
about bounds of $N_q(g)$, updated
after the paper \cite{GV} by van der Geer and Vlugt.

% In particular, the result of \cite{KH16} enumerated all the maximal curves over $K=\mathbb{F}_{25}$, which are included in the unique isomorphism class of $C_0$ over $\overline{K}$.
% In \cite{KH16} we enumerated 
% superspecial curves of genus $4$ over $\F_{p^2}$ for $p\le 7$.
% The result over $\F_{25}$ implies that there is a unique maximal curve over $\F_{25}$, which was a computational re-proof of a result of Fuhrmann-Garcia-Torres \cite{FGT}.
% The result over $\F_{49}$,
% together with results in Serre \cite{Serre}, Howe \cite{Howe}
% and Howe-Lauter \cite{Howe-Lauter},
% determined the exact value of the maximal number $N_{49}(4)$ of
% the rational points of curves of genus $4$ over $\F_{49}$,
% see \cite{KH16}, Corollary 5.1.3.
% This contributed to the table at {\tt manypoints.org}
% about bounds of $N_q(g)$, updated
% after the paper \cite{GV} by van der Geer and Vlugt.

\if 0
Let $p$ be a prime number.
Let $K$ be a perfect field of characteristic $p$.
Let $\overline K$ denote the algebraic closure of $K$.
In this paper a curve means a non-singular projective variety of dimension $1$.
A curve over $K$ is called {\it superspecial} if its Jacobian
is isomorphic to a product of supersingular elliptic curves over $\overline K$.
It is known that $C$ is superspecial if and only if the Frobenius on
$H^1(C,{\mathcal O}_C)$ is zero.
%Note that any superspecial curves are defined over $\F_{p^2}$.

We are concerned about the existence and
the enumeration of superspecial curves of genus $g$.
If $g\le 3$, some theoretical approaches are available,
which are based on Torelli's theorem.
In particular, it is known that
there exists a superspecial curve of genus $g$
in characteristic $p$ if $g=2$ and $p\ge 5$
(cf. Serre \cite{Serre1983}, Th\'eor\`eme 3)
and if $g=3$ and $p\ge 3$ (cf. Ibukiyama \cite{Ibukiyama}, Theorem 1).
But if $g\ge 4$,
any theory stating such a thing for arbitrary large $p$
has not been found.
Our interest goes to the case of $g=4$ with small $p$.
%Our approcah is computational.

In \cite{KH16} we enumerated 
superspecial curves of genus $4$ over $\F_{p^2}$ for $p\le 7$.
The result over $\F_{25}$ implies that there is a unique maximal curve over $\F_{25}$, which was a computational re-proof of a result of Fuhrmann-Garcia-Torres \cite{FGT}.
The result over $\F_{49}$,
together with results in Serre \cite{Serre}, Howe \cite{Howe}
and Howe-Lauter \cite{Howe-Lauter},
determined the exact value of the maximal number $N_{49}(4)$ of
the rational points of curves of genus $4$ over $\F_{49}$,
see \cite{KH16}, Corollary 5.1.3.
This contributed to the table at {\tt manypoints.org}
about bounds of $N_q(g)$, updated
after the paper \cite{GV} by van der Geer and Vlugt.
\fi

\if 0
This work aims to enumerate nonhyperelliptic superspecial curves of genus $4$ over prime fields $\F_p$ for $p\le 11$.
\if 0
This work aims to enumerate nonhyperelliptic superspecial curves of genus $4$ over prime fields $\F_p$ for $p=5$ and $11$.
Here is our main theorem:
This paper is a sequel to \cite{KH16} and aims to enumerate nonhyperelliptic superspecial curves of genus $4$ over prime fields $\F_p$ for $p\le 11$.
%The aim of this paper is 
%The enumeration will be completed over prime fields $\F_p$ for $p\le 11$.
%The enumeration over prime fields is important, since
\fi
The motivation to study the case over prime fields comes from the fact that
the enumeration over $\F_p$ and $\F_{p^2}$ is essential
for that over general finite fields.
Indeed, in Proposition \ref{PropositionGeneralFiniteFields}
we shall see the general fact that
the number of $\F_{p^a}$-isomorphism classes of
superspecial curves over $\F_{p^a}$ of fixed genus depends only on the parity of $a$,
see \cite[Theorem 1.3]{XYY16} by Xue, Yang and Yu
for an analogous result in the case of abelian varieties.
\fi 

There is no superspecial curve of genus $g=4$ over $\F_p$ for $p = 2,3$ by \cite[Theorem 1.1]{Ekedahl},
and for $p=7$ by \cite[Theorem B]{KH16}.
Here are our main theorems:

\begin{theo}\label{MainTheorem}
There exist precisely $7$ superspecial curves of genus $4$ over $\mathbb{F}_{5}$ up to isomorphism over $\mathbb{F}_{5}$.
(Note that there exists precisely $1$ superspecial curve of genus $4$ over $\mathbb{F}_{5}$ up to isomorphism over the algebraic closure,
cf. \cite[Corollary 5.1.1]{KH16}.)
\end{theo}

\begin{theo}\label{MainTheorem2}
There exist precisely $30$ nonhyperelliptic superspecial curves of genus $4$ over $\mathbb{F}_{11}$ up to isomorphism over $\mathbb{F}_{11}$.
Moreover, there exist precisely $9$ nonhyperelliptic superspecial curves of genus $4$ over $\mathbb{F}_{11}$ up to isomorphism over the algebraic closure.
\end{theo}

We also have explicit defining equations of the superspecial curves in Theorems \ref{MainTheorem} and \ref{MainTheorem2} (but omit them in the statement).
Many of them
%Such explicit equations also 
define maximal curves over $\mathbb{F}_{p^2}$.
For example, we found the following superspecial curve over $\mathbb{F}_{11}$;
Let $Q= 2 x w + 2 y z$, and $P= x^2 y + x^2 z + y^3 + 8 y^2 z + 3 y z^2 + 10 y w^2 + 10 z^3 + 10 z w^2$,
which define one of the $30$ superspecial curves over $\mathbb{F}_{11}$.
Then $C = V(P, Q)$ is a maximal curve over $\mathbb{F}_{11^2}$.
%, where $V(P, Q)$ denotes the locus of the zeros of $P$ and $Q$.
Indeed, the number of its $\mathbb{F}_{11^2}$-rational points is $210$, which coincides with the Hasse-Weil upper bound $q +1 + 2 g \sqrt{q} $ for $q=11^2$.
For the other equations, see Sections \ref{subsec:sscurves} and \ref{subsec:comp_result}, or a table of the web page of the first author~\cite{HPkudo}.

We prove Main Theorem with help of computational results.
% Our computational methods are (A) Modified version of Main Algorithm in \cite{KH16}, (B) New reduction of cubic forms, and (C) Isomorphism testing.
The idea of our enumeration method in this paper is based on \cite{KH16}, but an improvement is required:
%Our main theorems are proved in a similar way to the proofs of the main theorems of \cite{KH16}:
In \cite[Section 5.2]{KH16}, the authors gave an algorithm (Main Algorithm together with a pseudocode in \cite[Algorithm 5.2.1]{KH16}) to enumerate nonhyperelliptic superspecial curves of genus $4$.
As showed in \cite{KH16}, a nonhyperelliptic curve $C$ of genus $4$ over $K$ is given by an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $K [x,y,z,w]$.
Regarding coefficients in $P$ as indeterminates, one computes $(P Q)^{p-1}$, and then a multivariate system over $K$ is derived from our criterion for the superspeciality (for details on the criterion, see \cite[Section 3.1]{KH16} or Section 2.1 of this paper).
%\textcolor{blue}{
Considering a tradeoff between a brute-force and Gr\"{o}bner bases techniques, we solve the system with the {\it hybrid method} given in \cite{BFP}.
Here the hybrid method is a method for solving multivariate systems by combining the brute-force on some coefficients with Gr\"{o}bner bases techniques.
% To solve the system, we use the {\it hybrid method} given in \cite{BFP}, which is a method for solving multivariate systems by combining a brute-force on some coefficients with Gr\"{o}bner bases techniques.
For each solution, we test whether $C=V (P, Q)$ is non-singular or not.
%}
In this way, one can enumerate all nonhyperelliptic superspecial curves of genus $4$ over $K$, but an improvement is required to get the result for $q=p=11$ since $p=11$ is not so small.
% On the other hand, as the cardinality of a prime field is small, we need a new reduction method of defining equations.

In this paper, we shall give a modified version of the algorithm in \cite{KH16}.
We here briefly describe the difference between the previous algorithm (Main Algorithm in \cite{KH16})
and the modified version.
%\textcolor{blue}{
Our modification considers optimal coefficients in $P$ to be regarded as indeterminates not only in solving algebraic equations but also in computing the multiplication $(P Q)^{p-1}$.
More concretely,
%}
in the previous version, we first choose and fix the number of the indeterminates in solving multivariate systems.
In other words, we use the {\it same} number of indeterminates in computing $(P Q)^{p-1}$ and solving multivariate systems.
From outputs obtained by the previous algorithm in our experiments,
we observe that the computation of $(P Q)^{p-1}$ might be dominant for large $p$ if each multivariate system is quite efficiently solved.
This depends on the value of $p$, rather than the number of unknown coefficinets in $P$ to be regarded as indeterminates.
From this, we consider increasing the number of the indeterminates in the computation of $(P Q)^{p-1}$, but not changing (or reducing) that
in solving multivariate systems.
In other words, we use {\it different} number of indeterminates in computing $(P Q)^{p-1}$ and solving multivariate systems.
%\textcolor{blue}{
% Moreover we can also reduce the total cost of our enumeration if the influence
As described above, we consider two kinds of optimal tuples of coefficients in $P$ to be regarded as indeterminates, and doubly use the brute-force on coefficients.
Following the terminology in \cite{BFP},
%}
we call this method {\it double hybrid method} in this paper.
% (the terminology ``hybrid method'' is origin to
% a method for solving multivariate systems given in \cite{BFP}).
As we will see in this paper,
%\textcolor{blue}{
increasing the number of the indeterminates in the computation of $(P Q)^{p-1}$ allows us to reduce the number of total iterations.
We therefore expect that the modified version with this double hybrid method is extremely faster than the previous version in \cite{KH16} for certain cases.
%}

We also give an algorithm to classify isomorphism classes of superspecial curves of genus $4$, based on the Bruhat decomposition of the orthogonal group associated to the quadratic form $Q$ (cf.\ the algorithm given in \cite{KH16} just computes defining equations, but does not classify isomorphism classes).
With these new algorithms, we completely enumerate the isomorphism classes of superspecial curves of genus $4$ over $\mathbb{F}_5$ and $\mathbb{F}_{11}$.



%It would be preferable to enumarate
%hyperelliptic superspecial curves of genus $4$ over $\mathbb{F}_{11}$.
%In a future paper we will treat the case.
The automorphism groups of the superspecial curves
 obtained in Theorems A and B,
and the compatibility of this enumeration
and Galois cohomology theory
 will be studied in a separated paper \cite{KHS}.

The structure of this paper is as follows.
In Section 2, we review some basic facts on
nonhyperelliptic curves of genus $4$ and 
a way to compute those Hasse-Witt matrices,
and study the reduction of the enumeration of superspecial curves over an arbitrary finite field to that in the case of degree one or two.
In Section 3 we give a reduction of the defining equations of curves
of genus $4$, refining the way in \cite[Section 4]{KH16}.
In \cite{KH16} we treated only curves with sufficiently many rational points,
but over small fields curves may not have sufficiently many rational points
even if they are maximal.
The reduction in this paper assumes only
that a curve has at least one rational point.
In addition, as $\F_5$ is very small, we need an extra argument over $\F_5$, see Section \ref{ReductionDegenerateCase}.
In Section 4, we state the main results and prove them.
%Some remarks and questions are in Section 5.
%�H�i���ȓ��^�Q�֌W�i����������H�j��
%����N�i�v�Z�@��p���Ȃ��ؖ���^����j�ȂǁA�]�����ꂻ���Ȃ��̓��X�j
In Appendix we collect the pseudocodes used in Section 4.
%��4�ŗ^����Algorithm �̋^���R�[�h�i�{�������Əꏊ���Ƃ�̂Łj


\subsection*{Acknowledgments}
This work was supported by
JSPS Grant-in-Aid for Young Scientists (B) 25800008.

section2_PF.tex
\section{Preliminaries}\label{section:2}

We review some basic facts on nonhyperelliptic curves of genus $4$, and a criterion for their superspecialities and non-singularities.

\subsection{Nonhyperelliptic curves of genus $4$ and their superspecialities}\label{CurvesGenus4}
%Let $p$ be a rational prime, and $K$ a perfect field of characteristic $p$.
Let $K$ be a perfect field of characteristic $p$, and $C$ a nonhyperelliptic curve of genus $4$ over $K$.
As a canonical curve, $C$ is defined in the $3$-projective space $\bbP^3=\Proj(\overline{K}[x,y,z,w])$ by an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $x,y,z,w$, see \cite[Chapter IV, Example 5.2.2]{Har}.
% Let $C$ be a nonhyperelliptic curve of genus $4$ over $K$.
% The canonical divisor defines an embedding $C$ into $\bbP^3=\Proj(\overline{K}[x,y,z,w])$.
% It is known that $C$ is defined by an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $x,y,z,w$, see \cite{Har}, Chapter IV, Example 5.2.2.
As showed in \cite[Section 2.1]{KH16}, we may assume that any coefficient of $Q$ and $P$ belongs to $K$.
% Remark 2.2.1 in \cite{KH16} says that $Q$ is assumed to be either of ({\bf N1}) $2 x w + 2 y z$, ({\bf N2}) $2xw+y^2-\epsilon z^2$, or ({\bf Degenerate}) $2yw - \epsilon z^2$.

It is known that $C$ is superspecial if and only if its Hasse-Witt matrix, which is the matrix of the Frobenius on $H^1 ( C, \mathcal{O}_C)$ for a suitable basis, is zero.
The Hasse-Witt matrix of $C$ is determined by certain coefficients of $(P Q)^{p-1}$, see \cite[Corollary 3.1.6]{KH16} (for more general cases, see \cite[Appendix B]{KH16} or \cite[Section 5]{Kudo}).
Hence we can decide whether $C$ is superspecial or not by computing the coefficients.
We state this fact in Proposition \ref{cor:HW}.

\begin{prop}[\cite{KH16}, Corollary 3.1.6]\label{cor:HW}
With notation as above, $C=V(P,Q)$ is superspecial if and only if all the coefficients of the following monomials in $(P Q)^{p-1}$ are zero:
\begin{equation}
\begin{array}{cccc}
( x^2 y z w )^{p-1}, & x^{2 p-1} y^{p-2} z^{p-1} w^{p-1}, & x^{2 p-1} y^{p-1} z^{p - 2} w^{p -1}, &  x^{2 p -1} y^{p-1} z^{p - 1} w^{p -2}, \\
x^{p-2} y^{2 p-1} z^{p-1} w^{p-1}, & ( x y^2 z w )^{p-1} , & x^{p-1} y^{2 p-1} z^{p - 2} w^{p -1}, &  x^{p -1} y^{2 p-1} z^{p - 1} w^{p -2}, \\
x^{p-2} y^{p-1} z^{2 p - 1} w^{p -1}, & x^{p-1} y^{p-2} z^{2 p-1} w^{p-1}, & ( x y z^2 w )^{p-1} , &  x^{p -1} y^{p-1} z^{2 p - 1} w^{p -2}, \\
 x^{p -2} y^{p-1} z^{p - 1} w^{2 p -1}, & x^{p-1} y^{p-2} z^{p-1} w^{2 p-1}, & x^{p-1} y^{p-1} z^{p - 2} w^{2 p -1}, & ( x y z w^2 )^{p-1}
\end{array} \nonumber
\end{equation}
%in $(P Q)^{p-1}$ are equal to $0$. 
\end{prop}

% We claim that it can be assumed that any coefficient of $Q$ and $P$
% belongs to $K$. Let $\overline K$ be the algebraic closure of $K$.
% Let $\Gamma_K$ denote the Galois group $\Gal(\overline K/K)$.
% Since up to constant multiplication $Q$ is uniquely determined by $C$ (cf. \cite{Har}, Chapter IV, Example 5.2.2),
% for any $\sigma\in\Gamma_K$ there is
% $\lambda_\sigma\in \overline{K}^\times$ such that $Q^\sigma = \lambda_\sigma Q$. The map sending $\sigma$ to $\lambda_\sigma$ defines an element of
% the Galois cohomology group
% $H^1(\Gamma_K, \overline K^\times)$.
% As this is trivial (Hilbert's theorem 90),
% there is $a\in \overline K^\times$
% such that $\lambda_\sigma = a^\sigma a^{-1}$ for all $\sigma\in \Gamma_K$.
% Replacing $Q$ by $a^{-1} Q$,
% we have $Q^\sigma = Q$ for all $\sigma\in \Gamma_K$.
% From now on we assume that any coefficient of $Q$ belongs to $K$.

% Choose $P$ such that $P$ and $Q$ determine $C$.
% Since $C$ is defined over $K$, for any $\sigma\in\Gamma_K$ we have
% \begin{equation}\label{P and its twist}
% P^\sigma \equiv \lambda P \quad \mod \quad Q
% \end{equation}
% for some $\lambda\in \overline K^\times$.
% (Otherwise $C$ is the intersection of $Q$, $P$, $P^\sigma$
% with essentially different $P$ and $P^\sigma$. This is absurd.)

% Let $m$ be the leading monomial of $Q$ with respect to a certain term order.
% Let $V$ be the space of cubic forms over $K$ without terms containing $m$. Note $\dim_K V= 16$.
% Taking modulo $Q$,
% it suffices to consider $P$ belonging to 
% $V_{\overline K}:=V\otimes_K{\overline K}$.
% Then we have $P^\sigma \in V_{\overline K}$.
% It follows from (\ref{P and its twist}) that $P^\sigma = \mu_\sigma P$
% for some $\mu_\sigma \in \overline K^\times$.
% By the same argument as in the second paragraph, we see
% that $P$ belongs to $V$ after multiplying $P$ by a constant.

% \begin{rem}\label{QuadFormOverFiniteField}
% Note that a quadratic form $Q$ defining a curve $C$ of genus $4$
% is possibly degenerate.
% But its rank is greater than or equal to $3$,
% since otherwise $Q$ is reducible.
% If $K$ is a finite field of characteristic $p\ne 2$,
% then the quadratic forms over $K$ are classified by their ranks and discriminants,
% whence an element of $\GL_4(K)$ transforms $Q$
% into $2xw+2yz$ or $2xw+y^2-\epsilon z^2$ with $\epsilon\not\in (K^\times)^2$
% when $Q$ is non-degenerate,
% resp. into $2yw - \epsilon z^2$ for a representative $\epsilon$ of $K^\times/(K^\times)^2$ when $Q$ is degenerate.
% \end{rem}

% \subsection{Superspecial curves and maximal curves}
% It is known that maximal curves over $\F_{p^2}$
% are superspecial.
% For small $p$ a sort of the converse holds:
% \begin{lem}\label{ExistenceMaximalCurve}
% Assume that there exists a superspecial curve $C$ of genus $g$
% over an algebraically closed field $k$ in characteristic $p$
% with $g > \frac{p^2+1}{2p}$. 
% Then there exists a maximal curve $X$ of genus $g$ over $\F_{p^2}$
% such that $X_k:=X\times_{\Spec(\F_{p^2})} \Spec(k)$ is isomorphic to $C$.
% \end{lem}
% \begin{proof}
% By the proof of \cite{Ekedahl}, Theorem 1.1, 
% $C$ descends to a curve $X$ over $\F_{p^2}$ with 
% $\sharp X(\F_{p^2}) = 1\pm 2gp+p^2$.
% By the assumption, $1 - 2 g p+p^2$ is negative.
% Hence
% $\sharp X(\F_{p^2}) = 1 + 2 g p+p^2$ holds, i.e.,
% $X$ is a maximal curve over $\F_{p^2}$.
% \end{proof}

% Let $p$ be a rational prime. %$> 2$.
% Let $K$ be a perfect field of characteristic $p$.
% In this section, we present a method to get the Hasse-Witt matrix of a curve in $\mathbf{P}^3$ defined by two equations, and give an algorithm to test whether the variety defined by given equations is non-singular or not.


%==========================
% \subsection{Hasse-Witt matrices of nonhyperelliptic curves of genus $4$}\label{subsec:HWgenus4}
%==========================

% Given a graded module $M$ and an integer $\ell$, we denote by $M ( \ell )$ its $\ell$-twist given by $M (\ell)_t = M_{\ell + t}$.
% We first show the following lemma, which gives graded free resolutions for ideals generated by two homogeneous polynomials (see also \cite[Chapter 1, Exercise 1]{Eisenbud}).

% \begin{lem}\label{lem:1}
% Let $S = K [ X_0 , \ldots , X_r ]$ be the polynomial ring with $r + 1$ variables over a field $K$ (not necessarily perfect nor of positive characteristic).
% Let $f$ and $g$ be homogeneous polynomials with $\mathrm{gcd} ( f, g ) = 1$ in $S \smallsetminus \{ 0 \}$.
% Put $c := \mathrm{deg} ( f )$ and $d := \mathrm{deg} ( g )$.
% Then for every $n > 0$, the following sequence is an exact sequence of graded $S$-modules:
% $$\xymatrix{
% 0 \ar[r]^(0.35){\varphi_3^{( n )}} & S \left( - ( c + d ) n \right) \ar[r]^(0.45){\varphi_2^{( n )}} & S ( - c n) \oplus S ( - d n ) \ar[r]^(0.75){\varphi_1^{( n )}} & S \ar[r]^(0.30){\varphi_0^{( n )}}  & S / \langle f^n , g^n \rangle_S \ar[r] & 0,
% }$$
% where $\varphi_0^{( n )}$ is the canonical homomorphism and the set of homomorphisms $\{ \varphi_2^{( n)}, \varphi_1^{( n )} \}$ is represented by the set of matrices $\{ A_2, A_1 \}$ as follows:
% \begin{equation}
% \left\{ A_2 = 
% \left[
% \begin{array}{cc}
% g^n & - f^n
% \end{array}
% \right],
% A_1 = 
% \left[
% \begin{array}{c}
% f^n \\
% g^n
% \end{array}
% \right]
% \right\}.\nonumber
% \end{equation}
% \end{lem}

% \begin{proof}
% To simplify the notations, we denote by $\varphi_i$ the homomorphism $\varphi_i^{( n )}$ for each $0 \leq i \leq 3$ in this proof.
% We show $\mathrm{Ker} \left( \varphi_1 \right) = \langle [ g^n, - f^n ] \rangle_S$, where $\langle [ g^n, - f^n ] \rangle_S$ denotes the (graded) submodule generated by $[ g^n, - f^n ]$ in $S ( - c n ) \oplus S ( - d n )$.
% Let $[ h_1, h_2 ]$ be an arbitrary element in the submodule $\mathrm{Ker} \left( \varphi_1 \right) \subset S ( - c n) \oplus S ( - d n )$.
% Then we have $\varphi_1 \left( [ h_1, h_2 ] \right) = f^n h_1 + g^n h_2 = 0$ and thus $f^n h_1 = - g^n h_2$.
% Since $\mathrm{gcd} ( f, g ) = 1$, there exists $r \in S$ such that $h_1 = r g^n$ and $h_2 = - r f^n$.
% Hence we have $[ h_1, h_2 ] = r \cdot [ g^n, - f^n ] \in \langle [ g^n, - f^n ] \rangle_S$.
% Conversely, we have $\varphi_1 \left( [ g^n, - f^n ] \right) = f^n g^n - g^n f^n = 0$.
% Thus it follows that $\mathrm{Ker} \left( \varphi_1 \right) = \langle [ g^n, - f^n ] \rangle_S$, i.e., $\mathrm{Ker} \left( \varphi_1 \right) = \mathrm{Im} \left( \varphi_2 \right) $. 
% Clearly we have $\mathrm{Ker} \left( \varphi_0 \right) = \mathrm{Im} \left( \varphi_1 \right)$ and $\varphi_2$ (resp. $\varphi_0$) is injective (resp. surjective).
% \end{proof}

% \begin{rem}
% In this paper, a homomorphism of graded $S$-modules is a graded homomorphism \textit{of degree zero} of graded $S$-modules.
% In more detail, we say that a graded homomorphism 
% \[
% \varphi : \bigoplus_{j = 1}^{t} S(-d_j) \longrightarrow \bigoplus_{j = 1}^{t^{\prime}} S(- d_j^{\prime}) \ ; \ {\bf v} \mapsto {\bf v} A
% \]
% is \textit{of degree zero} if each $( k, \ell )$-entry $g_{k, \ell} \in S$ of the representation matrix $A = \left( g_{k, \ell} \right)_{k, \ell}$ is homogeneous of degree $d_k - d_{\ell}^{\prime}$.
% \end{rem}

% By Lemma \ref{lem:1}, the following lemma also holds.

% \begin{lem}\label{lem:2}
% Let $S = K [ X_0 , \ldots , X_r ]$ be the polynomial ring with $r + 1$ variables over a field $K$ (not necessarily perfect nor of positive characteristic).
% Let $f$ and $g$ be homogeneous polynomials with $\mathrm{gcd} ( f, g ) = 1$ in $S \smallsetminus \{ 0 \}$.
% Put $c := \mathrm{deg} ( f )$, $d := \mathrm{deg} ( g )$, $I := \langle f, g \rangle_S$ and $I_n := \langle f^n, g^n \rangle_S$ for $n > 0$.
% Then for every $n > 0$, the following diagram of homomorphisms of graded $S$-modules commutes, and each horizontal sequence is exact:
% $$\xymatrix{
% 0 \ar[r]^(0.35){\varphi_3^{( n )}} & S \left( - ( c + d ) n \right)  \ar[d]^{\psi_{2}} \ar[r]^(0.45){\varphi_{2}^{( n )}} &                      S ( - c n ) \oplus S ( - d n ) \ar[d]^{\psi_{1}} \ar[r]^(0.75){\varphi_{1}^{( n )}} & S  \ar[d]^{\psi_{0}} \ar[r]^(0.5){\varphi_0^{( n )}} & S / I_n                  \ar[d]^{\psi} \ar[r]    & 0            \\
% 0 \ar[r]^(0.35){\varphi_3^{( 1 )}} & S \left( - ( c + d ) \right)                                     \ar[r]^(0.45){\varphi_2^{( 1 )}} & S ( - c  ) \oplus S ( - d  )  \ar[r]^(0.75){\varphi_{1}^{( 1 )}} & S         \ar[r]^(0.5){\varphi_0^{( 1 )}} & S / I     \ar[r]    & 0            
% }$$
% where each $\varphi_i^{( m )}$ is defined as in Lemma \ref{lem:1}, $\psi_0$ is the identity map on $S$, and $\psi$ is the homomorphism defined by $h + I_n \mapsto h + I$.
% In addition, the set of homomorphisms $\{ \psi_2, \psi_1 \}$ is represented by the set of matrices $\{ P_2, P_1 \}$ as follows:
% \begin{equation}
% \left\{ P_2 = 
% \left[
% \begin{array}{cc}
% ( f g )^{n-1}
% \end{array}
% \right],
% P_1 = 
% \left[
% \begin{array}{cc}
% f^{n-1} & 0\\
% 0 & g^{n-1}
% \end{array}
% \right]
% \right\}.\nonumber
% \end{equation}
% \end{lem}

% Let $K$ be a perfect field with $\mathrm{char} ( K )  = p > 0$ (e.g., $K = \mathbb{F}_{p^s}$ or $\overline{\mathbb{F}_{p^s}}$).
% Let $\mathbf{P}^3 = \mathrm{Proj} ( S )$ denote the projective $3$-space for the polynomial ring $S := K [ x, y, z, w]$.
% For a graded $S$-module $M$, let $\widetilde{M}$ denote the sheaf associated with $M$ on $\mathbf{P}^3$.
% Now we describe a method to compute the Hasse-Witt matrix of the curve $C = V ( f, g ) \subset \mathbf{P}^3$ for given $p$ and homogeneous polynomials $f, g \in S$ with $\mathrm{gcd} ( f, g) = 1$ in $S$.
% We use the same notations as in Lemma \ref{lem:2}, and take $n = p$.
% Put $\varphi_i := \varphi_i^{(1)}$ and
% \begin{equation}
% \Phi_i:=\widetilde{\varphi_i},\quad \Phi_i^{(p)}:= \widetilde{\varphi_i^{(p)}},\quad \Psi:=\widetilde{\psi},\quad \mbox{and}\quad \Psi_i:=\widetilde{\psi_i}. \nonumber
% \end{equation}
% By Lemma \ref{lem:2}, the following diagram commutes:
% $$\xymatrix{
% H^1 \left( C, {\cal O}_C \right)                  \ar[dd]_{F^{\ast}} \ar[rr]^(0.5){\cong} \ar[rd]^{{(F_1 |_{C^p})}^{\ast}} &  & H^2 ( \mathbf{P}^3, \widetilde{I} )     \ar[r]^(0.45){\cong}              \ar[d]^{F_1^{\ast}}  & \mathrm{Ker} \left( H^3 ( \Phi_2 ) \right) \ar[d]^{F_1^{\ast}} \\
% & H^1 \left( C^p, {\cal O}_{C^p} \right) \ar[r]^{\cong} \ar[ld]^{H^1 ( \Psi )} & H^2 ( \mathbf{P}^3, \widetilde{I_p} ) \ar[r]^(0.45){\cong} \ar[d]^{H^2 ( \Psi_0 )} & \mathrm{Ker} \left( H^3 ( \Phi_2^{( p )} ) \right) \ar[d]^{H^3 ( \Psi_2 )} \\
% H^1 \left( C, {\cal O}_C \right)                  \ar[rr]^(0.5){\cong} &  & H^2 ( \mathbf{P}^3, \widetilde{I} ) \ar[r]^(0.45){\cong} & \mathrm{Ker} \left( H^3 ( \Phi_2 )  \right) 
% }$$
% where $F_1$ (resp. $F$) is the Frobenius morphism on $\mathbf{P}^3$ (resp. $C$) and $C^p :=  V \left( f^p, g^p \right)$.
% The following proposition is viewed as a generalization of Proposition 4.21 in \cite[Chapter 4]{Har}.

% \begin{prop}[\cite{KH16}, Proposition 3.1.5]\label{prop:HW_general}
% Let $K$ be a perfect field with $\mathrm{char} ( K )  = p > 0$.
% Let $f$ and $g$ be homogeneous polynomials with $\mathrm{deg}( f ) = c$ and $\mathrm{deg} ( g ) = d$ such that $\mathrm{gcd}( f, g ) = 1$ in $S:=K [x,y,z,w]$, $c \leq 3$ and $d \leq 3$.
% Let $C = V ( f, g )$ be the curve defined by the equations $f = 0$ and $g = 0$ in $\mathbf{P}^3$.
% Write $(f g)^{p-1} =  \sum c_{i_1, i_2, i_3, i_4} x^{i_1} y^{i_2} z^{i_3} w^{i_4}$ and
% \begin{equation}
% \{ (k,\ell,m,n) \in ( \mathbb{Z}_{<0} )^4 : k + \ell + m + n = - c - d \} = \{ (k_1, \ell_1, m_1, n_1), \ldots , (k_r, \ell_r, m_r, n_r ) \}, \nonumber
% \end{equation}
% where we note that $r = \mathrm{dim}_K H^1 (C, \mathcal{O}_C)$.
% Then the Hasse-Witt matrix of $C$ is given by
% \begin{equation}
% \left[
% \begin{array}{ccc}
% 	c_{- k_1 p + k_1, - \ell_1 p + \ell_1, - m_1 p + m_1, - n_1 p + n_1} & \cdots & c_{- k_r p + k_1, - \ell_r p + \ell_1, - m_r p + m_1, - n_r p + n_1} \\
% \vdots & & \vdots \\
% 	c_{- k_1 p + k_r, - \ell_1 p + \ell_r, - m_1 p + m_r, - n_1 p + n_r} & \cdots & c_{- k_r p + k_r, - \ell_r p + \ell_r, - m_r p + m_r, - n_r p + n_r}
% \end{array}
% \right]. \nonumber
% \end{equation}
% \end{prop}


% \begin{proof}
% By Lemma \ref{lem:2}, we have the following commutative diagram:
% $$\xymatrix{
% H^1 \left( C, \mathcal{O}_C \right) \ar[d]_{{(F_1 |_{C^p})}^{\ast}} \ar[rr]^(0.45){\cong} &  & \Ker \left( H^3 ( \Phi_2 ) \right) \ar[d]^{F_1^{\ast}} \ar[rr]^(0.4){\cong} & & H^3 \left( \mathbf{P}^3, \mathcal{O}_{\mathbf{P}^3} ( - c - d ) \right) \ar[d]^{F_1^{\ast}} \\
% H^1 \left( C^p, \mathcal{O}_{C^p} \right) \ar[rr]^(0.45){\cong} \ar[d]_{H^1 ( \Psi )} & & \mathrm{Ker} \left( H^3 \left( \Phi_2^{( p )} \right) \right) \ar[rr] \ar[d]^{H^3 ( \Psi_2 )} & & H^3 \left( \mathbf{P}^3, \mathcal{O}_{\mathbf{P}^3} ( (- c - d) p ) \right) \ar[d]^{( f g )^{p-1}} \\
% H^1 \left( C, \mathcal{O}_C \right)   \ar[rr]^(0.45){\cong} &  & \mathrm{Ker} \left( H^3 ( \Phi_2 )  \right) \ar[rr]^(0.4){\cong} & & H^3 \left( \mathbf{P}^3, \mathcal{O}_{\mathbf{P}^3} ( - c - d ) \right)
% }$$
% where $F_1$ (resp. $F$) is the Frobenius morphism on $\mathbf{P}^3$ (resp. $C$).
% The $K$-vector space $H^3 \left( \mathbf{P}^3, {\cal O}_{\mathbf{P}^3}( - c - d ) \right)$ has a basis $\{ x^k y^{\ell} z^m w^n : (k,\ell,m,n) \in ( \mathbb{Z}_{<0} )^4,\ k + \ell + m + n = - c - d \}$.
% For each $(k_i, \ell_i, m_i, n_i)$,
% \begin{eqnarray}
% (f g)^{p-1} \cdot F_1^{\ast} \left( x^{k_i} y^{\ell_i} z^{m_i} w^{n_i} \right) & = & (f g)^{p-1} \cdot ( x^{k_i p} y^{\ell_i p} z^{m_i p} w^{n_i p}) \nonumber \\
% & = & \sum c_{i_1, i_2, i_3, i_4} x^{i_1 + k_i p} y^{i_2 + \ell_i p} z^{i_3 + m_i p} w^{i_4 + n_i p} \nonumber \\
% & = & \sum_{j=1}^r c_{- k_i p + k_j, - \ell_i p + \ell_j, - m_i p + m_j, - n_i p + n_j} x^{k_j} y^{\ell_j} z^{m_j} w^{n_j}. \nonumber
% \end{eqnarray}
% Hence our claim holds.
% \end{proof}

% \begin{rem}
% As in Proposition \ref{prop:HW_general}, we can compute the Hasse-Witt matrix algorithmically for more general cases, see \cite[Section 5]{Kudo} for details. 
% \end{rem}

% \begin{cor}[\cite{KH16}, Corollary 3.1.6]\label{cor:HW}
% Let $K$ be a perfect field with $\mathrm{char} ( K )  = p > 0$.
% Let $f$ and $g$ be homogeneous polynomials with $\mathrm{deg}( f ) = 3$ and $\mathrm{deg} ( g ) = 2$ such that $\mathrm{gcd}( f, g ) = 1$ in $S:=K [x,y,z,w]$.
% Let $C = V ( f, g )$ be the curve defined by the equations $f = 0$ and $g = 0$ in $\mathbf{P}^3$.
% Then the Hasse-Witt matrix of $C$ is $0$ if and only if all the coefficients of
% \begin{equation}
% \begin{array}{cccc}
% ( x^2 y z w )^{p-1}, & x^{2 p-1} y^{p-2} z^{p-1} w^{p-1}, & x^{2 p-1} y^{p-1} z^{p - 2} w^{p -1}, &  x^{2 p -1} y^{p-1} z^{p - 1} w^{p -2}, \\
% x^{p-2} y^{2 p-1} z^{p-1} w^{p-1}, & ( x y^2 z w )^{p-1} , & x^{p-1} y^{2 p-1} z^{p - 2} w^{p -1}, &  x^{p -1} y^{2 p-1} z^{p - 1} w^{p -2}, \\
% x^{p-2} y^{p-1} z^{2 p - 1} w^{p -1}, & x^{p-1} y^{p-2} z^{2 p-1} w^{p-1}, & ( x y z^2 w )^{p-1} , &  x^{p -1} y^{p-1} z^{2 p - 1} w^{p -2}, \\
%  x^{p -2} y^{p-1} z^{p - 1} w^{2 p -1}, & x^{p-1} y^{p-2} z^{p-1} w^{2 p-1}, & x^{p-1} y^{p-1} z^{p - 2} w^{2 p -1}, & ( x y z w^2 )^{p-1}
% \end{array} \nonumber
% \end{equation}
% in $(f g)^{p-1}$ are equal to $0$. 
% \end{cor}



%======================================
\subsection{Non-singularity Testing}\label{subsec:singtest}
%=====================================-

Let $K$ be a field and $\overline{K}$ its algebraic closure.
Note that $K$ is not necessarily perfect nor of positive characteristic.
Let $f_1, \ldots , f_t $ be non-constant homogeneous polynomials in $S:=K [ X_0, \ldots , X_r]$.
We denote by $V (f_1, \ldots , f_t)$ the locus in $= \mathrm{Proj} (\overline{K}[X_0,\ldots , X_r])$ of the zeros of $f_1, \ldots , f_t$.
% In this subsection, for given homogeneous polynomials $f_1, \ldots , f_t$ in $S:=K [ X_0, \ldots , X_r]$, we give an algorithm to test whether the variety $V ( f_1, \ldots , f_t )$ in $\mathbf{P}^r = \mathrm{Proj} (\overline{K}[X_0,\ldots , X_r])$ defined by the equations $f_1 = 0, \ldots , f_t = 0$ is non-singular or not.
%For given (non-constant) homogeneous polynomials $f_1, \ldots , f_t$ in $S:=K [ X_0, \ldots , X_r]$, we can decide whether $V ( f_1, \ldots , f_t )$ in $\mathbf{P}^r = \mathrm{Proj} (\overline{K}[X_0,\ldots , X_r])$ is non-singular or not.
Given $f_1, \ldots , f_t$, we can decide whether $V ( f_1, \ldots , f_t )$ is non-singular or not.
The following is a known fact in computational algebraic geometry.

% Let us first review a known property in Gr\"{o}bner basis theory:
% Let $\succ$ be a term order on the monomials $X_0, \ldots , X_r$, $F$ an extension of the field $K$ and $T := F [ X_0, \ldots , X_r ]$ the polynomial ring with $r + 1$ variables over $F$.
% Let $I := \langle f_1, \ldots , f_t \rangle_S$ (resp.\ $J:= \langle f_1, \ldots , f_t \rangle_{T}$) the ideal in $S$ (resp.\ $T$) generated by $f_1, \ldots , f_t$.
% Then, for all $g \in S \subset T$, we have $\mathrm{NF}_{J, \succ} (g) = \mathrm{NF}_{I, \succ} (g) \in S$, where $\mathrm{NF}_{I, \succ} ( \cdot ) $ (resp.\ $\mathrm{NF}_{J, \succ} ( \cdot ) $) denotes the normal form function with respect to the ideal $I$ (resp.\ $J$) and the term order $\succ$.

\begin{lem}[\cite{KH16}, Lemma 3.2.1]\label{lem:non-sing}
With notation as above, let $f_1, \ldots , f_t$ be (non-constant) homogeneous polynomials in $S = K [X_0, \ldots , X_r]$.
We denote by $J (f_1, \ldots , f_t )$ the set of all the minors of degree $r - \mathrm{dim} (V (f_1, \ldots , f_t))$ of the matrix $( \partial f_i / \partial X_j)_{i,j}$.
Then the following are equivalent:
%\begin{description}
\begin{enumerate}
	\item[{\rm (1)}] The variety $V ( f_1, \ldots , f_t )$ is non-singular.
	\item[{\rm (2)}] For each $0 \leq i \leq r$,
	\[
	1 \in \langle J ( f_1, \ldots , f_t ), f_1, \ldots , f_t, 1 - Y X_i  \rangle_{K [ X_0, \ldots , X_r, Y]},
	\]
	where $Y$ is an extra indeterminate.
\end{enumerate}
%\end{description}
\end{lem}
With this criterion, one can test the non-singularity of $V ( f_1, \ldots , f_t )$ by computing a Gr\"{o}bner basis for $\langle J ( f_1, \ldots , f_t ), f_1, \ldots , f_t, 1 - Y X_i  \rangle_{K [ X_0, \ldots , X_r, Y]}$.

% \begin{proof}
% Put $S^{\prime} := K [X_0, \ldots , X_r, Y ]$ and $\left(\overline{S}\right)^{\prime} := \overline{K} [X_0, \ldots , X_r, Y]$, where $Y$ is a new variable.
% Here we fix a term order $\succ$ on the monomials $X_0, \ldots , X_r$ and $Y$.
% Note that $\succ$ can be viewed as a term order on the monomials $X_0, \ldots , X_r$.

% (1) $\Rightarrow$ (2): Suppose that $V ( f_1, \ldots , f_t )$ is non-singular. %over $\overline{K}$.
% 	Then for each $0 \leq i \leq r$, the variable $X_i$ is in the radical of $\langle J ( f_1, \ldots , f_t ), f_1, \ldots , f_t \rangle_{\overline{S}} \subset \overline{S}$.
% 	Put $I := \langle J ( f_1, \ldots , f_t ), f_1, \ldots , f_t, 1 - Y X_i \rangle_{S^{\prime}}$ and $\overline{I}:= \langle J ( f_1, \ldots , f_t ), f_1, \ldots , f_t, 1 - Y X_i \rangle_{\left( \overline{S} \right)^{\prime}}$.
% 	By Proposition \ref{lem:radicalmenb}, we have $1 \in \overline{I}  \subset \left( \overline{S} \right)^{\prime}$, and thus $\mathrm{NF}_{\overline{I}, \succ} (1) = 0$.
% 	Here let $\mathrm{NF}_{I, \succ} ( \cdot ) $ denote the normal form function with respect to the ideal $I$ and the term order $\succ$.
% 	Since $\overline{I}$ is generated by elements in $S^{\prime}$, we also have $\mathrm{NF}_{\overline{I}, \succ} (1) = \mathrm{NF}_{I, \succ} (1)$.
% 	Thus it follows that $\mathrm{NF}_{I, \succ} (1) = 0$.
% 	Hence $X_i$ belongs to the radical of $\langle J ( f_1, \ldots , f_t ), f_1, \ldots , f_t \rangle_S \subset S$.

% (2) $\Rightarrow$ (1): This claim clearly holds.
% \end{proof}

% In Algorithm \ref{alg:non-sing}, for given homogeneous polynomials $f_1, \ldots , f_t$ in $K [ X_0, \ldots , X_r]$, we give an algorithm to test whether the variety $V ( f_1, \ldots , f_t )$ in $\mathbf{P}^r = \mathrm{Proj} (\overline{K}[X_0,\ldots , X_r])$ (defined over $K$) is non-singular or not. %over $\overline{K}$.
% Algorithm \ref{alg:non-sing} calls the sub-procedure function $\texttt{RadicalMembership}$ given in Appendix \ref{sec:radical}.

% \begin{algorithm}[htb] %
% \caption{$\texttt{DetermineNonSingularity} ( f_1, \ldots , f_t )$}
% \label{alg:non-sing}
% \begin{algorithmic}[1]
% \REQUIRE{Homogeneous polynomials $f_1, \ldots , f_t$ in $S:=K [X_0, \ldots , X_r]$}
% \ENSURE{``non-singular'' or ``singular''}
% \STATE $nonsingularflag$ $\leftarrow$ $1$
% \STATE $J (f_1, \ldots , f_t)$ $\leftarrow$ (the set of all the minors of degree $r - \mathrm{dim} (V (f_1, \ldots , f_t))$ of the Jacobian matrix of $f_1, \ldots , f_t$)
% \STATE $I$ $\leftarrow$ $\langle J (f_1, \ldots , f_t), f_1, \ldots , f_t \rangle_S$
% \FOR{$i=0$ \TO $r$}
% 	\IF{$\texttt{RadicalMembership} ( X_i, I)$ outputs ``$X_i \notin \sqrt{I}$''}
% 		\STATE $nonsingularflag$ $\leftarrow$ $0$
% 		\STATE \textbf{break} $i$
% 	\ENDIF
% \ENDFOR
% \IF{$nonsingularflag = 1$}
% 	\RETURN ``non-singular''
% \ELSE
% 	\RETURN ``singular''
% \ENDIF
% \end{algorithmic}
% \end{algorithm}

\subsection{Enumerating superspecial curves over general finite fields}\label{subsec:GeneralFiniteFields}
Let $K$ be an arbitrary finite field of characteristic $p$.
We reduce the enumeration of $K$-isomorphism classes of superspecial curves over $K$ to that of $\F$-isomorphism classes of superspecial curves over $\F$ for $\F = \F_p$ or $\F_{p^2}$.

\newcommand{\SSp}{{\operatorname{SSp}}}
Let $\SSp_g(K)$ denote the set of $K$-isomorphism classes of superspecial curves over $K$.
The next proposition gives the reduction above.

\begin{prop}\label{PropositionGeneralFiniteFields}
Assume $g\ge 2$.
There exists a bijection
between $\SSp_g(\F_{p^a})$ and $\SSp_g(\F_{p^b})$ if $a\equiv b\ (\modulo 2)$.
\end{prop}

This is an analogue of the result by Xue, Yang and Yu in the case of abelian varieties, see \cite{XYY16}, Theorem 1.3.
%A lemma is necessary to prove this proposition.

\newcommand{\id}{{\operatorname{id}}}
To prove this proposition, we recall a basic fact on the Galois descent theory.
Put $k:=\overline{\F_{p}}$.
Let $\sigma_q$ denote the $q$-th power map on $k$.
Set $\Gamma_q = \Gal(k/\F_q)$.
Note that $\sigma_q$ is a topological generator of $\Gamma_q$.
For a scheme $S$ over $k$,
let $S^{(q)}$ denote $S\otimes_{k,\sigma_q}  k$.
For a morphism $f: S\to T$ of schemes over $k$,
let $f^{(q)}$ denote its base change $S^{(q)} \to T^{(q)}$.
Let $X$ be a quasi-projective variety over $k$.
Assume $|\Aut(X)|<\infty$.
%that any automorphism of $X$ is of finite order.
We claim that any isomorphism $\varphi: X^{(q)} \to X$
defines a descent datum.
Let $\varphi_{\sigma_q^i}$ be the isomorphism $X^{(q^i)} \to X$
defined by
$\varphi_{\sigma_q^i} = \varphi\circ\varphi^{(q)}\circ\cdots \circ \varphi^{(q^{i-1})}$.
%We claim that $\{\varphi_{\sigma_q^i}\}$ is a descent datum.
The cocycle condition $\varphi_{\sigma_q^i\sigma_q^j}
= \varphi_{\sigma_q^i}\circ\varphi_{\sigma_q^j}^{(q^i)}$
is obviously satisfied.
%To check that $\{\varphi_{\sigma_q^i}\}$ is continuous,
%we argue in the following way.
Let $\F_{q^m}$ be a field over which
$X$ and every automorphism of $X$ are defined.
%Note that $X$ is defined over some finite subfield of $k$, say $\F_{q^m}$.
%Then $X^{(q^m)} = X$.
Then $\varphi_{\sigma_q^m} \in \Aut(X)$
and $\varphi_{\sigma_q^m}^{(q^{mj})} = \varphi_{\sigma_q^m}$
for all $j$.
By the assumption $|\Aut(X)|<\infty$,
there exists a natural number $\ell$ such that $(\varphi_{\sigma_q^m})^\ell$
is the identity map $\id_X$ on $X$.
Then we have $\varphi_{\sigma_q^{m\ell}} = \id_X$.
Hence $\{\varphi_{\sigma_q^i}\}$ is a descent datum.
As $X$ is quasi-projective, any descent datum is known to be effective.
In the above setting, for any isomorphism $\varphi: X^{(q)} \simeq X$,
there exist a variety $X_0$ over $\F_q$
and an isomorphism  $\iota: X \to X_0\otimes k$ such that
$\varphi$ factors as $\iota^{-1}\circ\iota^{(q)}: X^{(q)} \to (X_0\otimes k)^{(q)}=X_0\otimes k \to X$.
%\begin{lem}
%Let $C$ be a superspecial curve over $k$.
%\begin{enumerate}
%\item[\rm (1)] {\color{red}$C$ descends to a curve $C_0$ over $\F_{p^2}$
%such that any autmorphism of $C_0$ is defined over $\F_{p^2}$.}
%\item[\rm (2)]
%If $C$ descends to a curve over $\F_{p^a}$ with odd $a$, then $C$ descends to a curve over $\F_p$.
%\end{enumerate}
%\end{lem}
%\begin{proof}
%{\color{red}
%(1) 
%This is essentially done in the proof of \cite{Ekedahl}, Theorem 1.1.
%For the reader's convenience, we give a proof here.
%Let $J(C)$ be the Jacobian of $C$ and 
%$\Theta$ the canonical principal polarization on $J(C)$ associated to $C$.
%We have $\Aut(C) = \Aut(J(C),\Theta)$ if $C$ is hyperelliptic
%and $\Aut(C)\times\{1,-1\} = \Aut(J(C),\Theta)$ otherwise.
%Let $E_\pm$ be a supersingular elliptic curve $E$
%over $\F_{p^2}$ whose Frobenius
%is multiplication by $\pm p$.
%It is well-known that $J(C)$ descends to $E_+^g$.
%Since any endomorphism of $E_+^g$ is defined over $\F_{p^2}$,
%the polarization $\Theta$ also decends to $\F_{p^2}$.
%There exists an isomorphism $\varphi: (J,\Theta) \to (J,\Theta)^{(p^2)}$.
%Then $\varphi$ or $-\varphi$ gives an isomorphism $C \to C^{(p^2)}$.
%By the Galois descent theory $C$ descends to a curve whose Jacobian is $E_+^g$ or $E_-^g$. 
%Since $\Aut_k(C_0) \subset \Aut_k(E_{\pm}^g)$ and
%any automorphism on $E_\pm^g$ is defined over $\F_{p^2}$,
%we have the desired assertion.}
%%Any superspecial curve over $k$ descends to a curve $C_0$ over $\F_{p^2}$,
%%whose Jacobian is isomorphic to $E^g$ or its twist by multiplication by $-1$
%%over some quadratic extension.
%%We have that $\Aut_k(C_0)\subset \Aut_k(E_\pm^g)$
%%and any element of $\Aut_k(E_\pm^g)$ is defined over $\F_{p^2}$.}
%
%(2)
%%Since any superspecial curve descends to that over $\F_{p^2}$, 
%By (1), we have $C \simeq C^{(p^2)}$.
%Then obviously
%$C \simeq C^{(p^a)}$ for odd $a$ implies
%that $C \simeq C^{(p)}$.
%{\color{red}Then $C$ descends to a curve over $\F_p$ by the Galois descent theory.}
%\end{proof}

Now we prove Proposition \ref{PropositionGeneralFiniteFields}.

\begin{proof}[Proof of Proposition \ref{PropositionGeneralFiniteFields}]
Let $C$ be a superspecial curve over $k$ of genus $g$.
Let $\SSp_C(\F_{p^a})$ be the set of
$\F_{p^a}$-isomorphism classes of superspecial curves $C'$ over $\F_{p^a}$
such that $C'\otimes_{\F_{p^a}} k \simeq C$.
It suffices to construct a bijection from $\SSp_C(\F_{p^a})$ and $\SSp_C(\F_{p^{a+2}})$.

%For each representative $C$
%of $k$-isomorphism classes of superspecial curves of genus $g$,
%We choose a $C_0$ over $\F_{p^2}$
%such that $C = C_0\otimes_{\F_{p^2}} k$ and any automorphism of $C_0$
%is defined over $\F_{p^2}$,
%and fix $\varphi_2: C^{(p^2)}\simeq C$.

It suffices to construct a bijection from the set of descent data of $C$ with respect to $k/\F_{p^a}$
to that with respect to $k/\F_{p^{a+2}}$.
Since $|\Aut(C)|<\infty$, it is enough to give
a bijection from the set of isomorphisms $C^{(p^a)} \to C$
to that of isomorphisms $C^{(p^{a+2})} \to C$.
%For cyclic extension, it suffices to give the image of
%the generator of the Galois group.
It is well-kwown that $C$ is defined over $\F_{p^2}$,
see the proof of \cite{Ekedahl}, Theorem 1.1.
Hence there exists an isomorphism  $\varphi_2: C^{(p^2)}\simeq C$.
Let $\varphi_a: C^{(p^a)} \to C$ be an isomorphism.
To $\varphi_a$ we associate an isomorphism
$\varphi_{a+2}: C^{(p^{a+2})} \to C$ by
$\varphi_{a+2} =  \varphi_a\circ\varphi_2^{(p^a)}$.
This clearly gives a desired bijection.
%Let $a\equiv b\ (\modulo 2)$.
%Let $\F$ denote $\F_p$ if $a$ is odd
%and $\F_{p^2}$ otherwise.
%We choose a set of superspcial curves over $\F$ \[ C_1,\ C_2,\ \ldots,\ C_h \] such that $(C_i)_k$ is not isomorphic to $(C_j)_k$ if $i\ne j$ and any $C$ over $k$ which is descendible to $\F$ is isomorphic to $(C_i)_k$ for some $i$.
%Thanks to the above lemma,
%any superspecial curve over $\F_{p^a}$
%is an $\F_{p^a}$-form of $C_i\otimes_\F \F_{p^a}$.
%This induces a bijection
%\[
%\SSp(\F_{p^a}) \simeq \bigsqcup_{i=1}^h H^1(\Gamma_{p^a}, A_i),
%\]
%where $\Gamma_q = \Gal(k/\F_q)$ and $A_i := \Aut((C_i)_k)$.
%%Let $\Gamma = \Gal(k/\F)$.
%Hence it suffices to construct a canonical bijection \[ H^1(\Gamma_{p^a}, A_i) \simeq H^1(\Gamma_{p^b}, A_i) \] for each $i=1,\ldots,h$.
%The bijection is given by the property that the image of the frobenius $\sigma_a \in\Gamma_{p^a}$ is equal in $A_i$ to the image of the frobenius $\sigma_b\in\Gamma_{p^b}$.
%Indeed let $\sigma_a^j \mapsto \alpha_{\sigma_a^j}$ be a $1$-cocyle representing an element of $H^1(\Gamma, A_i)$.
%Since any element of $A_i$ is defined over $\F_{p^2}$, we have that $\sigma^2$ acts trially on $A_i$.
%Then $\sigma_b^j \mapsto \beta_{\sigma_b^j}:=\alpha_{\sigma_a^j}$ gives a $1$-cocycle, since \[ \beta_{\sigma_b^j}\beta_{\sigma_b^l}^{\sigma_b^j}
%= \alpha_{\sigma_a^j}\alpha_{\sigma_a^l}^{\sigma_b^j}
%= \alpha_{\sigma_a^j}\alpha_{\sigma_a^l}^{\sigma^{bj}}
%= \alpha_{\sigma_a^j}\alpha_{\sigma_a^l}^{\sigma^{aj}}
%= \alpha_{\sigma_a^j}\alpha_{\sigma_a^l}^{\sigma_a^{j}}
%= \alpha_{\sigma_a^{j+l}}
%= \beta_{\sigma_b^{j+l}}.
%\]
%Thus we obtain a natural map from
%$H^1(\Gamma_{p^a}, A_i)$ to $H^1(\Gamma_{p^b}, A_i)$.
%This is bijective, as the inverse map is obtained by replacing the roles of $a$ and $b$.
\end{proof}






section3_PF.tex
\section{Reduction of cubic forms}\label{SectionReduction}
Let $p$ be a prime greater than $2$ and $q$ a power of $p$.
Let $\F_q$ be a field consisting of $q$ elements.
We have seen in Section \ref{CurvesGenus4} that
an arbitrary nonhyperelliptic curve of genus $4$ over $\F_q$
is written as $V(P,Q)$ in ${\mathbf P}^3$ where
$P$ is an irreducible cubic form over $\F_q$ and $Q$ is an irreducible quadratic form over $\F_q$.
By the classification theory of quadratic forms, $Q$ is isomorphic to
either of 
{\bf (N1)} $2xw + 2yz$,
{\bf (N2)} $2xw + y^2 - \epsilon z^2$ for $\epsilon\in \F_q^\times \smallsetminus (\F_q^\times)^2$
and {\bf (Dege)} $2yw + z^2$
(cf. \cite[Remark 2.1.1]{KH16}).
Thus we may assume that $Q$ is one of them.
%as in Remark \ref{QuadFormOverFiniteField}.
We denote by $\varphi$ the symmetric matrix associated to $Q$.
Let $\gO_\varphi(K)$ and $\tilde \gO_\varphi(K)$
be the orthogonal group
$\{g \in \GL_4(K) \mid {}^t g \varphi g = \varphi\}$
and
the orthogonal similitude group
$\{g \in \GL_4(K) \mid {}^t g \varphi g = \mu \varphi \text{ with } \mu\in K^\times\}$ respectively.
%As $\mu$ is determined by $g$, we call $\mu=\mu(g)$ the similitude of $g$.
The aim of this section is
to reduce 
the number of indeterminates
in the coefficients in $P$,
considering transformations by elements of $\tilde \gO_\varphi(\F_q)$.
But here we will assume that $V(P,Q)$ has a rational points.
So we start with recalling the fact that
there exists at least one rational point on any superspecial curve over $\F_q$.

\subsection{Existence of rational points on a superspecial curve}
Let $C$ be a curve over a field $K$ of characteristic $p$,
and $J(C)$ its Jacobian variety.
The $p$-rank of $C$ is the rank of the $\Z/p\Z$-module $\Ker(p: J(C)(\overline K) \to J(C)(\overline K)$).
If $C$ is superspecial, then $J(C_{\overline K})$ is a product of supersingular elliptic curves
and therefore its $p$-rank is zero.
It is known that the Frobenius map is nilpotent on $H^1_{\dR}(C)$ if and only if the $p$-rank of $C$ is zero.
The next lemma implies the existence of 
an $\F_q$-rational point on any curve of $p$-rank $0$ over $\F_q$.

\begin{lem}\label{RationalPointOnSSp}
Let $C$ be a curve of $p$-rank $0$ over $\F_q$.
We have
\[
\sharp C(\F_q) \equiv 1 \modulo p.
\]
%In particular any superspecial curve $C$ over $\F_q$ has an $\F_q$-rational point.
\end{lem}
\begin{proof}
Write $q = p^a$ and let $W$ be the ring of Witt vectors $W(\F_q)$.
Thanks to the Lefschetz trace formula by Berthelot
\cite{Berthelot}, Chap.~VII, 3.1, Cor. 3.1.11 on p.~581, we have
\[
\sharp C(\F_q) = 1 + q - \Tr(F^a: H^1_{\cris}(C,W)\to H^1_{\cris}(C,W)).
\]
As $H^1_{\cris}(C,W)/pH^1_{\cris}(C,W)=H^1_{\dR}(C)$, 
it suffices to show that the trace of $F^a$ on $H^1_{\dR}(C)$ is zero.
This follows from 
the fact that $F^a$ on $H^1(C,{\mathcal O}_C)$ is
nilpotent if $C$ is of $p$-rank $0$.
%zero for superspecial $C$
%and $F^a$ is zero on $H^0(C,\Omega_C^1)$ with the exact sequence
%$0 \to H^0(C,\Omega_C^1) \to H^1_{\dR}(C) \to H^1(C,{\mathcal O}_C) \to 0$.
%we have $\Tr(F^a: H^1_{\dR}(C)\to H^1_{\dR}(C)) = 0$.
\end{proof}
%{\color{red} This holds for $C$ of $p$-rank $0$.}

\subsection{The orthogonal groups in the non-degenerate case}\label{non-degenerate case}
The symmetric matrix $\varphi$ of $Q$ in each case of (N1) and (N2) is respectively
%Consider the case that $\varphi$ is non-degenerate. There are two cases:
%In this case, $\varphi$ is equivalent to either of the followings
\[
\text{\bf (N1)}\quad
\begin{pmatrix}
0 & 0 & 0 & 1\\
0 & 0 & 1 & 0\\
0 & 1 & 0 & 0\\
1 & 0 & 0 & 0
\end{pmatrix},
\qquad \text{\bf (N2)}\quad
\begin{pmatrix}
0 & 0 & 0 & 1\\
0 & 1 & 0 & 0\\
0 & 0 & -\epsilon & 0\\
1 & 0 & 0 & 0
\end{pmatrix},
\]
where $\epsilon\in K^\times\smallsetminus(K^\times)^2$.
Recall the Bruhat decomposition of the orthogonal (similitude) group
\[
\gO_\varphi(K)=\gB\gW\gU \quad\text{and}\quad \tilde\gO_\varphi(K)=\tilde \gB \gW \gU
\]
with $\gB=\gA\gT\gU$ and $\tilde \gB = \gA\tilde \gT \gU$, where $\gA$,$\gT$,$\tilde\gT$, $\gW$ and $\gU$ in each case are given as follows.

\noindent{\bf (N1)} 
%Set $\gB = \gA\gT\gU$ and $\tilde \gB = \gA\tilde \gT \gU$, where 
Set $\gT = \{\diag(a,b,b^{-1},a^{-1}) \mid a,b\in K^\times\}$ and
$\tilde \gT = \{\diag(a,b,cb^{-1},ca^{-1}) \mid a,b,c\in K^\times\}$,
%\[
%U_1(a) = 1_4 + a E_{1,2} - a E_{3,4},\qquad U_2(b) = 1_4 + b E_{1,3} - b E_{2,4}.
%\]
%\[
%U = \{U_1(a)U_2(b) \mid a,b\in K\}
%\]
\[
\gU = \left\{ \left. \begin{pmatrix}1&a&0&0\\0&1&0&0\\0&0&1&-a\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&b&0\\0&1&0&-b\\0&0&1&0\\0&0&0&1\end{pmatrix}\right| a,b\in K\right\},\quad \gA = \left\{1_4, 
\begin{pmatrix}
1&0&0&0\\
0&0&1&0\\
0&1&0&0\\
0&0&0&1
\end{pmatrix}\right\}
\]
and $\gW:=\{1_4, s_1, s_2, s_1s_2\}$ with
\[
s_1 = \begin{pmatrix}
0&1&0&0\\
1&0&0&0\\
0&0&0&1\\
0&0&1&0
\end{pmatrix},\quad
s_2 = \begin{pmatrix}
0&0&1&0\\
0&0&0&1\\
1&0&0&0\\
0&1&0&0
\end{pmatrix}.
\]
%\[
%W = \{1_4, s_1, s_2, s_1s_2, s_2s_1, s_1s_2s_1, s_2s_1s_2, s_1s_2s_1s_2\}.
%\]
%Let $\gW:=\{1_4, s_1, s_2, s_1s_2\}$.
%Set $W^- := \tau W^+$ and
%$W = W^+\sqcup W^-$.
%We have $\SO_\varphi(K)=BWU$, $\gO_\varphi(K)=ABWU$ and 
%$\tilde \gO_\varphi(K)=A\tilde BWU$.
%We shall use the Bruhat decomposition
%(but this paper uses only $\tilde B W U \subset \tilde\gO_\varphi(K)$).
%\begin{lem}
%We have
%\[
%\gO_\varphi(K)=\gB\gW\gU \quad\text{and}\quad \tilde\gO_\varphi(K)=
%\tilde \gB \gW \gU.
%\]
%\end{lem}
%This paper uses only the easy part
%$\tilde\gO_\varphi(K)\supset \tilde \gB \gW \gU$.
%Remark that $\gA$ is introduced so that
%it is naturally isomorphic to $\gO_\varphi(K)/\SO_\varphi(K)$.

%\begin{proof}[Outline of proof of the Bruhat decomposition (to be erased)]
%Let $X=(x_{ij})\in \tilde \gO_\varphi(K)$.
%Note that $X\in \tilde \gB$ if and only if $x_{21}=x_{31}=x_{41}=0$
%(checked by using Groebner basis).
%One can check that if $x_{41}\ne 0$ then $X\in \tilde \gB s_1s_2 \gU$
%(the $\gU$-part is determined so that it eliminates $x_{42},x_{43}$).
%Consider the case that $X\not\in \gB$.
%If $x_{41}=0$, then we have (i) $x_{21}=x_{22}=x_{42}=0$, $x_{31}\ne 0$
%or (ii) $x_{21}=x_{23}=x_{43}=0$, $x_{31}\ne 0$ or
%(iii) $x_{31}=x_{32}=x_{42}=0$, $x_{21}\ne 0$
%or (iv) $x_{31}=x_{33}=x_{43}=0$, $x_{21}\ne 0$
%(checked by using Groebner basis).
%In (i),(iii) case $X$ belongs to $\tilde \gB s_1 \gU$
%(the $\gU$-part is determined so that it eliminates
%$x_{*2},x_{*3}$ ($*=3,2$)) and
%in (ii),(iv) case $X$ belongs to $\tilde \gB s_2 \gU$
%(the $\gU$-part is determined so that it eliminates $x_{42},x_{43}$).
%\end{proof}

\noindent{\bf (N2)} Set
$\gA:=\{1_4, \diag(1,1,-1,1)\}$,
%t:=\diag(1,1,-1,1).
\[
\gU=\left\{\left.\begin{pmatrix}
1 & a & 0 & -a^2/2\\
0 & 1 & 0 & -a\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
1 & 0 & b & b^2/(2\epsilon)\\
0 & 1 & 0 & 0\\
0 & 0 & 1 & b/\epsilon\\
0 & 0 & 0 & 1
\end{pmatrix}
\right| a,b \in K
\right\},
\]
\[
\gW:=\left\{1_4, \begin{pmatrix}
0 & 0 & 0 & 1\\
0 & 1 & 0 & 0\\
0 & 0 & -1 & 0\\
1 & 0 & 0 & 0
\end{pmatrix}\right\},\quad
\tilde \gC=\left\{\left.
R(a,b):=\begin{pmatrix}
1 & 0 & 0 & 0\\
0 & a & \epsilon b & 0\\
0 & b & a & 0\\
0 & 0 & 0 & a^2-\epsilon b^2
\end{pmatrix} \right|
\begin{matrix}
a,b\in K,\\
a^2 -\epsilon b^2 \ne 0
\end{matrix}
\right\}.
\]
Put $\gC = \{R(a,b)\in \tilde \gC \mid a^2-\epsilon b^2 = 1\}$
and $\gT=\gH\gC$ and $\tilde \gT= \gH\tilde \gC$,
where $\gH=\{\diag(a,1,1,a^{-1})\mid a \in K^\times\}$.

%$\gB=\gA\gT\gU$ and $\tilde \gB = \gA\tilde{\gT}\gU$.
%\begin{lem}
%We have the Bruhat decomposition
%\[
%\gO_\varphi(K) = \gB \gW \gU
%\quad\text{and}\quad
%\tilde \gO_\varphi(K) = \tilde \gB \gW \gU.
%\]
%$\gO_\varphi(K) = B \sqcup BsU$ and 
%$\tilde \gO_\varphi(K) = \tilde B \sqcup \tilde BsU$.
%\end{lem}
%We shall use only the easy part $\tilde\gO_\varphi(K)\supset \tilde \gB \gW \gU$.
%Remark that $\gA$ is introduced so that
%it is naturally isomorphic to $\gO_\varphi(K)/\SO_\varphi(K)$.
When we consider the reduction of cubic forms for (N2), we shall use
\begin{lem}[\cite{KH16}, Lemma 4.1.1]\label{RepresentationRotationGroup}
Let $V$ be the vector space consisting of cubics in $y,z$ over $K$.
Consider the natural representation of $\tilde \gC$ on $V$.
\begin{enumerate}
\item[\rm (1)]
The representation $V$ is the direct sum of two subrepresentations $V_1:=\langle y(y^2-\epsilon z^2), z(y^2-\epsilon z^2)\rangle $
and $V_2:=\langle y(y^2+3\epsilon z^2), z(3y^2+\epsilon z^2)\rangle$.
%\item[\rm (2)] $\tilde C$ is isomorphic to ${\tilde K}^\times$
%with $\tilde K=K(\sqrt{-(-\epsilon)})$.
%The representation $V_1$ of $\tilde C$
%is equivalent to
%the representation on $\F_{q^2}$ of $\F_{q^2}^\times$ defined by
%$v\mapsto k^{q+2}v$ for $k \in \F_{q^2}^\times$ and $v\in \F_{q^2}$.
\item[\rm (2)]
$V_1$ consists of four $\tilde \gC$-orbits in $V_1$. They are the orbits
of $\delta y(y^2-\epsilon z^2)$ with $\delta \in \{0\} \cup K^\times/(K^\times)^3$ respectively.
\end{enumerate}
\end{lem}

\subsection{The orthogonal groups in the degenerate case}\label{degenerate case}
%Let $\varphi$ be the symmetric matrix associated to $Q$ as in Remark \ref{QuadFormOverFiniteField}.
The symmetric matrix $\varphi$ for the degenerate case is
\[
\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & 0 & 0 & 1\\
0 & 0 & 1 & 0\\
0 & 1 & 0 & 0
\end{pmatrix}.
\]
As shown in \cite[Lemma 4.2.1]{KH16} we have the Bruhat decomposition:
\[
\gO_\varphi(K) = (\gB \sqcup \gB s \gU) \gV \quad\text{and}\quad 
\tilde \gO_\varphi(K) = (\tilde \gB \sqcup \tilde \gB s \gU) \gV
\]
with $\gB:=\gA \gT \gU$ and $\tilde \gB := \gA \tilde \gT \gU$, where
%where $\epsilon\in K^\times$ is a representative of $K^\times/(K^\times)^2$.
$\gA:=\{1_4, \diag(1,1,-1,1)\}$,
\[
\gT:=\left\{\left. T(a):=\begin{pmatrix}
1&0&0&0\\
0&a&0&0\\
0&0& 1&0\\
0&0&0&a^{-1}\end{pmatrix} \right| a \in K^\times\right\},\quad
\gU := \left\{\left. U(a):=\begin{pmatrix}
1&0&0&0\\
0&1&a&a^2(2\epsilon)^{-1}\\
0&0&1&a \epsilon^{-1}\\
0&0&0&1\end{pmatrix} \right| a \in K\right\},
%,\quad
%\tilde T:=\left\{\left.\begin{pmatrix}
%1&0&0&0\\
%0&ab&0&0\\
%0&0&b&0\\
%0&0&0&a^{-1}b\end{pmatrix} \right| a,b \in K^\times\right\}
\]
\[
s:=\begin{pmatrix}
1&0&0&0\\
0&0&0&1\\
0&0&1&0\\
0&1&0&0\end{pmatrix},\quad
\gV=\left\{\left.\begin{pmatrix}
a&b&c&d\\
0&1&0&0\\
0&0&1&0\\
0&0&0&1\end{pmatrix} \right| a\in K^\times \text{ and } b, c, d\in K\right\}
\]
and $\tilde \gT := \{\diag(1,b,b,b) \mid b\in K^\times\} \gT$.
%Recall 
%\begin{lem}
%%Assume (for safety) that $K$ is a finite field of odd characteristic.
%% {\rm (1)} $\gO_\varphi(K) = (B \sqcup BsU) V$ and {\rm (2)} $\tilde \gO_\varphi(K) = (\tilde B \sqcup \tilde BsU) V$.
%\begin{enumerate}
%\item[\rm (1)] $\gO_\varphi(K) = (\gB \sqcup \gB s \gU) \gV$.
%\item[\rm (2)]
%$\tilde \gO_\varphi(K) = (\tilde \gB \sqcup \tilde \gB s \gU) \gV$.
%\end{enumerate}
%\end{lem}

\subsection{Reduction of cubic forms in the case of (N1)}
Let $K$ be a field of characteristic $p\ne 2$.
Consider the case of $Q=2xw+2yz$.
Let $P$ be an irreducible cubic form in $x,y,z,w$ over $K$.
Assume that $C=V(P,Q)$ has a $K$-rational point.
We use the notation in Section \ref{non-degenerate case} (N1).
\begin{enumerate}
\item[1.] Considering $\modulo Q$, it suffices to consider only $P$ which has no term containing $xw$.
\begin{eqnarray}\label{N1_GeneralFormOfP}
P &= & a_1 x^3 + (a_2y+a_3z)x^2+(a_4y^2 + a_5yz + a_6z^2)x \nonumber\\
&& + a_7y^3 + a_8y^2 z + a_9y z^2 + a_{10}z^3\\
&& + (a_{11}y^2+a_{12}yz+a_{13}z^2)w + (a_{14}y+a_{15}z)w^2 + a_{16}w^3. \nonumber
\end{eqnarray}
\item[2.] 
By the assumption $C(K)\ne\emptyset$ and considering the action of $\gW$,
there is a rational point with non-zero $w$-coordinate.
Let $(-bc, b, c, 1)$ be such a $K$-rational point on $C$,
%, see Lemma \ref{RationalPointOnSSp}.
which provides us an element of $\gO_\varphi(K)$
\[
\begin{pmatrix}
-bc & -b & -c & 1\\
b & 0 & 1 & 0\\
c & 1 & 0 & 0\\
1 & 0 & 0 & 0
\end{pmatrix}.
\]
Let $P'$ be the cubic obtained by transforming $P$ by this element.
%Let $a_1',\ldots,a'_{16}$ be the coefficients of $P'$
%as in \eqref{N1_GeneralFormOfP}.
One can check that the $x^3$-coefficient of $P'$ is $P(-bc,b,c,1)=0$.
Thus we may assume that
the $x^3$-coefficient $a_1$ of $P$ is zero.
%$P$ has $a_1 = 0$.
%\[
%a_1 = 0,\quad a_2\ne 0, \quad a_3\ne 0.
%\]
\item[3.]
\begin{enumerate}
\item[$\bullet$] If $a_2\ne 0$ or $a_3 \ne 0$, then
considering $y\leftrightarrow z$, we may assume $a_2 \ne 0$.
Then the transformation of an element of $\gU$ eliminates the $xy^2$-term and the $xyz$-term from $P$.
\item[$\bullet$] The case of $a_2=a_3=0$.
In this case $C$ is singular at $(1,0,0,0)$.
\end{enumerate}
\item[4.] The composition of a certain element
($x\mapsto cx, w\mapsto w/c$, $y\mapsto dy, z\mapsto z/d$) of $\gT$ and
a constant-multiplication to the whole $P$
transforms $P$ into a cubic where
the $x^2y$-coefficient is $1$ and the $x^2z$-coefficient is $0$
or a representative of an element of $K^\times/(K^\times)^2$
and the $xz^2$-coefficient is in $\{0,1\}$.
\end{enumerate}

\begin{lem}\label{NewReductionLemmaN1}
An element of $\tilde\gO_\varphi(K)$ transforms $P$ into
\begin{eqnarray*}
&& (y + b_1 z)x^2  + b_2 xz^2 \\
&&+ a_1 y^3 + a_2 y^2z + a_3 yz^2 +  a_4 z^3 \\
&&  + (a_5 y^2 + a_6 yz + a_7 z^2)w + (a_8y + a_9z)w^2 + a_{10}w^3,
\end{eqnarray*}
for $a_1,\ldots,a_{10}\in K$
and for $b_1\in\{0\}\cup K^\times/(K^\times)^2$ and $b_2\in\{0,1\}$.
\end{lem}


%\subsection{Reduction for (N1)}
%\begin{enumerate}
%\item[1.] Considering $\modulo Q$, we may consider only $P$ which does not have any term containing $xw$.
%\begin{eqnarray}\label{N1_GeneralFormOfP}
%P &= & a_1 x^3 + (a_2y+a_3z)x^2+(a_4y^2 + a_5yz + a_6z^2)x \nonumber\\
%&& + a_7y^3 + a_8y^2 z + a_9y z^2 + a_{10}z^3\\
%&& + (a_{11}y^2+a_{12}yz+a_{13}z^2)w + (a_{14}y+a_{15}z)w^2 + a_{16}w^3. \nonumber
%\end{eqnarray}
%\item[2.] 
%Let $(-bc, b, c, 1)$ be a $K$-rational point on $C$, see Lemma \ref{RationalPointOnSSp}.
%We have an element of $\gO_\varphi(K)$
%\[
%\begin{pmatrix}
%-bc & -b & -c & 1\\
%b & 0 & 1 & 0\\
%c & 1 & 0 & 0\\
%1 & 0 & 0 & 0
%\end{pmatrix},
%\]
%which transforms $P$ into a cubic, say $P'$.
%%Let $a_1',\ldots,a'_{16}$ be the coefficients of $P'$
%%as in \eqref{N1_GeneralFormOfP}.
%One can check that the $x^3$-coefficient of $P'$ is $P(-bc,b,c,1)=0$.
%Thus we may assume that $P$ has
%$a_1 = 0$.
%%\[
%%a_1 = 0,\quad a_2\ne 0, \quad a_3\ne 0.
%%\]
%\item[3.]
%\begin{enumerate}
%\item[$\bullet$] If $a_2\ne 0$ or $a_3 \ne 0$, then
%considering $y\leftrightarrow z$, we may assume $a_2 \ne 0$.
%By the action of an element of $\gU$, we can eliminate the terms of $xy^2, xyz$ from $P$.
%%Thus we may assume that $P$ has
%%$a_1 = 0, a_2\ne 0, a_3\ne 0, a_4=0, a_6=0$.
%\item[$\bullet$] The case of $a_2=a_3=0$.
%In this case $C$ is singular at $(1,0,0,0)$.
%%(iii) If $a_4\ne 0$, then
%%by the action of an element of $\gU$, we can eliminate the terms of $y^3, y^2z$% from $P$.
%%(iv) If $a_4 = 0$, then
%%considering $y\leftrightarrow z$, we may assume $a_6=0$.
%%Then the action of an element of $\gU$, we can eliminate the terms
%%of $xy^2, xyz$ from $P$.
%%Thus we may assume that $P$ has
%%$a_1 = 0, a_2\ne 0, a_3\ne 0, a_4=0, a_6=0$.
%\end{enumerate}
%\item[4.] Composing some element ($y\mapsto cy, z\mapsto z/c$) of $\gT$ and some constant-multiplication to the whole $P$, we transform $P$ into a cubic where
%\begin{enumerate}
%\item[(i)]
%the $y^3$-coefficient is $1$ and the $y^2z$-coefficient is $0$
%or a representative of an element of $K^\times/(K^\times)^2$, or
%\item[(ii)] the $y^3$-coefficient is $0$;
%%considering $y\leftrightarrow z$, we may assume that the $z^3$-coefficient is also $0$;
%the $y^2z$-coefficient is $0$ or $1$;
%and the $yz^2$-coefficient is $0$ or a representative of an element of $K^\times/(K^\times)^2$
%%\item[(iii-iv)] the $yz^2$-coefficient is $0$ or $1$;
%%and the $z^3$-coefficient is $0$ or a representative of
%%an element of $K^\times/(K^\times)^2$
%\end{enumerate}
%\item[5.] An element $(x\mapsto dx, w\mapsto w/d)$ of $\gT$ transforms $P$
%into one whose coefficient of $z^2w$ is $0$ or $1$.
%%{\color{red}
%%\item[5.] An element $(x\mapsto dx, w\mapsto w/d)$ of $T$ transform $P$ into one
%%whose coefficient of $yzw$ is $0$ or $1$.
%\end{enumerate}
%
%\begin{lem}\label{ReductionLemmaN1}
%An element of $\tilde\gO_\varphi(K)$ transforms $P$ into
%
%\begin{enumerate}
%\item[\rm (i)]for $a_i\in K$
%with $a_1\ne 0$ 
%and for $b_1\in\{0\}\cup K^\times/(K^\times)^2$ and $b_2\in\{0,1\}$,
%%$(a_1 y + a_2 z)x^2  + a_3 yzx
%% + y^3 + a_4 z^3 + b_1 y^2z + a_5 yz^2
%% + (a_6 y^2 + a_7 yz + b_2 z^2)w + (a_8y + a_9z)w^2 + a_{10}w^3$
%\begin{eqnarray*}
%&& (a_1 y + a_2 z)x^2  + a_3 xz^2 \\
%&&+ y^3 + b_1 y^2z + a_4 yz^2 +  a_5 z^3 \\
%&&  + (a_6 y^2 + a_7 yz + b_2 z^2)w + (a_8y + a_9z)w^2 + a_{10}w^3,
%\end{eqnarray*}
%\item[\rm (ii)] for $a_i\in K$ with $a_1\ne 0$
%and for $b_1\in\{0,1\}$, $b_2\in\{0\}\cup K^\times/(K^\times)^2$ and $b_3\in\{0,1\}$,
%%$(a_1 y + a_2 z)x^2  + a_3 yzx
%%  + b_1 y^2z + b_2 yz^2
%%  + (a_4 y^2 + a_5 yz + b_3 z^2)w + (a_6 y + a_7 z)w^2 + a_8 w^3$
%\begin{eqnarray*}
%&& (a_1 y + a_2 z)x^2  + a_3 xz^2 \\
%&& + b_1 y^2z + b_2 yz^2 + a_4 z^3 \\
%&&  + (a_5 y^2 + a_6 yz + b_3 z^2)w + (a_7 y + a_8 z)w^2 + a_9 w^3.
%\end{eqnarray*}
%%\item[\rm (iii)]
%%for $a_1\ne 0$ and 
%%for $b_1\in\{0,1\}$, $b_2\in\{0\}\cup K^\times/(K^\times)^2$, $b_3\in\{0,1\}$,
%%\begin{eqnarray*}
%%&&a_1x^2y+a_2xz^2\\
%%&& + b_1y^3 + b_2y^2 z + a_3y z^2 + a_4z^3\\
%%&& + (a_5y^2+a_6yz+b_3 z^2)w + (a_7y+a_8z)w^2 + a_9w^3. 
%%\end{eqnarray*}
%%\item[\rm (iii)]{\color{red} (will be removed)}
%%for $a_1\ne 0$ and for $b_1\in\{0,1\}$,
%%$b_2\in\{0\}\cup K^\times/(K^\times)^2$, $b_3\in\{0,1\}$,
%%\begin{eqnarray*}
%%&& (a_1y^2 + a_2yz + a_3z^2)x \\
%%&& + b_1y z^2 + b_2z^3\\
%%&& + (a_4y^2+a_5yz+b_3z^2)w + (a_6y+a_7z)w^2 + a_8w^3. 
%%\end{eqnarray*}
%%\item[\rm (iv)] {\color{red} (will be removed)}
%%for $b_1\in\{0,1\}$, $b_2\in\{0\}\cup K^\times/(K^\times)^2$, $b_3\in\{0,1\}$,
%%\begin{eqnarray*}
%%&& a_1xyz \\
%%&& + a_2y^3 + a_3y^2 z + b_1 y z^2 + b_2 z^3\\
%%&& + (a_4y^2+a_5yz + b_3 z^2)w + (a_6y+a_7z)w^2 + a_8w^3. 
%%\end{eqnarray*}
%\end{enumerate}
%\end{lem}


\subsection{Reduction of cubic forms in the case of (N2)}
Let $K$ be a field of characteristic $p\ne 2,3$.
Recall that
the quadratic form in (N2) case is $Q=2xw + y^2 - \epsilon z^2$, where
$\epsilon \not\in(K^\times)^2$.
Consider an irreducible cubic form $P$ in $K[x,y,z,w]$.
Assume that $C=V(P,Q)$ has a $K$-rational point.
We use the notation in Section \ref{non-degenerate case} (N2).
%Let $P=P(x,y,z,w)$ be an irreducible cubic form in $x,y,z,w$.
%We consider a reduction of $P$
%by an element of $\tilde \gO_\varphi(K)$,
%under the assumption
%\begin{quote}
%{\bf (A2)} $C$ has a $K$-rational point where 
%\[
%w = 1,\quad R_y(y,z):=\dfrac{\partial}{\partial y}P\left(-\dfrac{y^2 -\epsilon %z^2}{2},y,z,1\right) \ne 0,
%\quad%\text{and}\quad
%R_z(y,z):=\dfrac{\partial}{\partial z}P\left(-\dfrac{y^2 -\epsilon z^2}{2},y,z,%1\right) \ne 0.
%\]
%\end{quote}
%We shall see that this assumption is satisfied if $C$ has
%sufficiently many $K$-rational points, see Remark \ref{Remark A2} (1) below.
%Assume that $C$ has sufficiently many rational points.
\begin{enumerate}
\item[1.] Considering $\modulo Q$, it suffices to consider only $P$ which has no term containing $xw$, \eqref{N1_GeneralFormOfP}.
%Considering $\modulo Q$, we may consider only $P$
%which does not have any term containing $xw$,
%see \eqref{N1_GeneralFormOfP}.
%\begin{eqnarray}\label{N2_GeneralFormOfP}
%P &= & a_1 x^3 + (a_2y+a_3z)x^2+(a_4y^2 + a_5yz + a_6z^2)x \nonumber\\
%&& + a_7y^3 + a_8y^2 z + a_9y z^2 + a_{10}z^3\\
%&& + (a_{11}y^2+a_{12}yz+a_{13}z^2)w + (a_{14}y+a_{15}z)w^2 + a_{16}w^3. \nonumber
%\end{eqnarray}
%\begin{eqnarray*}
%P &=& a_1 x^3 + (a_2y+a_3z)x^2+(a_4y^2 + a_5yz + a_6z^2)x\\
%&& + a_7y^3 + a_8y^2 z + a_9y z^2 + a_{10}z^3\\
%&& + (a_{11}y^2+a_{12}yz+a_{13}z^2)w + (a_{14}y+a_{15}z)w^2 + a_{16}w^3.
%\end{eqnarray*}
\item[2.] 
By the assumption, we have a $K$-rational point $(r,s,t,u)$ on $C$.
If both of $r$ and $u$ were zero,
then $Q(r,s,t,u)=0$ implies $s=t=0$.
Hence $r\ne 0$ or $u\ne 0$.
Considering the action of $\gW$, we may assume $u\ne 0$.
Let $(-(b^2-\epsilon c^2)/2, b, c, 1)$ be such a rational point on $C$,
%For a rational point $(-(b^2-\epsilon c^2)/2, b, c, 1)$ of $C(K)$, 
which provides us an element of $\gO_\varphi(K)$
\[
\begin{pmatrix}
-(b^2-\epsilon c^2)/2 & -b & \epsilon c & 1\\
b & 1 & 0 & 0\\
c & 0 & 1 & 0\\
1 & 0 & 0 & 0
\end{pmatrix}.
\]
Let $P'$ be the cubic obtained by 
transforming $P$ by this element.
%Let $a_1',\ldots,a'_{16}$ be the coefficients
%of $P'$ as in \eqref{N1_GeneralFormOfP}.
The $x^3$-coefficient of $P'$ is $P(-(b^2-\epsilon c^2)/2,b,c,1)=0$.
%and the $x^2y$-coefficient of $P'$ is $R_y(b,c)$
%and the $x^2z$-coefficient of $P'$ is $R_z(b,c)$.
%By assumption (A2), 
%there exists $(b, c)$ such that $a'_1 = 0, a'_2\ne 0, a'_3\ne 0$.
Thus we may assume that $P$ has $a_1 = 0$.
%, a_2\ne 0, a_3\ne 0$.
%\[
%a_1 = 0,\quad a_2\ne 0, \quad a_3\ne 0.
%\]
\item[3.] 
\begin{enumerate}
\item[$\bullet$] If $a_2\ne 0$ or $a_3\ne 0$,
an element of $\gU$ transforms $P$ into
a cubic of which $x^1$-coefficient is a constant-multiplication of 
$(y^2-\epsilon z^2)$, where we used $p\ne 3$.
\item[$\bullet$] If $a_2 = a_3 = 0$,
then $C$ is singular at $(1,0,0,0)$.
%we can eliminate the terms of $xyz$ from $P$
%and the coefficient of $xz^2$ is equal to $(-\epsilon)$ times the coefficient of $xy^2$.
\end{enumerate}
\item[4.] The composition of an element of $\tilde \gC$ and a constant-multiplication to the whole $P$ transforms
$P$ into a cubic whose terms only in $y,z$ is of the form
\[
\alpha y(y^2-\epsilon z^2) + \beta y(y^2+3\epsilon z^2) + \gamma z(3y^2+\epsilon z^2)
\]
for $\alpha\in\{0,1\}$ and some $\beta,\gamma \in K$. Here we use Lemma \ref{RepresentationRotationGroup}.

\item[5.] There is an element $(x\mapsto cx, w\mapsto w/c)$ of $\gH$ such that
it transforms $P$ into a cubic whose $z^2w$-term is $0$ or $1$.
\end{enumerate}

Thus we obtain the unconditional version of \cite[Lemma 4.4.1]{KH16}:

\begin{lem}\label{ReductionLemmaN2}
An element of $\tilde\gO_\varphi(K)$ transforms $P$ into the following form
\begin{eqnarray*}
&& (a_1 y + a_2 z)x^2  + a_3 (y^2-\epsilon z^2)x
+ b_1 y(y^2-\epsilon z^2) + a_4 y(y^2+3\epsilon z^2) + a_5 z(3y^2+\epsilon z^2)\\
&&  + (a_6 y^2 + a_7 yz + b_2 z^2)w + (a_8 y + a_9 z)w^2 + a_{10}w^3
\end{eqnarray*}
for some $a_i\in K$ with $(a_1,a_2)\ne (0,0)$
and for $b_1,b_2\in\{0,1\}$.
%where $a_1\in\F_q^\times$ and $a_2, \ldots, a_{11} \in \F_q$.
\end{lem}
%
\subsection{Degenerate case}\label{ReductionDegenerateCase}
We assume that $p\ne 2,3$.
The case of $q>5$ has been treated in \cite[Section 4.5]{KH16}.
Here we study the case of $q=5$. Assume $K=\F_5$ before the next lemma.
%\begin{enumerate}
%\item[\bf Case of $q=5$:]
\begin{enumerate}
\item[1.] An element ($x\mapsto x+ay+bz+cw$) of $\gV$
transforms $P$  into a cubic without
terms of $x^2y$, $x^2z$, $x^2w$. We may assume that
the coefficients of $x^2y$, $x^2z$, $x^2w$ of
$P$ are zero. 
\item[2.] Considering $\modulo Q$,
we may assume that there is no term containing $yw$ in $P$,
since $yw\equiv -2^{-1}z^2 \modulo Q$.
\item[3.]
\begin{enumerate}
\item[(I)] If there exists an element of $\gO_\varphi(\F_5)$ stabilizing $x$
which transforms $P$ into $P'$
with non-zero term of $y^3$,
an element of $\gU$ transforms $P'$ into one without term of $y^2z$,
and
the same reduction as steps 4, 5 in \cite[Section 4.5]{KH16}
works. The final reduced form is
as in Lemma \ref{ReductionLemmaDegenerate} (1) below,
which is of the same form as in the case of $q>5$.

\item[(II)] Otherwise $P$ has to be of the form
\begin{equation}\label{3-II}
a_0x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + a_5 zw)x + a_6(y^2z+zw^2).
\end{equation}
Indeed, we may consider only $P$ whose $y^3$-term and $w^3$-term
are zero, considering the action of $s$ (the transposition of $y$ and $w$).
The general form of $P$ is
\[
a_0x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + a_5 zw)x
+ a_6 y^2z + a_7 yz^2 + a_8 z^3 + a_9 z^2w + a_{10}zw^2.
\]
The element of $s\gU s$
given by $z\mapsto z-cy$, $w\mapsto w + cz - 2^{-1}c^2y$ for $c\in \F_5$
transforms $P$ into a cubic form,
whose $y^3$-coefficient is
\[
(a_{10}-a_6)c + a_7 c^2 - a_8 c^3 + 2a_9 c^4.
\]
This is zero for every $c\in\F_5$ if and only if
$a_6=a_{10}$ and $a_7=a_8=a_9=0$. 
As $P$ is irreducible, we have $a_6 \ne 0$.
\end{enumerate}
%$x$�𓮂����Ȃ�$G$�̌��� $y^3$�̍�������悤�ɂ��āi3����������ȂƂ��͕K���ł���H�v�`�F�b�N�j�A
%�Y�t�t�@�C����$U[1]$�̕ϊ�
%$x->x, y->y+az-a^2/2e w, z->z-a/e w, w->w$
%��$y^2z$�̍��������B
%\item[(4)] Multiplying a constant to the whole $P$, we may assume that the coefficient of $x^3$ is $1$. 
\end{enumerate}
Remaining steps in case (II):
\begin{enumerate}
\item[4.] 
Composing some element ($y\mapsto cy, w\mapsto w/c$) of $\gT$ and some constant-multiplication to the whole $P$, we transform $P$ into a cubic where
%\begin{enumerate}
%\item[(I)]
%the $y^3$-coefficient is $1$ and the $w^3$-coefficient is $0,1$ or $2$.
%\item[(II)] 
$a_6$ in (\ref{3-II}) is $1$
and $a_5$ is $0$ or $a_0^{1/3}$. Here we used $(\F_5^\times)^3 = \F_5^\times$.
%\end{enumerate}
\item[5.] The transformation $x\mapsto d\cdot x$ for a certain $d\in K^\times$ sends $P$ to a cubic whose coefficient of $x^3$ is $1$.
Then the coefficient of $xzw$ becomes $0$ or $1$ in case (II).
%\item[Conclusion:] An element of $\gO_\varphi(\F_5)$ transforms $P$ into either of the following forms
%\begin{enumerate}
%\item[(I)]
%\begin{eqnarray*}
%&& x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + a_5 zw)x\\
%&& + y^3 + a_6z^3 + \{0,1,2\}w^3 + a_7yz^2 + a_8z^2 w + a_9zw^2
%\end{eqnarray*}
%\item[(II)]
%\begin{equation*}\label{5-II}
%x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + \{0,1\} zw)x + y^2z + zw^2
%\end{equation*}
%\end{enumerate}
\end{enumerate}
%%\end{enumerate}

Summarizing this reduction for $q=5$ and that for $q>5$
obtained in \cite[Lemma 4.5.1]{KH16},
we have the following lemma:

\begin{lem}\label{ReductionLemmaDegenerate}
An element of $\tilde\gO_\varphi(K)$ transforms $P$ into the following form {\rm (1)} if $\sharp K > 5$,
and into either of the following forms {\rm (1)} and {\rm (2)} if $\sharp K = 5$.
\begin{enumerate}
\item[\rm (1)]
\begin{eqnarray*}
&& a_0x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + a_5 zw)x\\
&& + a_6y^3 + a_7z^3 + a_8 w^3 + a_9yz^2 + b_1 z^2 w + b_2 zw^2,
\end{eqnarray*}
for some $a_i\in K$ with $a_0, a_6\in K^\times$ and for $b_1,b_2\in\{0,1\}$,
where the leading coefficient of $R:=a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + a_5 zw$ is $1$ or $R=0$;
\item[\rm (2)]
\[
x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + b_1 zw)x + y^2z + zw^2
\]
for $a_i\in K=\F_5$ and $b_1\in\{0,1\}$.
\end{enumerate}
\end{lem}

section4_new_PF.tex
%=============================
\section{Main results}\label{sec:main_results}
%=============================

In this section, we prove Theorems \ref{MainTheorem} and \ref{MainTheorem2} with help of computational results.
The computational results shall be described in Section \ref{subsec:comp_result}.
We choose and fix a primitive element $\zeta^{(q)}$ of $\F_q$ for each of $q=5$ and $q=11$ throughout this section.

% Now we state our main results and prove them.
% We put computational parts of the proofs together in Section \ref{subsec:comp_result}.
% We choose a primitive element $\zeta$ of $\F_q$ for $q=5$ and $q=11$, and fix it throughout this section.

%=====================================================================
\subsection{Superspecial curves over $\mathbb{F}_{5}$ and $\mathbb{F}_{11}$}\label{subsec:sscurves}
%=====================================================================

\begin{theor}\label{MainTheorem}
There exist precisely $7$ superspecial curves of genus $4$ over $\mathbb{F}_{5}$ up to isomorphism over $\mathbb{F}_{5}$. 
The seven isomorphism classes are given by $C_i = V(Q, P_i)$ with $Q=2yw + z^2$ and
% \begin{eqnarray*}
% P_1 =&  x^3+y^3+w^3 & D_6,\\
% P_2 =& x^3+2y^3+w^3 & D_4,\\
% P_3 =& x^3+y^3+w^3+zw^2 & \Z/4\Z,\\
% P_4 =& x^3+y^3+2w^3+zw^2 & \Z/6\Z,\\
% P_5 =& x^3+y^3+3w^3+zw^2 & \Z/5\Z,\\
% P_6 =& x^3+y^3+4w^3+zw^2 & \Z/6\Z,\\
% P_7 =& x^3+y^2z+zw^2 & \fS_5.
% \end{eqnarray*}
\begin{eqnarray*}
P_1 & =&  x^3+y^3+w^3,\\
P_2 & =& x^3+2y^3+w^3,\\
P_3 & =& x^3+y^3+w^3+zw^2,\\
P_4 & =& x^3+y^3+2w^3+zw^2,\\
P_5 & =& x^3+y^3+3w^3+zw^2,\\
P_6 & =& x^3+y^3+4w^3+zw^2,\\
P_7 & =& x^3+y^2z+zw^2.
\end{eqnarray*}
$($Note that there exists precisely $1$ superspecial curve of genus $4$ over $\mathbb{F}_{5}$ up to isomorphism over the algebraic closure,
cf. $\mbox{\cite[Corollary 5.1.1]{KH16}}$.$)$
\end{theor}

\begin{proof}
% As mentioned in Section 1, there is no superspecial hyperelliptic curve in characteristic $5$.
% Let $C$ be a nonhyperelliptic curve of genus $4$ over $\mathbb{F}_{5}$.
% We have seen in Section 2.1 that $C$ is defined by an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $\F_{5} [x, y, z, w]$.
% By Remark 2.1.1 in \cite{KH16} and the first paragraph in Section 4.5 of \cite{KH16}, we may assume that $Q$ is either of (N1) $2xw+2yz$ and (N2) $2xw+y^2-\epsilon z^2$ in the non-degenerate case and is $2yw+z^2$ in the degenerate case.
% Here $\epsilon$ is an element in $\mathbb{F}_5^{\times} \smallsetminus ( \mathbb{F}_5^{\times})^2$.
Let $C$ be a curve of genus $4$.
Similarly to the proof of \cite[Theorem A]{KH16}, we may assume that $C$ is nonhyperelliptic, and written as $C=V(P,Q)$ for an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $\F_{5} [x, y, z, w]$.
We may also assume that $Q$ is either of (N1) $2xw+2yz$, (N2) $2xw+y^2-\epsilon z^2$, or (Dege) $2yw+z^2$, where $\epsilon$ is an element in $\mathbb{F}_5^{\times} \smallsetminus ( \mathbb{F}_5^{\times})^2$.
Moreover it suffices to consider the case (Dege), say $Q=2 y w + z^2$.
%
%
% First we claim that there does not exist $P$ such that $C=V(P,Q)$ is superspecial if $Q$ is non-degenerate.
% By Lemma 2.2.1 of \cite{KH16}, if such a superspecial curve exists, then it has a superspecial (maximal) curve over $\F_{25}$ as an $\F_{25}$-form, whose quadratic form is also non-degenerate.
% It follows from the proof of Theorem A in \cite{KH16} that such an $\mathbb{F}_{25}$-form does not exist.
%
% We consider the degenerate case: $Q=2 y w + z^2$.
% Lemma \ref{ReductionLemmaDegenerate} says that $C=V(P,Q)$ is $\F_{5}$-isomorphic to $V(P',Q)$ for some $P^{\prime}$ in the following form:
%
By Lemma \ref{ReductionLemmaDegenerate}, the cubic form $P$ is assumed to be of the following form:
\begin{enumerate}
\item
\begin{eqnarray*}
&& a_0x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + a_5 zw)x\\
&& + a_6y^3 + a_7z^3 + a_8 w^3 + a_9yz^2 + b_1 z^2 w + b_2 zw^2
\end{eqnarray*}
for $a_i\in K = \mathbb{F}_5$ and $b_1,b_2\in\{0,1\}$,
where $a_0, a_6\in K^\times = \mathbb{F}_5^{\times}$, or
\item[\rm (2)] 
\[
x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + b_1 zw)x + y^2z + zw^2
\]
for $a_i\in K=\F_5$ and $b_1\in\{0,1\}$.
\end{enumerate}
% By Proposition \ref{prop:Degenerate_q5} in Section \ref{subsec:comp_result}, $V (P', Q)$ is superspecial if and only if $P'$ is one of $P_i$ for $1 \leq i \leq 7$.
% The theorem summarizes these descriptions.
It follows from Proposition \ref{prop:Degenerate_q5} in Section \ref{subsec:comp_result} that $C=V (P, Q)$ is superspecial if and only if $P$ is one of $P_i$ for $1 \leq i \leq 7$.
%The theorem summarizes these descriptions.
\end{proof}


% Now we have a computational proof of the uniqueness of
% superspecial curve of genus $4$ over an algebraically closed field, see \cite{FGT} for the original and theoretical proof.
% \begin{cor}\label{MainCorollary}
% All superspecial curves of genus $4$ in characteristic $5$ are isomorphic to each other over an algebraically closed field.
% \end{cor}
% \begin{proof}
% It suffices to show that the curves in Theorem \ref{MainTheorem} are all isomorphic over an algebraically closed field.
% By $(y\mapsto \lambda\mu y,z\mapsto \mu z, w\mapsto \frac{\mu}{\lambda} w)$ we have
% \[
% x^3 + a_1 \lambda^3 \mu^3 y^3 + a_2 \frac{\mu^3}{\lambda^3} w^3 + a_3 \frac{\mu^3}{\lambda^2} zw^2=0.
% \]
% There exists $(\lambda,\mu)$ such that $a_1 \lambda^3 \mu^3=1$ and $a_2 \frac{\mu^3}{\lambda^3}=1$.
% One may consider only the following form
% \[
% C_\alpha:\quad x^3 + y^3 +  w^3 + \alpha zw^2=0.
% \]
% Finally we claim that there exists an element of $\gB s \gU$ transforming $C_0$ to $C_\alpha$,
% by a computation with Gr\"obner basis, where indeterminates are some entries of matrices,
% see Remark \ref{ComputationForUniquenessOfSSp} below.
% \end{proof}

% \begin{rem}\label{ComputationForUniquenessOfSSp}
% One can verify the claim in the proof of Corollary \ref{MainCorollary}
% from our computation programs over Magma \cite{Magma}, \cite{MagmaHP} and Maple \cite{MapleHP}.
% For the programs with outputs, see the web page of the first author \cite{HPkudo}.
% \end{rem}


\begin{theor}\label{MainTheorem2}
There exist precisely $30$ nonhyperelliptic superspecial curves of genus $4$ over $\mathbb{F}_{11}$ up to isomorphism over $\mathbb{F}_{11}$. 
The thirty isomorphism classes are given by $(\mathrm{N1})$ $C_i = V(Q, P_i^{{\rm (N1)}})$ with $Q=2 x w + 2 y z$ for $1 \leq i \leq 8$ as in $\mathrm{Proposition}$ $\mathrm{\ref{prop:N1q11}}$, $(\mathrm{N2})$ $C_i = V(Q, P_i^{\rm (N2)})$ with $Q=2 x w + y^2 - \epsilon z^2$ for $1 \leq i \leq 5$ as in $\mathrm{Proposition}$ $\mathrm{\ref{prop:N2q11}}$, and $(\mathrm{Dege})$ $C_i=V(Q,P_i^{{\rm (Dege)}})$ with $Q= 2 y w + z^2$ as in $\mathrm{Proposition}$ $\ref{prop:Degenerate_q11}$.
Moreover, there exist precisely $9$ nonhyperelliptic superspecial curves of genus $4$ over $\mathbb{F}_{11}$ up to isomorphism over the algebraic closure (see Corollary \ref{MainCorollary}).
\end{theor}
\begin{proof}
% Let $C$ be a nonhyperelliptic curve of genus $4$ over $\mathbb{F}_{11}$.
% Similarly to the case of $q=5$, described in the proof of Theorem \ref{MainTheorem}, the curve $C$ is defined by an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $\F_{11} [x, y, z, w]$, where $Q$ is either of (N1) $2xw+2yz$ and (N2) $2xw+y^2-\epsilon z^2$ in the non-degenerate case.
% In the degenerate case we may assume $Q = 2yw+z^2$.
% Let $\zeta$ be a generator of the cyclic group $\mathbb{F}_{11}^{\times}$.
% We first consider the non-degenerate case.
Let $C$ be a nonhyperelliptic curve of genus $4$ over $\mathbb{F}_{11}$.
As in the proof of Theorem \ref{MainTheorem} the curve $C$ is written as $C=V(P,Q)$ for an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $\F_{11} [x, y, z, w]$, where $Q$ is either of (N1) $2xw+2yz$, (N2) $2xw+y^2-\epsilon z^2$ and (Dege) $Q = 2yw+z^2$.
Here $\epsilon$ is an element in $\mathbb{F}_{11}^{\times} \smallsetminus ( \mathbb{F}_{11}^{\times})^2$.
Let $\zeta:=\zeta^{(11)}$ be a generator of the cyclic group $\mathbb{F}_{11}^{\times}$.
We first consider the non-degenerate cases (N1) and (N2).
\begin{description}
	\item[(N1){\rm :}] By Lemma \ref{NewReductionLemmaN1}, the curve $C=V(P,Q)$ is $\F_{11}$-isomorphic to $V(P',Q)$ for some
	\begin{equation}
	\begin{split}
	P' =& ( y + b_1 z) x^2 + b_2 x z^2 \\
	& + a_1 y^3 + a_2 y^2 z + a_3 y z^2 + a_4 z^3 \\
	& + ( a_5 y^2  + a_6 y z  + a_7 z^2 ) w + ( a_8  y + a_9 z ) w^2 + a_{10} w^3,
	\end{split}\nonumber
	\end{equation}
	where $a_1, \ldots , a_{10} \in \mathbb{F}_{11}$, $b_1 \in \{ 0, 1, \zeta \}$ and $b_2 \in \{ 0, 1 \}$.
	By Proposition \ref{prop:N1q11} in Section \ref{subsec:comp_result}, the curve $V (P', Q)$ is superspecial if and only if $P'$ is one of $P_i^{({\rm N1})}$ for $1 \leq i \leq 8$.
	\item[(N2){\rm :}] By Lemma \ref{ReductionLemmaN2}, the curve $C=V(P,Q)$ is $\F_{11}$-isomorphic to $V(P',Q)$ for some
	\begin{equation}
	\begin{split}
	P' = & ( a_1 y + a_2 z ) x^2 + a_3 (y^2 - \epsilon z^2) x + b_1 y ( y^2 - \epsilon z^2 ) + a_4 y ( y^2 + 3 \epsilon z^2 ) + a_5 z (3 y^2 + \epsilon z^2 ) \\
	& + ( a_6 y^2 + a_7 y z + b_2 z^2 ) w + ( a_8 y + a_9 z ) w^2 + a_{10} w^3,
	\end{split}\nonumber
	\end{equation}
	%\vspace{-1cm}
	where $(a_1, a_2) \neq (0, 0)$ and $b_1, b_2 \in \{ 0, 1 \}$.
	By Proposition \ref{prop:N2q11} in Section \ref{subsec:comp_result}, the curve $V (P', Q)$ is superspecial if and only if $P'$ is one of $P_i^{({\rm N2})}$ for $1 \leq i \leq 5$.
\end{description}
We next consider the degenerate case (Dege): $Q=2 y w + z^2$.
\begin{description}
	\item[(Dege){\rm :}] 
It follows from Lemma \ref{ReductionLemmaDegenerate} that $C=V(P,Q)$ is $\F_{11}$-isomorphic to $V(P',Q)$ for some
	\begin{equation}
	\begin{split}
	P^{\prime} =& a_0 x^3 + ( a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 y z  + a_5 z w ) x  \\
	& + a_6 y^3 + a_7 z^3 + a_8 w^3 + a_9 y z^2 + b_1 z^2 w + b_2 z w^2,
	\end{split}\nonumber
	\end{equation}
	where $a_0, a_6 \in \mathbb{F}_{11}^{\times}$ and $b_1, b_2 \in \{ 0, 1 \}$.
	By Proposition \ref{prop:Degenerate_q11} in Section \ref{subsec:comp_result}, the curve $V (P', Q)$ is superspecial if and only if $P'$ is one of $P_i^{({\rm Dege})}$ for $1 \leq i \leq 17$.
\end{description}
Summarizing the above descriptions, we have the theorem.
\end{proof}


% Here is a remark on $N_{49}(4)$,
% where $N_q(g)$ denotes
% the maximum number of rational points of curves over $\F_q$ of genus $g$.
% Before this paper, it was known that $102 \le N_{49}(4) \le 106$.
% Note that $106$ is the Hasse-Weil bound,
% and the lower bound is due to E. W. Howe, 
% see \cite{Howe}, {\sc{Table}} 3.
% Theorem B
% (the non-existence of maximal curves over $\F_{49}$ of genus $4$)
% says that $N_{49}(4) \le 105$.
% But the authors learned from E. W. Howe
% that we can say much more.
% He told us that
% combining a result in Howe-Lauter \cite{Howe-Lauter} and Theorem B,
% we have:

% \begin{cor}
% $N_{49}(4) = 102$.
% \end{cor}
% \begin{proof}
% It remains to show that
% there does not exist a genus-$4$ curve $C$ over $\F_{49}$
% with $|C(\F_{49})|=103,104$ or $105$.
% For a curve over $\F_q$ of genus $g$,
% its defect is defined to be the difference between
% the Hasse-Weil-Serre bound $q+1+g[2\sqrt{q}]$ and
% the number of $\F_q$-rational points on the curve.
% Serre has proved that any curve over a finite field can not have defect $1$ if its genus $>2$,
% see \cite{Serre}, Thm 2 (1) on p.~15 and Theorem on p.~24.
% Hence in our case $|C(\F_{49})|=105$ is not possible.
% Also genus-$4$ curves over $\F_{49}$
% can not have defect $2$ or defect $3$:
% the reason is Howe-Lauter \cite{Howe-Lauter}, Theorem 3.1.
% To check actually the non-existence of such curves, we used
% Magma programs (\verb-IsogenyClasses.magma-)
% associated with \cite{Howe-Lauter}, found at
% \verb-http://alumnus.caltech.edu/~however/papers/paper35.html-;
% more concretely executed
% \verb-isogeny_classes(49,4,N)- for $N=103$ and $104$
% after loading \verb-IsogenyClasses.magma-.
% \end{proof} 

% Now we have a computational proof of the uniqueness of
% superspecial curve of genus $4$ over an algebraically closed field, see \cite{FGT} for the original and theoretical proof.
\begin{cor}\label{MainCorollary}
Any nonhyperelliptic superspecial curve of genus $4$ over $\mathbb{F}_{11}$ is isomorphic over $\overline{\mathbb{F}_{11}}$ to one of the curves $V(Q^{{\rm (N1)}}, P_i^{({\rm alc})})$ for $1 \leq i \leq 3$, or $V(Q^{({\rm Dege})}, P_j^{({\rm alc})})$ for $4 \leq j \leq 9$, where $Q^{{\rm (N1)}} := 2 x w + 2 y z$, $Q^{({\rm Dege})}:= 2 yw + z^2$ and
\begin{eqnarray}
P_1^{(\mathrm{alc})}&:=& x^2 y + x^2 z + 2 y^2 z + 5 y^2 w + 9 y z^2 + y z w + 4 z^3 + 3 z^2 w + 10 z w^2 + w^3, \nonumber \\
P_2^{(\mathrm{alc})} &:=& x^2 y + x^2 z + y^3 + y^2 z + 7 y z^2 + 4 y w^2 + 2 z^3 + 9 z w^2, \nonumber \\
P_3^{(\mathrm{alc})} &:=& x^2 y + x^2 z + y^3 + 8 y^2 z + 3 y z^2 + 10 y w^2 + 10 z^3 + 10 z w^2, \nonumber \\
P_4^{(\mathrm{alc})} &:=& x^3 + y^3 + w^3, \nonumber \\
P_5^{(\mathrm{alc})} &:=& x^3 + y^3 + z^3 + 5 w^3, \nonumber \\
P_6^{(\mathrm{alc})} &:=& x^3 + x w^2 + y^3, \nonumber \\
P_7^{(\mathrm{alc})} &:=& x^3 + x z w + y^3 + 7 z^3 + w^3, \nonumber \\
P_8^{(\mathrm{alc})} &:=& x^3 + x y z + x w^2 + y^3 + 5 z^3 + 4 w^3, \nonumber \\
P_9^{(\mathrm{alc})} &:=& x^3 + x y z + 6 x w^2 + y^3 + 8 z^3 + 8 w^3. \nonumber 
\end{eqnarray}
\end{cor}
\begin{proof}
The result follows from the proof of  Theorem \ref{MainTheorem2} together with Propositions \ref{prop:N1q11} -- \ref{prop:for_cor}.
% It suffices to show that the curves in Theorem \ref{MainTheorem} are all isomorphic over an algebraically closed field.
% By $(y\mapsto \lambda\mu y,z\mapsto \mu z, w\mapsto \frac{\mu}{\lambda} w)$ we have
% \[
% x^3 + a_1 \lambda^3 \mu^3 y^3 + a_2 \frac{\mu^3}{\lambda^3} w^3 + a_3 \frac{\mu^3}{\lambda^2} zw^2=0.
% \]
% There exists $(\lambda,\mu)$ such that $a_1 \lambda^3 \mu^3=1$ and $a_2 \frac{\mu^3}{\lambda^3}=1$.
% One may consider only the following form
% \[
% C_\alpha:\quad x^3 + y^3 +  w^3 + \alpha zw^2=0.
% \]
% Finally we claim that there exists an element of $\gB s \gU$ transforming $C_0$ to $C_\alpha$,
% by a computation with Gr\"obner basis, where indeterminates are some entries of matrices,
% see Remark \ref{ComputationForUniquenessOfSSp} below.
\end{proof}

% \begin{rem}\label{ComputationForUniquenessOfSSp}
% One can verify the claim in the proof of Corollary \ref{MainCorollary} from our computation programs on Magma \cite{Magma}, \cite{MagmaHP}.
% The programs with outputs are available at the web page of the first author \cite{HPkudo}.
% \end{rem}

%===============================================================
\subsection{Modified version of Main Algorithm in \cite{KH16}}\label{subsec:algorithm}
%===============================================================

In \cite[Section 5.2]{KH16}, an algorithm (Main Algorithm together with a pseudocode in \cite[Algorithm 5.2.1]{KH16}) to enumerate superspecial curves of genus $4$ was given.
% Note that the algorithm given in \cite{KH16} just computes defining equations, but does not classify isomorphism classes.
In this subsection, we improve the algorithm in \cite{KH16}.
%, and an algorithm  for determining whether two curves of genus $4$ are isomorphic over $K$ or not.

Let $C$ be a nonhyperelliptic curve of genus $4$.
As we have seen in Section \ref{CurvesGenus4}, the curve $C$ is defined by an irreducible quadratic form $Q$ and an irreducible cubic form $P$ in $K [x, y, z, w]$, say $C=V(P,Q)$.
The cubic form $P$ can be transformed into
\begin{equation}
\sum_{i=1}^t a_i p_i + \sum_{j=1}^u b_j q_j \label{input_P}
\end{equation}
for some cubics $p_i$'s and $q_j$'s, and some exact elements $a_i$'s and $b_j$'s in $K$.
%determined from $Q$ and certain conditions on $P$.
We would like to enumerate {\it all} $( a_1, \ldots , a_t, b_1, \ldots , b_u )$ such that $C = V( P, Q)$ is superspecial.
In the following, we describe our modified version of the algorithm in \cite{KH16} for the enumeration.

%========================================
\paragraph{Modified Version of Main Algorithm in \cite{KH16}:}
%========================================
We denote by $\mathcal{M}$ the set of the $16$ monomials given in Proposition \ref{cor:HW}.
Let $Q$ be a quadratic form over $K:= \mathbb{F}_q$.
Let $p_1, \ldots , p_t$, and $q_1, \ldots , q_u$ be cubics over $K$.
% For simplicity, we assume here that $(a_1, \ldots , a_t, b_1, \ldots , b_u)$ can take all elements of $K^{t+u}$.
We assume here that $(a_1, \ldots , a_t, b_1, \ldots , b_u)$ can take all elements of a subset $\mathcal{A}$ of $K^{t+u}$.
Our aim is to compute all $(a_1, \ldots , a_t, b_1, \ldots , b_u)$ such that $C = V ( P, Q )$ are superspecial for $P = \sum_{i=1}^ta_i p_i + \sum_{j=1}^u b_j q_j$.
Our enumeration algorithm is divided into the following four steps:

\begin{enumerate}\setcounter{enumi}{0}
	\item[(0)] Choose $1 \leq s_1 \leq t$ and indices $k_1, \ldots , k_{s_1}$, and then regard $a_{k_1}, \ldots , a_{k_{s_1}}$ as indeterminates.
	The remaining part $(a_{k_1^{\prime}},\ldots,a_{k_{t_1}^{\prime}})$  ($\{ k_1^{\prime}, \ldots, k_{t_1}^{\prime} \} = \{1,\ldots,t \}\setminus \{k_1,\ldots,k_{s_1}\}$) runs through a subset $\mathcal{A}_1$ of $\mathbb{F}_q^{\oplus (t-s_1)} = \mathbb{F}_{q}^{\oplus t_1}$, which we determine in each case.
\end{enumerate}
For each $( a_{k_1^{\prime}}, \ldots , a_{k_{t_1}^{\prime}} ) \in \mathcal{A}_1$, proceed the following three steps:
\begin{enumerate}
	\item[(1)] Compute $h:=(P Q)^{p-1}$ over $\mathbb{F}_{q} [a_{k_1}, \ldots, a_{k_{s_1}}]$, where $a_{k_1}, \ldots, a_{k_{s_1}}$ are indeterminates. 
	\item[(2)] Choose $1 \leq s_2 \leq s_1$ and indices $i_1, \ldots , i_{s_2}$ such that $\{ i_1, \ldots , i_{s_2} \} \subset \{ k_1, \ldots , k_{s_1} \}$, and then regard $a_{i_1}, \ldots , a_{i_{s_2}}$ as indeterminates.
	The remaining part $(a_{j_1},\ldots,a_{j_{t_2}})$  ($\{j_1,\ldots,j_{t_2}\} = \{k_1,\ldots, k_{s_1}\}\smallsetminus \{i_1,\ldots,i_{s_2}\}$) runs through a subset $\mathcal{A}_2$ of $\mathbb{F}_q^{\oplus (s_1-s_2)}= \mathbb{F}_{q}^{\oplus t_2}$, which we determine in each case.
	\item[(3)] For each $\left( a_{j_1}, \ldots , a_{j_{t_2}} \right) \in \mathcal{A}_2$, proceed the following three sub-procedures:
	\begin{enumerate}
		\item Put
		\[
		\mathcal{S} := \{ c \in \mathbb{F}_q [ a_{i_1}, \ldots , a_{i_{s_2}} ] : c m \mbox{ is a term of } h \mbox{ for some } m \in \mathcal{M} \}.
		\]
		\item Solve the multivariate system $f ( a_{i_1}, \ldots , a_{i_{s_2}} ) = 0$ for all $f \in \mathcal{S}$ over $\mathbb{F}_q$.
		\item For each solution $( a_{i_1}, \ldots , a_{i_{s_2}})$, substitute it into unknown coefficients in $P$, and decide whether $C = V ( P, Q)$ is non-singular or not.
	\end{enumerate}
\end{enumerate}
In Algorithm \ref{alg:enume} of Appendix \ref{sec:code}, we give a pseudocode to proceed the above four steps.

\begin{rem}
In the above algorithm (Modified Version of Main Algorithm in \cite{KH16}), one can take the following procedures instead of (2) - (3):
\begin{enumerate}
\item[$(2)'$] Choose $1 \leq s_2 \leq s_1$ and indices $i_1, \ldots , i_{s_2}$ such that $\{ i_1, \ldots , i_{s_2} \} \subset \{ k_1, \ldots , k_{s_1} \}$, and let $\{j_1,\ldots,j_{t_2}\}$ be the remaining part, i.e., $\{j_1,\ldots,j_{t_2}\} = \{k_1,\ldots, k_{s_1}\}\smallsetminus \{i_1,\ldots,i_{s_2}\}$.
Let $\mathcal{A}_2 \subset \mathbb{F}_q^{\oplus (s_1-s_2)}= \mathbb{F}_{q}^{\oplus t_2}$ be the set of candidates of $(a_{j_1},\ldots,a_{j_{t_2}})$.
Different from the procedure (2) in Modified Version of Main Algorithm in \cite{KH16}, we keep $(a_{j_1},\ldots,a_{j_{t_2}})$ as indeterminates.
\item[$(3)'$] For each $\left( c_{j_1}, \ldots , c_{j_{t_2}} \right) \in \mathcal{A}_2$, proceed the following three sub-procedures:
\begin{enumerate}
		\item[$(a)'$] Put
		\[
		\mathcal{S} := \{ c \in \mathbb{F}_q [ a_{i_1}, \ldots , a_{i_{s_1}} ] : c m \mbox{ is a term of } h \mbox{ for some } m \in \mathcal{M} \},
		\]
		and
		\[
		\mathcal{S}^{\prime}:= \mathcal{S} \cup \{ a_{j_1} - c_{j_1}, \ldots , a_{j_{t_2}} - c_{j_{t_2}} \}.
		\]
		Note that $a_{j_1}, \ldots , a_{j_{t_2}}$ are indeterminates, whereas $c_{j_1}, \ldots , c_{j_{t_2}}$ are exact elements in $\mathbb{F}_q$.
		\item[$(b)'$] Solve the multivariate system $f ( a_{i_1}, \ldots , a_{i_{s_1}} ) = 0$ for all $f \in \mathcal{S}^{\prime}$ over $\mathbb{F}_q$.
		\item[$(c)'$] For each solution $( a_{i_1}, \ldots , a_{i_{s_1}})$, substitute it into unknown coefficients in $P$, decide whether $C = V ( P, Q)$ is non-singular or not.
	\end{enumerate}
\end{enumerate}
In $(2)'$, we add generators $a_{j_1} - c_{j_1}, \ldots , a_{j_{t_2}} - c_{j_{t_2}}$ into $\mathcal{S}$ instead of substituting elements in $\mathbb{F}_q$ into $a_{j_1}, \ldots , a_{j_{t_2}}$.
These alternative procedures give another improvement of Main Algorithm in \cite{KH16}, which we call Another Improved Algorithm here.
We have conducted the computation to enumerate superspecial curves of genus $4$ over $\mathbb{F}_{11}$ by not only Modified Version of Main Algorithm in \cite{KH16}, but also Another Improved Algorithm.
From the outputs, we observe that there are a time-memory trade-off between these two improvements.
This shall be an interesting phenomenon, but we do not precisely deal with Another Improved Algorithm in this paper.
% since we have succeeded in finishing all the computation to enumerate superspecial curves of genus $4$ over $\mathbb{F}_{11}$ by Modified Version of Main Algorithm in \cite{KH16}
%  since we observe that the two improvements have no much difference in the efficiency for our computational proofs: we have conducted the computation to enumerate superspecial curves of genus $4$ over $\mathbb{F}_{11}$ by the two improved algorithms, and confirmed that the difference of the total cost is only about hours ( is faster).
\end{rem}



%==================
\paragraph{Our Modification: Double Hybrid Method}
%==================
We describe our modification of the previous algorithm (Main Algorithm in \cite{KH16}), and its effects on total time for our enumeration:
Assume for simplicity that $b_i$'s are fixed and that $a_i$'s can take all elements of $\mathbb{F}_q$.
In the following, we denote by
\begin{description}
\item[$t_{mlt}${\rm :}] average time for computing $(PQ)^{p-1}$, and
\item[$t_{GBslv}${\rm :}] average time for solving multivariate systems,
\end{description}
see also Table Notation in Section \ref{subsubsec:timing}.
Let $t$ be the number of unknown $a_i$'s.
In the previous version, we first choose and fix the number of the indeterminates in the computation of solving multivariate systems.
In other words, we use the {\it same} number of indeterminates in computing $(P Q)^{p-1}$ and solving multivariate systems.
For the fixed number $s$, we run through $t - s$ coefficients in $P$.
For each tuple of coefficients, one computes $(P Q)^{p-1}$ over $\mathbb{F}_q [a_{i_1}, \ldots , a_{i_s}] [x,y,z,w]$, and solve a multivariate system in $\mathbb{F}_q [a_{i_1}, \ldots , a_{i_s}]$.
In this case, the number of total iterations is $q^{t-s}$, and hence required time is roughly estimated as
\[
q^{t-s} (t_{mlt} + t_{GBslv}),
\]
where we suppose that non-singularity testing is negligible.
From outputs obtained by the previous algorithm in our experiments, we observe in our enumeration that the computation of $(P Q)^{p-1}$ might be dominant for large $p$ if each multivariate system is quite efficiently solved.
This depends on the value of $p$, rather than the number of indeterminates of the coefficient ring $\mathbb{F}_q [a_{i_1}, \ldots , a_{i_s}]$.
From this, we consider increasing the number of indeterminates in the computation of $(P Q)^{p-1}$, but not changing (or reducing) that in the multivariate system solving step.
In other words, we may not use the same number of indeterminates in computing $(P Q)^{p-1}$ and solving multivariate systems.
As showed in Modified Version of Main Algorithm in \cite{KH16}, our modified algorithm first chooses respectively the number of indeterminates in computing $(P Q)^{p-1}$ and solving multivariate systems, say $s_1$ and $s_2$.
For the fixed $s_1$, we run through $t - s_1$ coefficients in $P$.
For each tuple of coefficients, one computes $(P Q)^{p-1}$ over $\mathbb{F}_q [a_{i_1}, \ldots , a_{i_{s_1}}] [x,y,z,w]$.
After that, we also run through $s_1 - s_2$ coefficients in $P$, and solve a multivariate system in $\mathbb{F}_q [a_{i_1}, \ldots , a_{i_{s_2}}]$.
In this case, required time is roughly estimated as
\[
q^{t-s_1} \left( t_{mlt} + q^{s_1-s_2}  t_{GBslv} \right),
\]
where we suppose that non-singularity testing is negligible.
Hence, if $p$ (or $q$) is large enough and if $t_{GBslv}$ is negligible compared to $t_{mlt}$, we expect
\[
q^{t-s_1} \left( t_{mlt} + q^{s_1-s_2}  t_{GBslv} \right) \ll q^{t-s} \cdot ( t_{mlt} + t_{GBslv}).
\]
For example, if $q=11$, $t=10$, $s_1=9$, $s_2=s=5$, $t_{mlt}=10$ (seconds) and $t_{GBslv}=0.05$ (seconds), we estimate
\[
q^{t-s} (t_{mlt} + t_{GBslv}) \approx 1618562
\]
whereas
\[
q^{t-s_1} \left( t_{mlt} + q^{s_1-s_2}  t_{GBslv} \right) \approx 8162,
\]
which is about 198 times faster than using the previous version.

We call this method {\it double hybrid method} in our enumeration of superspecial curves of genus $4$.
Thanks to this double hybrid method, we have succeeded in finishing all the computations necessary to show the main theorems with this double hybrid method, see also Section \ref{subsubsec:timing}.
Here we heuristically decided $s_1$ and $s_2$ from experimental computations.
% \begin{ex}\label{ex:N2}
% In the case of {\bf (N2)} for $q=49$ in Section \ref{SectionReduction}, the fixed quadratic form is $Q = 2 x w + y^2 - \epsilon z^2$ and by Lemma \ref{ReductionLemmaN2} the transformed cubic form is
% \begin{eqnarray}
% P &=& ( a_1 y + a_2 z ) x^2 + a_3 (y^2 - \epsilon z^2) x + b_1 y ( y^2 - \epsilon z^2 ) + a_4 y ( y^2 + 3 \epsilon z^2 ) + a_5 z (3 y^2 + \epsilon z^2 ) \nonumber \\
% & & + ( a_6 y^2 + a_7 y z + b_2 z^2 ) w + ( a_8 y + a_9 z ) w^2 + a_{10} w^3, \nonumber
% \end{eqnarray}
% which has $12$ independent coefficients, where $( a_1, a_2 ) \neq (0, 0)$ and $b_1, b_2 \in \{ 0, 1 \}$.
% In this case, we put $t:=10$, $u=2$ and
% \begin{eqnarray}
% \{ p_1, \ldots , p_t \}  &:=& \{ y x^2, z x^2, (y^2 - \epsilon z^2) x , y ( y^2 + 3 \epsilon z^2 ), z (3 y^2 + \epsilon z^2 ), y^2 w, y z w, y w^2, z w^2, w^3 \}, \nonumber \\
% \{ q_1, \ldots , q_u \} &:=& \{ y ( y^2 - \epsilon z^2 ) , z^2 w \}. \nonumber 
% \end{eqnarray}
% For each $( b_1, b_2 )$, we conduct the following procedures:
% \begin{enumerate}
% 	\item Put $s := 7$, and $(i_1, \ldots , i_7) := ( 4, 5, 6, 7, 8, 9, 10)$ (we regard the $7$ coefficients $a_4$, $a_5$, $a_6$, $a_7$, $a_8$, $a_9$, $a_{10}$ as variables).
% 	We set $\mathcal{A}:= \{ ( a_1, a_2, a_3 ) \in (\mathbb{F}_{49})^3 : (a_1, a_2 ) \neq (0,0) \}$.
% 	\item For each $( a_1 , a_2, a_3 ) \in \mathcal{A}$, 
% 	\begin{enumerate}
% 		\item Compute the coefficients of the monomials of $\mathcal{M}$ in $(P Q)^{p-1}$.
% 		We denote by $\mathcal{S}$ the set of the coefficients.
% 		Note that $P \in \mathbb{F}_{49} [ a_4, a_5, a_6, a_7, a_8, a_9, a_{10}] [ x, y, z, w]$ in this step and that $\mathcal{S} \subset \mathbb{F}_{49} [ a_4, a_5, a_6, a_7, a_8, a_9, a_{10}]$.
% 		\item Solve the system of algebraic equations $f ( a_4, a_5, a_6, a_7, a_8, a_9, a_{10} ) = 0$ for all $f \in \mathcal{S}$ over $\mathbb{F}_{49}$ via the Gr\"{o}bner basis computation.
% 		\item For each solution $( a_4, a_5, a_6, a_7, a_8, a_9, a_{10} )$, decide whether $C = V ( P, Q)$ is non-singular or not by Algorithm \ref{alg:non-sing}.
% 	\end{enumerate}
% \end{enumerate}
% For the term order we adopt, see the proof of Proposition \ref{prop:N2q49} in Section \ref{subsec:comp_result}.
% \end{ex}

%==========================================
\subsection{Enumerating isomorphism classes}\label{subsec:isom}
%==========================================

Let $K = \mathbb{F}_q$ be the field of order $q$, and $Q$ an irreducible quadratic form in $K [x,y,z,w]$.
Let $\varphi$ be the symmetric matrix associated to $Q$.
Let $C_1 = V (Q, P_1)$ and $C_2 = V (Q, P_2)$ be two curves of genus $4$ over $K$ with irreducible cubic forms $P_1$ and $P_2$ in $K [x, y, z, w]$.
The two curves $C_1$ and $C_2$ are isomorphic over $K$ if and only if there exists $g \in \tilde{\rm O}_{\varphi} (K)$ such that
\[
g \cdot P_1 \equiv \lambda P_2 \mbox{ mod } Q 
\]
for some $\lambda \in K^{\times}$.
With this fact, we write down an algorithm for determining whether two curves of genus $4$ are isomorphic over $K$ or not.
Let us focus on the case of (N1), and give an algorithm only for the case in this paper;
as we will state in Remark \ref{rem:isom}, one can construct algorithms for the cases (N2) and (Dege) in similar ways to (N1).
Given a set $\mathcal{P}$ of irreducible cubic forms in $K [x,y,z,w]$, we also give an algorithm to compute a subset $\mathcal{P}^{\prime} \subset \mathcal{P}$ such that $V (Q, P_1)$ and $V( Q, P_2)$ are not isomorphic over $K$ for all $P_1, P_2 \in \mathcal{P}^{\prime}$ with $P_1 \neq P_2$.

% \subsubsection{Case of (N1)}

% First, we consider the case of (N1), that is, $Q = 2 x w + 2 y z$ with
We consider the case (N1), that is, $Q = 2 x w + 2 y z$ with
\[
\varphi = 
 \begin{pmatrix}
0 & 0 & 0 & 1\\
0 & 0 & 1 & 0\\
0 & 1 & 0 & 0\\
1 & 0 & 0 & 0
\end{pmatrix}.
 \]
As in Section \ref{SectionReduction}, put
\[
\gT := \{\diag(a,b,b^{-1},a^{-1}) : a,b\in K^\times\}, \quad
\tilde \gT := \{\diag(a,b,cb^{-1},ca^{-1}) : a,b,c\in K^\times\},
\]
\[
%U_1(a) = 1_4 + a E_{1,2} - a E_{3,4}
U_1(a) := 
\left. \begin{pmatrix}1&a&0&0\\0&1&0&0\\0&0&1&-a\\0&0&0&1\end{pmatrix} \right.
,\quad 
U_2 (b) := \left. \begin{pmatrix}1&0&b&0\\0&1&0&-b\\0&0&1&0\\0&0&0&1\end{pmatrix} \right.
%U_2(b) = 1_4 + b E_{1,3} - b E_{2,4}.
, \quad
\gU := \{ U_1 (a) U_2(b) : a,b\in K\},
\]
% \[
% \gU = \left\{ \left. \begin{pmatrix}1&a&0&0\\0&1&0&0\\0&0&1&-a\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&b&0\\0&1&0&-b\\0&0&1&0\\0&0&0&1\end{pmatrix}\right| a,b\in K\right\},
% \]
\[
\gA := \left\{1_4, 
\begin{pmatrix}
1&0&0&0\\
0&0&1&0\\
0&1&0&0\\
0&0&0&1
\end{pmatrix}\right\},\quad
s_1 := \begin{pmatrix}
0&1&0&0\\
1&0&0&0\\
0&0&0&1\\
0&0&1&0
\end{pmatrix},\quad
s_2 := \begin{pmatrix}
0&0&1&0\\
0&0&0&1\\
1&0&0&0\\
0&1&0&0
\end{pmatrix}.
\]
%\[
%W = \{1_4, s_1, s_2, s_1s_2, s_2s_1, s_1s_2s_1, s_2s_1s_2, s_1s_2s_1s_2\}.
%\]
Let $\gW:=\{1_4, s_1, s_2, s_1s_2\}$.
%Set $W^- := \tau W^+$ and
%$W = W^+\sqcup W^-$.
Put $\gB := \gA\gT\gU$ and $\tilde \gB := \gA\tilde \gT \gU$.
%We have $\SO_\varphi(K)=BWU$, $\gO_\varphi(K)=ABWU$ and 
%$\tilde \gO_\varphi(K)=A\tilde BWU$.
Recall from Section \ref{SectionReduction} that we have
%(but this paper uses only $\tilde B W U \subset \tilde\gO_\varphi(K)$).
%\begin{lem}
%We have
\[
\gO_\varphi(K)=\gB\gW\gU \quad\text{and}\quad \tilde\gO_\varphi(K)=\tilde \gB \gW \gU.
\]
Given irreducible cubic forms $P_1$ and $P_2$ in $K [x,y,z,w]$, we give an algorithm for testing whether $V (Q, P_1)$ and $V(Q, P_2)$ are isomorphic over $K$ or not.
The correctness of this algorithm is straightforward from its construction. 

%========================================
\paragraph{Isomorphism Testing Algorithm:}
%========================================
With notation as above, conduct the following procedures for the inputs $P_1$, $P_2$ and $K=\mathbb{F}_q$:
\begin{description}
	\item[{\rm (1)}] Let $t_1, \ldots, t_7$ and $\lambda$ be indeterminates.
	\item[{\rm (2)}] For each $M_{\mathrm{A}} \in \mathrm{A}$ and $M_{\mathrm{W}} \in \mathrm{W}$, we proceed the following four steps:
% 	For computing Gr\"{o}bner bases over $\mathbb{F}_{11} [ a_4, a_5, a_6, a_8, a_9, a_{10}]$, we adopt the graded reverse lexicographic (grevlex) order with
% \[
% a_{10} \prec a_9 \prec a_4 \prec a_8 \prec a_6 \prec a_5,
% \]
% 	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
% 	Put $\mathcal{A} := \mathbb{F}_{11} \times \mathbb{F}_{11}$.
% 	\item[{\rm (3)}] Execute Algorithm \ref{alg:enume}. More precisely, we proceed the following three steps for each $( a_3, a_7 ) \in \mathcal{A}$: 
	\begin{description}
		\item[{\rm (a)}] Put $M_{\tilde{\mathrm{T}}} := \mathrm{diag} (t_1, t_2, t_3 t_2^{-1}, t_3 t_1^{-1}) \in \tilde{\rm T}$, and compute
		\[
		g: = M_{\mathrm{A}} \cdot M_{\tilde{\mathrm{T}}} \cdot U_1 (t_4) \cdot U_2 (t_5) \cdot M_{\mathrm{W}} \cdot U_1 ( t_6 ) \cdot U_2 (t_7) % \in \tilde\gO_\varphi(K).
		\]
		\item[{\rm (b)}] Construct a multivariate system from the equation
		\[
		g \cdot P_1 \equiv \lambda P_2 \mbox{ mod } Q 
		\]
		together with
		\[
		t_i^{q-1} = 1 \mbox{ for }1 \leq i \leq 3, \quad t_j^q = t_j \mbox{ for } 4 \leq j \leq 7, \mbox{ and} \quad \lambda^{q-1} = 1.
		\]
		Let $\mathcal{S} \subset K [t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda ]$ be the set of defining polynomials for the system.
		\item[{\rm (b)}] Compute the reduced Gr\"{o}bner basis $G$ for $\langle S \rangle \subset K [t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda ]$ with respect to some term order.
		For computing a Gr\"{o}bner basis, we use known algorithms, e.g., $F_4$.
		\item[{\rm (c)}] If $\sharp G \neq 1$, return ``\textbf{ISOMORPHIC}'', which means that $V (Q, P_1)$ and $V( Q, P_2)$ are isomorphic over $K=\mathbb{F}_q$.
	\end{description}
If the multivariate systems have no solution over $K=\mathbb{F}_q$, i.e., $\sharp G =1$ for all $M_{\mathrm{A}} \in \mathrm{A}$ and $M_{\mathrm{W}} \in \mathrm{W}$, then return ``\textbf{NOT ISOMORPHIC}''.
In this case $V (Q, P_1)$ and $V( Q, P_2)$ are not isomorphic over $K=\mathbb{F}_q$. 
\end{description}
In Algorithm \ref{alg:isomorphic_tilde} of Appendix \ref{sec:code}, we also give a pseudocode for Isomorphism Testing Algorithm.


% With notation as above, we give algorithms (Algorithms \ref{alg:isomorphic} and Algorithm \ref{alg:isomorphic_tilde}) for determining whether two curves of genus $4$ are isomorphic over $K$.


% \if 0
% \begin{algorithm}[htb] %
% \caption{$\texttt{IsIsomorphicN1} ( P_1, P_2, q )$}
% \label{alg:isomorphic}
% \begin{algorithmic}[1]
% \REQUIRE{Two cubic forms $P_1$ and $P_2$ in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
% \ENSURE{``\textbf{ISOMORPHIC}'' or ``\textbf{NOT DECIDED}''}
% \STATE $IsomorphicFlag$ $\leftarrow$ $0$
% \FOR{$M_{\rm A} \in \mathrm{A}$}
% 	\FOR{$M_{\rm W} \in \mathrm{W}$}
% 		\STATE $M_{\rm T}$ $\leftarrow$ $\mathrm{diag} (s_1, s_2, s_2^{-1}, s_1^{-1})$
% 		\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot M_{\rm T} \cdot U_1 (s_3) \cdot U_2 (s_4) \cdot M_{\rm W} \cdot U_1 (s_5) \cdot U_2 (s_6)$
% 		\STATE $P_3$ $\leftarrow$ $g \cdot P_1 - \lambda P_2 - \lambda Q$
% 	 	\STATE $\mathcal{S}$ $\leftarrow$ $\{ s_i^{q-1} - 1 : 1 \leq i \leq 2 \} \cup \{ t_j^q - t_j : 3 \leq j \leq 6 \} \cup \{ \lambda^{q-1} - 1 \}$
% 	 	\STATE $\mathrm{Mon}(P_3)$ $\leftarrow$ the set of the monomials of $P_3$
% 		\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_3)$}
% 			\STATE $f  (s_1, s_2, s_3, s_4, s_5, s_6, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_3$
% 			\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (s_1, s_2, s_3, s_4, s_5, s_6, \lambda) \}$
% 		\ENDFOR
% 		\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ s_1, s_2, s_3, s_4, s_5, s_6, \lambda ]$
% 		\IF{$\sharp G \neq 1$}
% 			\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{\rm A}$
% 		\ENDIF
% 	\ENDFOR
% \ENDFOR
% \IF{$IsomorphicFlag = 0$}
% 	\RETURN ``\textbf{NOT DECIDED}''
% \ELSE
% 	\RETURN ``\textbf{ISOMORPHIC}''
% \ENDIF
% \end{algorithmic}
% \end{algorithm}
% \fi

%The correctnesses of Algorithms \ref{alg:isomorphic} and \ref{alg:isomorphic_tilde} are straightforward from their constructions. 
% The correctness of Algorithm \ref{alg:isomorphic_tilde} is straightforward from its construction. 

% \begin{prop}\label{prop:isomorphicN1}
% \begin{enumerate}
% \item If Algorithm \ref{alg:isomorphic} returns {\rm \textbf{ISOMORPHIC}}, then $P_1$ and $P_2$ are isomorphic over $K$.
% \item If Algorithm \ref{alg:isomorphic_tilde} returns {\rm \textbf{NOT ISOMORPHIC}}, then $P_1$ and $P_2$ are not isomorphic over $K$.
% If it outputs {\rm \textbf{ISOMORPHIC}}, then $P_1$ and $P_2$ are isomorphic over $K$.
% \end{enumerate}
% \end{prop}

% \begin{prop}\label{prop:isomorphicN1}
% If Algorithm \ref{alg:isomorphic_tilde} returns {\rm \textbf{NOT ISOMORPHIC}}, then $P_1$ and $P_2$ are not isomorphic over $K$.
% If it outputs {\rm \textbf{ISOMORPHIC}}, then $P_1$ and $P_2$ are isomorphic over $K$.
% \end{prop}

Next, we give an algorithm for computing isomorphism classes.
Given a family $\mathcal{P}= (P_i)_{i=1}^t$ of irreducible cubics in $K [x,y,z,w]$, the following algorithm (Collecting Isomorphism Classes Algorithm) computes a subset $\mathcal{P}^{\prime} \subset \mathcal{P}$ such that $P_1$ and $P_2$ are not isomorphic over $K$ for all $P_1, P_2 \in \mathcal{P}^{\prime}$ with $P_1 \neq P_2$.

%========================================
\paragraph{Collecting Isomorphism Classes Algorithm:}
%========================================
With notation as above, conduct the following procedures for the inputs $\mathcal{P}= (P_i)_{i=1}^t$ and $K=\mathbb{F}_q$:
\begin{description}
	\item[{\rm (1)}] Put $\mathcal{P}^{\prime}:= \emptyset$, and let $FlagList1$ be a sequence of $t$ zeros, say $FlagList1 := ( 0 )_{i=1}^t$.
	\item[{\rm (2)}] For $i=1$ to $t-1$, we proceed the following two steps if $FlagList1[i] = 0$:
	\begin{description}
		\item[{\rm (2-1)}] Replace $\mathcal{P}^{\prime}$ by $\mathcal{P}^{\prime} \cup \{ P_i \}$.
		\item[{\rm (2-2)}] For each $i+1 \leq j \leq t$, test whether $P_i$ and $P_j$ are isomorphic over $\mathbb{F}_q$ or not by Isomorphism Testing Algorithm (or its pseudocode Algorithm \ref{alg:isomorphic_tilde}).
		For a technical reason (Remark \ref{rem:isom} (1)), not regard $t_3$ as an indeterminate here, but take $t_3 =1$ in Isomorphism Testing Algorithm.
		If Isomorphism Testing Algorithm outputs ``\textbf{ISOMORPHIC}'', replace by $1$ the $j$-th entry of $FlagList1$, say $FlagList1[j]:=1$.
	\end{description}
	\item[{\rm (3)}] Put $\mathcal{P}^{\prime \prime}:= \emptyset$, and let $FlagList2$ be a sequence of $\sharp \mathcal{P}^{\prime}$ zeros, say $FlagList2 := ( 0 )_{i=1}^{\sharp \mathcal{P}^{\prime}}$.
	\item[{\rm (4)}] For $i=1$ to $\sharp \mathcal{P}^{\prime}-1$, we proceed the following two steps if $FlagList2[i] = 0$:
	\begin{description}
		\item[{\rm (4-1)}] Replace $\mathcal{P}^{\prime \prime}$ by $\mathcal{P}^{\prime \prime} \cup \{ \mathcal{P}^{\prime}[i] \}$.
		\item[{\rm (4-2)}] For each $i+1 \leq j \leq \sharp \mathcal{P}^{\prime}$, test whether $\mathcal{P}^{\prime} [i]$ and $\mathcal{P}^{\prime} [j]$ are isomorphic over $\mathbb{F}_q$ or not by Isomorphism Testing Algorithm (or its pseudocode Algorithm \ref{alg:isomorphic_tilde}).
		If Isomorphism Testing Algorithm outputs ``\textbf{ISOMORPHIC}'', replace by $1$ the $j$-th entry of $FlagList2$, say $FlagList2[j]:=1$.
	\end{description}
	\item[{\rm (5)}] Return $\mathcal{P}^{\prime \prime}$.
	This $\mathcal{P}^{\prime \prime}$ has the property that $P$ and $P^{\prime}$ are not isomorphic over $K$ for all $P, P^{\prime} \in \mathcal{P}^{\prime \prime}$ with $P \neq P^{\prime}$.
\end{description}
In Algorithm \ref{alg:isomorphic_family} of Appendix \ref{sec:code}, we also give a pseudocode for Collecting Isomorphism Classes Algorithm.


\begin{rem}\label{rem:isom}
\begin{enumerate}
\item In Collecting Isomorphism Classes Algorithm, we first reduce the number of candidates of the isomorphism classes.
More concretely, for each $P_i$, we first remove $P_j$ with $j \geq i+1$ such that $V (Q, P_i)$ and $V (Q, P_j)$ are isomorphic over $K$ via some element of $\mathrm{O}_{\varphi} (K)$.
After that, we determine the isomorphism classes by elements of $\tilde{\mathrm{O}}_{\varphi} (K)$.
\item Using the Bruhat decompositions given in Section \ref{SectionReduction}, one can also construct an algorithm for each of (N2) and (Dege) as a variant of that for (N1).
Let us omit to give algorithms for (N2) and (Dege) in this paper.
\end{enumerate}
\end{rem}


% \if 0
% \begin{algorithm}[t] %
% \caption{$\texttt{NotIsomorphicListN1} ( \mathcal{P}, q )$}
% \label{alg:isomprphic_family}
% \begin{algorithmic}[1]
% \REQUIRE{A list $\mathcal{P} = ( P_1, \ldots , P_t )$ of cubics in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
% \ENSURE{A family $\mathcal{P}^{\prime \prime}$ of cubics in $\mathbb{F}_q [x,y,z,w]$}
% \STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\emptyset$, $FlagList1$ $\leftarrow$ $( 0 )_{i=1}^t$
% \FOR{$i=1$ \TO $t-1$}
% 	\IF{$FlagList1[i] = 0$}
% 		\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\mathcal{P}^{\prime} \cup \{ P_i \}$
% 		\FOR{$j=i+1$ \TO $t$}
% 			\STATE $IsomorphicFlag$ $\leftarrow$ $0$
% 			\FOR{$M_{\rm A} \in \mathrm{A}$}
% 				\FOR{$M_{\rm W} \in \mathrm{W}$}
% 					\STATE $M_{\rm T}$ $\leftarrow$ $\mathrm{diag} (s_1, s_2, s_2^{-1}, s_1^{-1})$
% 					\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot M_{\rm T} \cdot U_1 (s_3) \cdot U_2 (s_4) \cdot M_{\rm W} \cdot U_1 (s_5) \cdot U_2 (s_6)$
% 					\STATE $P_{i,j}$ $\leftarrow$ $g \cdot P_i - \lambda P_j  -  Q$
% 					\STATE $\mathcal{S}$ $\leftarrow$ $\{ s_i^{q-1} - 1 : 1 \leq i \leq 2 \} \cup \{ s_j^q - s_j : 3 \leq j \leq 6 \} \cup \{ \lambda^{q-1} - 1 \}$
% 					\STATE $\mathrm{Mon}(P_{i,j})$ $\leftarrow$ the set of the monomials of $P_{i,j}$
% 					\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_{i,j})$}
% 						\STATE $f  (s_1, s_2, s_3, s_4, s_5, s_6, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_{i,j}$
% 						\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (s_1, s_2, s_3, s_4, s_5, s_6, \lambda) \}$
% 					\ENDFOR
% 					\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ s_1, s_2, s_3, s_4, s_5, s_6, \lambda ]$
% 					\IF{$\sharp G \neq 1$}
% 						\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{\rm A}$
% 					\ENDIF
% 				\ENDFOR
% 			\ENDFOR
% 			\IF{$IsomorphicFlag = 1$}
% 				\STATE $FlagList1[j]$ $\leftarrow$ $1$
% 			\ENDIF
% 		\ENDFOR
% 	\ENDIF
% \ENDFOR
% \STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\emptyset$, $FlagList2$ $\leftarrow$ $( 0 )_{i=1}^{\sharp \mathcal{P}^{\prime}}$
% \FOR{$i=1$ \TO $\sharp \mathcal{P}^{\prime}-1$}
% 	\IF{$FlagList2[i] = 0$}
% 		\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\mathcal{P}^{\prime \prime} \cup \{ \mathcal{P}^{\prime} [i] \}$
% 		\FOR{$j=i+1$ \TO $t$}
% 			\IF{$\texttt{IsIsomorphicN1} ( \mathcal{P}^{\prime} [i], \mathcal{P}^{\prime} [j], q )$ returns \textbf{ISOMORPHIC}}
% 				\STATE $FlagList2[j]$ $\leftarrow$ $1$
% 			\ENDIF
% 		\ENDFOR
% 	\ENDIF
% \ENDFOR
% \RETURN $\mathcal{P}^{\prime \prime}$
% \end{algorithmic}
% \end{algorithm}
% \fi


\if 0
%==================
\subsubsection{Case of (N2)}
%==================

Next, we consider the case of (N2), that is, $Q = 2 x w + y^2 - \epsilon z^2$ with
\[
\varphi = 
 \begin{pmatrix}
0 & 0 & 0 & 1\\
0 & 1 & 0 & 0\\
0 & 0 & -\epsilon & 0\\
1 & 0 & 0 & 0
\end{pmatrix},
 \]
where $\epsilon\in K^\times\smallsetminus(K^\times)^2$.
As in Section \ref{??}, put
$\gH :=\{ H(a):= \diag(a,1,1,a^{-1}) \mid a \in K^\times\}, \quad
\gA:=\{1_4, \diag(1,1,-1,1)\}
$,
\[
U_1 (a) :=
\begin{pmatrix}
1 & a & 0 & -a^2/2\\
0 & 1 & 0 & -a\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1
\end{pmatrix}, \quad
U_2 (b) :=
\begin{pmatrix}
1 & 0 & b & b^2/(2\epsilon)\\
0 & 1 & 0 & 0\\
0 & 0 & 1 & b/\epsilon\\
0 & 0 & 0 & 1
\end{pmatrix}, \quad
\gU := \{ U_1 (a) U_2(b) \mid a,b\in K\},
\]
\[
\tilde \gC :=\left\{\left.
R(a,b):=\begin{pmatrix}
1 & 0 & 0 & 0\\
0 & a & \epsilon b & 0\\
0 & b & a & 0\\
0 & 0 & 0 & a^2-\epsilon b^2
\end{pmatrix} \right| a,b\in K\right\},\qquad  %, a^2 -\epsilon b^2 \ne 0\right\}
\gW :=\left\{1_4, \begin{pmatrix}
0 & 0 & 0 & 1\\
0 & 1 & 0 & 0\\
0 & 0 & -1 & 0\\
1 & 0 & 0 & 0
\end{pmatrix}\right\}.
\]
Let $\gC := \{R(a,b)\in \tilde \gC \mid a^2-\epsilon b^2 = 1\}$
and put $\gT :=\gH\gC$, $\tilde \gT := \gH\tilde \gC$,
$\gB :=\gA\gT\gU$ and $\tilde \gB := \gA\tilde{\gT}\gU$.
Recall from Section \ref{??} that we have
\[
\gO_\varphi(K) = \gB \gW \gU
\quad\text{and}\quad
\tilde \gO_\varphi(K) = \tilde \gB \gW \gU.
\]
With notation as above, we give an algorithm (Algorithm \ref{alg:isomorphic_N2}) for determining whether two curves of genus $4$ are isomorphic over $K$ or not.

\begin{algorithm}[htb] %
\caption{$\texttt{IsIsomorphicN2} ( P_1, P_2, q )$}
\label{alg:isomorphic_N2}
\begin{algorithmic}[1]
\REQUIRE{Two cubic forms $P_1$ and $P_2$ in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
\ENSURE{``\textbf{ISOMORPHIC}'' or ``\textbf{NOT ISOMORPHIC}''}
\STATE $IsomorphicFlag$ $\leftarrow$ $0$
\FOR{$M_{\rm A} \in \mathrm{A}$}
	\FOR{$M_{\rm W} \in \mathrm{W}$}
		\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot H (t_1) \cdot R (t_2, t_3) \cdot U_1 (t_4) \cdot U_2 (t_5) \cdot M_{\rm W} \cdot U_1 (t_6) \cdot U_2 (t_7)$
		\STATE Construct a system of algebraic equations with indeterminates $t_i$'s and $\lambda$ by comparing coefficients in $g \cdot P_1 = \lambda P_2 + Q$
		\STATE $P_3$ $\leftarrow$ $g \cdot P_1 - \lambda P_2 - \lambda Q$
	 	\STATE $\mathcal{S}$ $\leftarrow$ $\{ t_1^{q-1} - 1\} \cup \{ t_i^q - t : 2 \leq i \leq 7 \} \cup \{ \lambda^{q-1} - 1, (t_2^2 - \epsilon t_3^2)^{q-1} - 1 \}$
	 	\STATE $\mathrm{Mon}(P_3)$ $\leftarrow$ the set of the monomials of $P_3$
		\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_3)$}
			\STATE $f  (t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_3$
			\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda) \}$
		\ENDFOR
		\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ t_1, t_2, t_3, t_4, t_5, t_6, t_7, \lambda ]$
		\IF{$\sharp G \neq 1$}
			\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{\rm A}$
		\ENDIF
	\ENDFOR
\ENDFOR
\IF{$IsomorphicFlag = 0$}
	\RETURN ``\textbf{NOT ISOMORPHIC}''
\ELSE
	\RETURN ``\textbf{ISOMORPHIC}''
\ENDIF
\end{algorithmic}
\end{algorithm}
The correctness of Algorithm \ref{alg:isomorphic_N2} is straightforward from its construction. 

\begin{prop}\label{prop:isomorphicN2}
If Algorithm \ref{alg:isomorphic_N2} returns {\rm \textbf{NOT ISOMORPHIC}}, then $P_1$ and $P_2$ are not isomorphic over $K$.
If it outputs {\rm \textbf{ISOMORPHIC}}, then $P_1$ and $P_2$ are isomorphic over $K$.
\end{prop}

Given a family $\mathcal{P}$ of cubics in $K [x,y,z,w]$, we give an algorithm (Algorithm \ref{alg:isomprphic_family_N2}) to compute a subset $\mathcal{P}^{\prime}$ such that
$P_1$ and $P_2$ are not isomorphic over $K$ for all $P_1, P_2 \in \mathcal{P}^{\prime}$ with $P_1 \neq P_2$.

\begin{algorithm}[h] %
\caption{$\texttt{NotIsomorphicListN2} ( \mathcal{P}, q )$}
\label{alg:isomprphic_family_N2}
\begin{algorithmic}[1]
\REQUIRE{A list $\mathcal{P} = ( P_1, \ldots , P_t )$ of cubics in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
\ENSURE{A family $\mathcal{P}^{\prime \prime}$ of cubics in $\mathbb{F}_q [x,y,z,w]$}
\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\emptyset$, $FlagList1$ $\leftarrow$ $( 0 )_{i=1}^t$
\FOR{$i=1$ \TO $t-1$}
	\IF{$FlagList1[i] = 0$}
		\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\mathcal{P}^{\prime} \cup \{ P_i \}$
		\FOR{$j=i+1$ \TO $t$}
			\STATE $IsomorphicFlag$ $\leftarrow$ $0$
			\FOR{$M_{\rm A} \in \mathrm{A}$}
				\FOR{$M_{\rm W} \in \mathrm{W}$}
					%\STATE $M_{\rm T}$ $\leftarrow$ $\mathrm{diag} (s_1, s_2, s_2^{-1}, s_1^{-1})$
					\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot H (s_1) \cdot R (s_2, s_3) \cdot U_1 (s_4) \cdot U_2 (s_5) \cdot M_{\rm W} \cdot U_1 (s_6) \cdot U_2 (s_7)$
					\STATE $P_{i,j}$ $\leftarrow$ $g \cdot P_i - \lambda P_j  -  Q$
					\STATE $\mathcal{S}$ $\leftarrow$ $\{ s_1^{q-1} - 1\} \cup \{ s_i^q - s : 2 \leq i \leq 7 \} \cup \{ \lambda^{q-1} - 1,  s_2^2 - \epsilon s_3^2 - 1 \}$
					\STATE $\mathrm{Mon}(P_{i,j})$ $\leftarrow$ the set of the monomials of $P_{i,j}$
					\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_{i,j})$}
						\STATE $f  (s_1, s_2, s_3, s_4, s_5, s_6, s_7, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_{i,j}$
						\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (s_1, s_2, s_3, s_4, s_5, s_6, s_7, \lambda) \}$
					\ENDFOR
					\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ s_1, s_2, s_3, s_4, s_5, s_6, s_7, \lambda ]$
					\IF{$\sharp G \neq 1$}
						\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{\rm A}$
					\ENDIF
				\ENDFOR
			\ENDFOR
			\IF{$IsomorphicFlag = 1$}
				\STATE $FlagList1[j]$ $\leftarrow$ $1$
			\ENDIF
		\ENDFOR
	\ENDIF
\ENDFOR
\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\emptyset$, $FlagList2$ $\leftarrow$ $( 0 )_{i=1}^{\sharp \mathcal{P}^{\prime}}$
\FOR{$i=1$ \TO $\sharp \mathcal{P}^{\prime}-1$}
	\IF{$FlagList2[i] = 0$}
		\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\mathcal{P}^{\prime \prime} \cup \{ \mathcal{P}^{\prime} [i] \}$
		\FOR{$j=i+1$ \TO $t$}
			\IF{$\texttt{IsIsomorphicN2} ( \mathcal{P}^{\prime} [i], \mathcal{P}^{\prime} [j], q )$ returns \textbf{ISOMORPHIC}}
				\STATE $FlagList2[j]$ $\leftarrow$ $1$
			\ENDIF
		\ENDFOR
	\ENDIF
\ENDFOR
\RETURN $\mathcal{P}^{\prime \prime}$
\end{algorithmic}
\end{algorithm}

%=====================
\subsubsection{Degenerate case}
%=====================

We consider the degenerate case, that is, $Q = 2 y w + z^2$ with
\[
\varphi = \begin{pmatrix}
0 & 0 & 0 & 0\\
0 & 0 & 0 & 1\\
0 & 0 & 1 & 0\\
0 & 1 & 0 & 0
\end{pmatrix}.
\]
As in Section \ref{??}, 
Put $\gA:=\{1_4, \diag(1,1,-1,1)\}$,
\[
\gT:=\left\{\left. T(a):=\begin{pmatrix}
1&0&0&0\\
0&a&0&0\\
0&0& 1&0\\
0&0&0&a^{-1}\end{pmatrix} \right| a \in K^\times\right\},\quad
\gU := \left\{\left. U(a):=\begin{pmatrix}
1&0&0&0\\
0&1&a&a^2(2\epsilon)^{-1}\\
0&0&1&a \epsilon^{-1}\\
0&0&0&1\end{pmatrix} \right| a \in K\right\},
\]
\[
s:=\begin{pmatrix}
1&0&0&0\\
0&0&0&1\\
0&0&1&0\\
0&1&0&0\end{pmatrix},\quad
\gV=\left\{ V(a,b,c,d) := \left. \begin{pmatrix}
a&b&c&d\\
0&1&0&0\\
0&0&1&0\\
0&0&0&1\end{pmatrix} \right| a\in K^\times \text{ and } b, c, d\in K\right\}.
\]
Let $\tilde \gT := \{\diag(1,b,b,b) \mid b\in K^\times\} \gT$ and set $\gB:=\gA \gT \gU$ and $\tilde \gB := \gA \tilde \gT \gU$.
Recall from Section \ref{??} that we have
\[
\gO_\varphi(K) = (\gB \sqcup \gB s \gU) \gV
\quad\text{and}\quad
\tilde \gO_\varphi(K) = (\tilde \gB \sqcup \tilde \gB s \gU) \gV .
\]
With notation as above, we give an algorithm (Algorithm \ref{alg:isomorphic_Dege}) for determining whether two curves of genus $4$ are isomorphic over $K$ or not.

\begin{algorithm}[htb] %
\caption{$\texttt{IsIsomorphicDege} ( P_1, P_2, q )$}
\label{alg:isomorphic_Dege}
\begin{algorithmic}[1]
\REQUIRE{Two cubic forms $P_1$ and $P_2$ in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
\ENSURE{``\textbf{ISOMORPHIC}'' or ``\textbf{NOT ISOMORPHIC}''}
\STATE $IsomorphicFlag$ $\leftarrow$ $0$
\FOR{$M_{\rm A} \in \mathrm{A}$}
	\FOR{$M_{s} \in \{ {\rm 1}_4, s \}$}
		\IF{$M_{s} = {\rm 1}_4$}
			\STATE $t_4$ $\leftarrow$ $1$, $t_5$ $\leftarrow$ $1$
		\ENDIF
		\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot \tilde{T}(t_1,t_2) \cdot U (t_3) \cdot M_s \cdot U (t_4) \cdot V (t_5, 0,0,0)$
		\STATE Construct a system of algebraic equations with indeterminates $t_i$'s and $\lambda$ by comparing coefficients in $g \cdot P_1 = \lambda P_2 + Q$
		\STATE $P_3$ $\leftarrow$ $g \cdot P_1 - \lambda P_2 - \lambda Q$
	 	\STATE $\mathcal{S}$ $\leftarrow$ $\{ t_i^{q-1} - 1 : 1 \leq i \leq 2 \} \cup \{ t_i^q - t_i : 3 \leq i \leq 4 \} \cup \{ t_5^{q-1} - 1, \lambda^{q-1} - 1 \}$
	 	\STATE $\mathrm{Mon}(P_3)$ $\leftarrow$ the set of the monomials of $P_3$
		\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_3)$}
			\STATE $f  (t_1, t_2, t_3, t_4, t_5, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_3$
			\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (t_1, t_2, t_3, t_4, t_5, \lambda) \}$
		\ENDFOR
		\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ t_1, t_2, t_3, t_4, t_5, \lambda ]$
		\IF{$\sharp G \neq 1$}
			\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{s}$
		\ENDIF
	\ENDFOR
\ENDFOR
\IF{$IsomorphicFlag = 0$}
	\RETURN ``\textbf{NOT ISOMORPHIC}''
\ELSE
	\RETURN ``\textbf{ISOMORPHIC}''
\ENDIF
\end{algorithmic}
\end{algorithm}
The correctness of Algorithm \ref{alg:isomorphic_Dege} is straightforward from its construction. 

\begin{prop}\label{prop:isomorphicDege}
If Algorithm \ref{alg:isomorphic_Dege} returns {\rm \textbf{NOT ISOMORPHIC}}, then $P_1$ and $P_2$ are not isomorphic over $K$.
If it outputs {\rm \textbf{ISOMORPHIC}}, then $P_1$ and $P_2$ are isomorphic over $K$.
\end{prop}

Given a family $\mathcal{P}$ of cubics in $K [x,y,z,w]$, we give an algorithm (Algorithm \ref{alg:isomprphic_family_Dege}) to compute a subset $\mathcal{P}^{\prime}$ such that
$P_1$ and $P_2$ are not isomorphic over $K$ for all $P_1, P_2 \in \mathcal{P}^{\prime}$ with $P_1 \neq P_2$.

\begin{algorithm}[h] %
\caption{$\texttt{NotIsomorphicListDege} ( \mathcal{P}, q )$}
\label{alg:isomprphic_family_Dege}
\begin{algorithmic}[1]
\REQUIRE{A list $\mathcal{P} = ( P_1, \ldots , P_t )$ of cubics in $\mathbb{F}_q [x,y,z,w]$, and $q = p^s$ a power of a prime $p$}
\ENSURE{A family $\mathcal{P}^{\prime \prime}$ of cubics in $\mathbb{F}_q [x,y,z,w]$}
\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\emptyset$, $FlagList1$ $\leftarrow$ $( 0 )_{i=1}^t$
\FOR{$i=1$ \TO $t-1$}
	\IF{$FlagList1[i] = 0$}
		\STATE $\mathcal{P}^{\prime}$ $\leftarrow$ $\mathcal{P}^{\prime} \cup \{ P_i \}$
		\FOR{$j=i+1$ \TO $t$}
			\STATE $IsomorphicFlag$ $\leftarrow$ $0$
			\FOR{$M_{\rm A} \in \mathrm{A}$}
				\FOR{$M_{s} \in \{ {\rm 1}_4, s \}$}
					\IF{$M_{s} = {\rm 1}_4$}
						\STATE $s_4$ $\leftarrow$ $1$, $s_5$ $\leftarrow$ $1$
					\ENDIF
					\STATE $g$ $\leftarrow$ $M_{\rm A} \cdot \tilde{T}(s_1,s_2) \cdot U (s_3) \cdot M_s \cdot U (s_4) \cdot V (s_5, 0,0,0)$
					\STATE $P_{i,j}$ $\leftarrow$ $g \cdot P_i - \lambda P_j  -  Q$
					\STATE $\mathcal{S}$ $\leftarrow$ $\{ s_i^{q-1} - 1 : 1 \leq i \leq 2 \} \cup \{ s_i^q - s_i : 3 \leq i \leq 4 \} \cup \{ s_5^{q-1} - 1, \lambda^{q-1} - 1 \}$
					\STATE $\mathrm{Mon}(P_{i,j})$ $\leftarrow$ the set of the monomials of $P_{i,j}$
					\FOR{$x^k y^{\ell} z^m w^n \in \mathrm{Mon}(P_{i,j})$}
						\STATE $f  (s_1, s_2, s_3, s_4, s_5, \lambda)$ $\leftarrow$ the coefficient of $x^k y^{\ell} z^m w^n$ in $P_{i,j}$
						\STATE $\mathcal{S}$ $\leftarrow$ $\mathcal{S} \cup \{ f (s_1, s_2, s_3, s_4, s_5, \lambda) \}$
					\ENDFOR
					\STATE $G$ $\leftarrow$ the reduced Gr\"{o}bner basis for $\langle \mathcal{S} \rangle \subset \mathbb{F}_q [ s_1, s_2, s_3, s_4, s_5, \lambda ]$
					\IF{$\sharp G \neq 1$}
						\STATE $IsomorphicFlag$ $\leftarrow$ $1$, \textbf{break} $M_{\rm W}$ and $M_{s}$
					\ENDIF
				\ENDFOR
			\ENDFOR
			\IF{$IsomorphicFlag = 1$}
				\STATE $FlagList1[j]$ $\leftarrow$ $1$
			\ENDIF
		\ENDFOR
	\ENDIF
\ENDFOR
\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\emptyset$, $FlagList2$ $\leftarrow$ $( 0 )_{i=1}^{\sharp \mathcal{P}^{\prime}}$
\FOR{$i=1$ \TO $\sharp \mathcal{P}^{\prime}-1$}
	\IF{$FlagList2[i] = 0$}
		\STATE $\mathcal{P}^{\prime \prime}$ $\leftarrow$ $\mathcal{P}^{\prime \prime} \cup \{ \mathcal{P}^{\prime} [i] \}$
		\FOR{$j=i+1$ \TO $t$}
			\IF{$\texttt{IsIsomorphicDege} ( \mathcal{P}^{\prime} [i], \mathcal{P}^{\prime} [j], q )$ returns \textbf{ISOMORPHIC}}
				\STATE $FlagList2[j]$ $\leftarrow$ $1$
			\ENDIF
		\ENDFOR
	\ENDIF
\ENDFOR
\RETURN $\mathcal{P}^{\prime \prime}$
\end{algorithmic}
\end{algorithm}
\fi


%==============================================================
\subsection{Computational parts of our proofs of the main theorems}\label{subsec:comp_result}
%==============================================================
% To prove main theorems,
% we in this subsection give computational results obtained by our implementation in a computer algebra system (for details on the implementation, see Section \ref{subsec:imple}).

In this subsection, we state computational results for our proofs of the main theorems.
Our computational results are shown by executing algorithms given in Sections \ref{subsec:algorithm} and \ref{subsec:isom}.
We implemented the algorithms in Magma~\cite{Magma}, \cite{MagmaHP}, a computer algebra system.
Details on the implementation will be described in Section \ref{subsec:imple}.

%==================================================
\subsubsection{Degenerate case for $q=5$}\label{subsubsec:comp_dege_q5}
%==================================================

\begin{prop}\label{prop:Degenerate_q5}
Consider the quadratic form $Q = 2 y w + z^2 \in \mathbb{F}_5 [x,y,z,w]$ and cubic forms $P \in \mathbb{F}_5 [x,y,z,w]$ of the form
\begin{enumerate}
\item[\rm (i)]
\begin{equation}
\begin{split}
P =& a_0 x^3 + ( a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 y z  + a_5 z w ) x  \\
& + a_6 y^3 + a_7 z^3 + a_8 w^3 + a_9 y z^2 + b_1 z^2 w + b_2 z w^2,
\end{split}\label{eq:Degeq5(1)}
\end{equation}
for $a_0, a_6 \in \mathbb{F}_{5}^{\times}$ and $b_1, b_2 \in \{ 0, 1 \}$, or
\item[\rm (ii)] 
\begin{equation}
P = x^3 + (a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 yz + b_1 zw)x + y^2z + zw^2 \label{eq:Degeq5(2)}
\end{equation}
for $a_i \in K= \mathbb{F}_5$ and $b_1 \in\{ 0,1  \}$.
\end{enumerate}
Then a cubic form $P$ of the form \eqref{eq:Degeq5(1)} or \eqref{eq:Degeq5(2)} such that $V(P,Q)$ is superspecial is one of
\begin{eqnarray}
P_1 &=&  x^3+y^3+w^3, \nonumber \\
P_2 &=& x^3+y^3+ 2 w^3, \nonumber \\
P_3 &=& x^3+y^3+w^3+zw^2, \nonumber \\
P_4 &=& x^3+y^3+2w^3+zw^2, \nonumber \\
P_5 &=& x^3+y^3+3w^3+zw^2, \nonumber \\
P_6 &=& x^3+y^3+4w^3+zw^2, \nonumber \\
P_7 &=& x^3+y^2z+zw^2 \nonumber 
\end{eqnarray}
up to isomorphism over $\mathbb{F}_{5}$.
\end{prop}

\begin{proof}
\begin{description}
\item[{\rm (i)}]
Put $t = 10$, $u = 2$ and
\begin{eqnarray}
\{ p_1, \ldots , p_t \} & = & \{ x^3, x y^2, x z^2, x w^2, x y z, x z w, y^3, z^3, w^3, y z^2 \}, \nonumber \\
\{ q_1, \ldots , q_u \} & = & \{ z^2 w, z w^2 \}. \nonumber 
\end{eqnarray}
For each $( b_1, b_2 ) \in \{ 0, 1 \}^{\oplus 2}$ and $a_0, a_6 \in \mathbb{F}_{5}^{\times}$, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{5} [a_1, \ldots, a_5, a_7, a_8, a_9]$, where $a_1, \ldots, a_5, a_7, a_8, a_9$ are indeterminates. 
	\item[{\rm (2)}] We regard the $8$ coefficients $a_1, \ldots , a_5$, $a_7$, $a_8$, $a_9$ as indeterminates.
	For solving multivariate systems over $\mathbb{F}_{5} [ a_1, \ldots , a_5, a_7, a_8, a_9 ]$ in the next step, we adopt the graded reverse lexicographic (grevlex) order with
\[
a_{8} \prec a_7 \prec a_9 \prec a_3 \prec a_5 \prec a_2 \prec a_4, \prec a_1,
\]
	whereas for $\mathbb{F}_{5} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
	\item[{\rm (3)}] We proceed the following three steps:
	\begin{description}
		\item[{\rm (a)}] Let $\mathcal{S}$ be the set of the coefficients of the monomials of $\mathcal{M}$ in $h$, where the set $\mathcal{M}$ consists of the $16$ monomials in Proposition \ref{cor:HW}.
		Note that $\mathcal{S} \subset \mathbb{F}_{5} [a_1, \ldots, a_5, a_7, a_8, a_9 ]$.
		\item[{\rm (b)}] Solve the multivariate system $f ( a_1, a_2, a_3, a_4, a_5, a_7, a_8, a_9) = 0$ for all $f \in \mathcal{S}$ over $\mathbb{F}_{5}$ with known algorithms via the Gr\"{o}bner basis computation.
		\item[{\rm (c)}] For each solution $(a_1, a_2, a_3, a_4, a_5, a_7, a_8, a_9 )$ of the above system,  substitute it into unknown coefficients in $P$, and decide whether $C = V ( P, Q)$ is non-singular or not. %by Algorithm \ref{alg:non-sing}.
	\end{description}
\end{description}

\item[{\rm (ii) }]
For each $b_1 \in \{ 0, 1 \}$, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{5} [a_1, a_2, a_3, a_4]$, where $a_1, a_2, a_3, a_4$ are indeterminates. 
	\item[{\rm (2)}] We regard the $4$ coefficients $a_1$, $a_2$, $a_3$, $a_4$ as indeterminates.
	For computing Gr\"{o}bner bases over $\mathbb{F}_{5} [ a_1, a_2, a_3, a_4 ]$, we adopt the grevlex order with
\[
a_{3} \prec a_2 \prec a_4 \prec a_1,
\]
	whereas for $\mathbb{F}_{5} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
	\item[{\rm (3)}] As in the case (i), we enumerate $(a_1, a_2, a_3, a_4)$ such that $C$ is superspecial.
\end{description}
\end{description}
Let $\mathcal{P}$ be the list of cubics $P$ such that $V(P,Q)$ was determined to be superspecial in the above procedures (i) and (ii).
For the inputs $\mathcal{P}$ and $q=5$, we execute a variant of Algorithm \ref{alg:isomorphic_family}.
%By Proposition \ref{prop:isomorphicN1} together with 
By the outputs of our computation,
a cubic form $P$ of the form \eqref{eq:Degeq5(1)} or \eqref{eq:Degeq5(2)} such that $V(P,Q)$ is superspecial is one of 
$P_i$ for $1 \leq i \leq 7$, up to isomorphism over $\mathbb{F}_{5}$.
\end{proof}


%=================================================
\subsubsection{Case of (N1) for $q = 11$}\label{subsubsec:comp_N1_q11}
%=================================================

\begin{prop}\label{prop:N1q11}
Consider the quadratic form $Q = 2 x w + 2 y z \in \mathbb{F}_{11}[x,y,z,w]$ and cubic forms $P \in \mathbb{F}_{11}[x,y,z,w]$ of the form
\begin{equation}
\begin{split}
P =& ( y + b_1 z) x^2 + b_2 x z^2 \\
& + a_1 y^3 + a_2 y^2 z + a_3 y z^2 + a_4 z^3 \\
& + ( a_5 y^2  + a_6 y z  + a_7 z^2 ) w + ( a_8  y + a_9 z ) w^2 + a_{10} w^3,
\end{split}\label{eq:N1q11}
\end{equation}
where $a_1, \ldots , a_{10} \in \mathbb{F}_{11}$, $b_1 \in \{ 0, 1, \zeta^{(11)} \}$ and $b_2 \in \{ 0, 1 \}$.
Here $\zeta^{(11)}$ is a primitive element of $\mathbb{F}_{11}$.
Then a cubic form $P$ of the form \eqref{eq:N1q11} such that $V(P,Q)$ is superspecial is one of
\begin{eqnarray}
% & & x^2 y + y^2 z + 2 y z^2 + 6 z^3 + 3 y^2 w + y z w + 4 z^2 w + 7 y w^2 + z w^2 + 8 w^3, \nonumber \\
% & & x^2 y + y^2 z + 2 y z^2 + 6 z^3 + 8 y^2 w + 10 y z w + 7 z^2 w + 7 y w^2 + z w^2 + 3 w^3, \nonumber \\
% & & ... \\
P_1^{({\rm N1})}&= & x^2 y + x^2 z + 2 y^2 z + 5 y^2 w + 9 y z^2 + y z w + 4 z^3 + 3 z^2 w + 10 z w^2 + w^3, \nonumber \\
P_2^{({\rm N1})}&= & x^2 y + x^2 z + y^3 + y^2 z + 7 y z^2 + 4 y w^2 + 2 z^3 + 9 z w^2, \nonumber \\
P_3^{({\rm N1})}&= & x^2 y + x^2 z + y^3 + 8 y^2 z + 3 y z^2 + 10 y w^2 + 10 z^3 + 10 z w^2, \nonumber \\
P_4^{({\rm N1})}&= & x^2 y + x^2 z + y^3 + 9 y^2 z + 2 y^2 w + 3 y z^2 + 3 y z w + 4 y w^2 + 10 z^3 + 2 z^2 w + 6 z w^2, \nonumber \\
P_5^{({\rm N1})}&= & x^2 y + x^2 z + x z^2 + 10 y^2 w + 9 y z^2 + 9 y w^2 + 8 z^3 + 8 z^2 w + 8 z w^2 + 3 w^3, \nonumber \\
P_6^{({\rm N1})}&= & x^2 y + x^2 z + x z^2 + 9 y^2 z + 5 y^2 w + y z w + 8 y w^2 + 3 z^3 + 9 z^2 w + 2 z w^2 + 5 w^3, \nonumber \\
P_7^{({\rm N1})}&= & x^2 y + x^2 z + x z^2 + 4 y^3 + 2 y^2 z + 10 y^2 w + 3 y z^2 + 8 y z w + 8 y w^2 + 8 z^3 + 7 z^2 w + 7 z w^2 + 4 w^3, \nonumber \\
P_8^{({\rm N1})}&= & x^2 y + x^2 z + x z^2 + 9 y^3 + 6 y^2 z + 5 y^2 w + 8 y z^2 + 5 y z w + 2 y w^2 + z^3 + 2 z^2 w + 7 z w^2 + w^3 \nonumber
\end{eqnarray}
up to isomorphism over $\mathbb{F}_{11}$.
\end{prop}

\begin{proof}
Put $t = 10$, $u = 2$ and
\begin{eqnarray}
\{ p_1, \ldots , p_t \} & = & \{ y^3, y^2 z, y z^2, z^3, y^2 w, y z w, z^2 w, y w^2, z w^2, w^3 \}, \nonumber \\
\{ q_1, \ldots , q_u \} & = & \{ x^2 z, x z^2\}. \nonumber 
\end{eqnarray}
We divide our computation into the following three cases (this is our technical strategy to avoid the out of memory errors). 
\begin{description}
\item[{\bf (i) Case of $b_1 \neq 0$}.]
For each $b_1 \in \{ 1, \zeta^{(11)} \}$ and $b_2 \in \{ 0, 1 \}$, execute Modified Version of Main Algorithm in \cite{KH16}, given in Section \ref{subsec:algorithm}.
We here give an outline of our computation together with our choices of $s_1$, $s_2$, $\{ k_1, \ldots , k_{s_1} \}$, $\{ i_1, \ldots , i_{s_2} \}$, $\mathcal{A}_1$, $\mathcal{A}_2$ and a term ordering in the algorithm.
\begin{description}
\item[{\rm (0)}]
We set $s_1:= 8$, and $( k_1, \ldots , k_{s_1} ):= ( 3, \ldots , 10)$ (we regard the $8$ coefficients $a_3$, $a_4$, $a_5$, $a_6$, $a_7$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
Let $\mathcal{A}_1:=\mathbb{F}_{11} \times \mathbb{F}_{11}$.
%We proceed the following three steps:
 \end{description}
For each $( a_1, a_2) \in \mathcal{A}_1 = \mathbb{F}_{11} \times \mathbb{F}_{11}$, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{11} [a_3, \ldots, a_{10}]$, where $a_3, \ldots, a_{10}$ are indeterminates. 
	\item[{\rm (2)}] We set $s_2 := 6$, and $(i_1, \ldots , i_{s_2}) := ( 4, 5, 6, 8, 9, 10)$ (we regard the $6$ coefficients $a_4$, $a_5$, $a_6$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
	For solving multivariate systems over $\mathbb{F}_{11} [ a_4, a_5, a_6, a_8, a_9, a_{10}]$ in the next step, we adopt the graded reverse lexicographic (grevlex) order with
\[
a_{10} \prec a_9 \prec a_4 \prec a_8 \prec a_6 \prec a_5,
\]
	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
	Put $\mathcal{A}_2 := \mathbb{F}_{11} \times \mathbb{F}_{11}$.
	\item[{\rm (3)}] As in the case (i) of the proof of Proposition \ref{prop:Degenerate_q5}, we compute cubic forms $P$ such that $V(P,Q)$ are superspecial.
More precisely, we proceed the following three steps for each $( a_3, a_7 ) \in \mathcal{A}_2= \mathbb{F}_{11} \times \mathbb{F}_{11}$: 
	\begin{description}
		\item[{\rm (a)}] Let $\mathcal{S}$ be the set of the coefficients of the monomials of $\mathcal{M}$ in $h$, where the set $\mathcal{M}$ consists of the $16$ monomials in Corollary \ref{cor:HW}.
		Note that $\mathcal{S} \subset \mathbb{F}_{11} [a_4, a_5, a_6, a_8, a_9, a_{10} ]$.
		\item[{\rm (b)}] Solve the multivariate system $f ( a_4, a_5, a_6, a_8, a_9, a_{10} ) = 0$ for all $f \in \mathcal{S}$ over $\mathbb{F}_{11}$ with known algorithms via the Gr\"{o}bner basis computation.
		\item[{\rm (c)}] For each solution $(a_4, a_5, a_6, a_8, a_9, a_{10} )$ of the above system, substitute it into unknown coefficients in $P$, and decide whether $C = V ( P, Q)$ is non-singular or not. %by Algorithm \ref{alg:non-sing}.
	\end{description}
\end{description}


\item[{\bf (ii) Case of $b_1 = 0$ and $a_4 \neq 0$}.]
For each $b_2 \in \{ 0, 1 \}$, execute Modified Version of Main Algorithm in \cite{KH16}, given in Section \ref{subsec:algorithm}.
We here give an outline of our computation together with our choices of $s_1$, $s_2$, $\{ k_1, \ldots , k_{s_1} \}$, $\{ i_1, \ldots , i_{s_2} \}$, $\mathcal{A}_1$, $\mathcal{A}_2$ and a term ordering in the algorithm.
\begin{description}
\item[{\rm (0)}]
We set $s_1:= 9$, and $( k_1, \ldots , k_{s_1} ):= ( 2, \ldots , 10)$ (we regard the $9$ coefficients $a_2$, $a_3$, $a_4$, $a_5$, $a_6$, $a_7$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
Let $\mathcal{A}_1:= \mathbb{F}_{11}$.
\end{description}
For each $a_1 \in \mathcal{A}_1 = \mathbb{F}_{11}$, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{11} [a_2, \ldots, a_{10}]$, where $a_2, \ldots, a_{10}$ are indeterminates. 
	\item[{\rm (2)}] Put $s_2 := 5$, and $(i_1, \ldots , i_{s_2}) := ( 5, 6, 8, 9, 10)$ (we regard the $5$ coefficients $a_5$, $a_6$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
	For solving multivariate systems over $\mathbb{F}_{11} [ a_5, a_6, a_8, a_9, a_{10}]$ in the next step, we adopt the grevlex order with
\[
a_{10} \prec a_9 \prec a_8 \prec a_6 \prec a_5,
\]
	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
	Put $\mathcal{A}_2 := \mathbb{F}_{11} \times \mathbb{F}_{11} \times \mathbb{F}_{11}^{\times} \times \mathbb{F}_{11}$.
	\item[{\rm (3)}] We conduct a procedure similar to Step 3 in Case of $b_1 \neq 0$.
Specifically for each $( a_2, a_3, a_4, a_7 ) \in \mathcal{A}_2$, enumerate $(a_5, a_6, a_8, a_9, a_{10} )$ such that $C=V(P,Q)$ is superspecial.
\end{description}

\item[{\bf (iii) Case of $b_1 = 0$ and $a_4 = 0$}.]
For each $b_2 \in \{ 0, 1 \}$, execute Modified Version of Main Algorithm in \cite{KH16}, given in Section \ref{subsec:algorithm}.
We here give an outline of our computation together with our choices of $s_1$, $s_2$, $\{ k_1, \ldots , k_{s_1} \}$, $\{ i_1, \ldots , i_{s_2} \}$, $\mathcal{A}_1$, $\mathcal{A}_2$ and a term ordering in the algorithm.
\begin{description}
\item[{\rm (0)}]
We set $s_1:= 8$, and $( k_1, \ldots , k_{s_1} ):= ( 2, 3, 5, 6, \ldots , 10)$ (we regard the $8$ coefficients $a_2$, $a_3$, $a_5$, $a_6$, $a_7$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
Let $\mathcal{A}_1:=\mathbb{F}_{11}$.
\end{description}
For each $a_1 \in \mathcal{A}_1 = \mathbb{F}_{11} $, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{11} [a_2, a_3, a_5, a_6, \ldots, a_{10}]$, where $a_2, a_3, a_5, a_6, \ldots, a_{10}$ are indeterminates. 
	\item[{\rm (2)}] Put $s_2 := 4$, and $(i_1, \ldots , i_{s_2}) := ( 6, 8, 9, 10)$ (we regard the $4$ coefficients $a_6$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
	For solving multivariate systems over $\mathbb{F}_{11} [ a_6, a_8, a_9, a_{10}]$ in the next step, we adopt the grevlex order with
\[
a_{10} \prec a_9 \prec a_8 \prec a_6,
\]
	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
	Put $\mathcal{A}_2 := \mathbb{F}_{11} \times \mathbb{F}_{11} \times \mathbb{F}_{11} \times \mathbb{F}_{11}$.
	\item[{\rm (3)}] We conduct a procedure similar to Step 3 in Case of $b_1 \neq 0$.
Specifically for each $( a_2, a_3, a_5, a_7 ) \in \mathcal{A}_2$, enumerate $(a_6, a_8, a_9, a_{10} )$ such that $C=V(P,Q)$ is superspecial.
\end{description}
\end{description}
Let $\mathcal{P}$ be the list of cubics $P$ such that $V(P,Q)$ was determined to be superspecial in the above procedures (i), (ii) and (iii).
For the inputs $\mathcal{P}$ and $q=11$, we execute Collecting Isomorphism Classes Algorithm for (N1), given in Section \ref{subsec:isom}.
By the outputs of our computation, a cubic form $P$ of the form \eqref{eq:N1q11} such that $V(P,Q)$ is superspecial is one of $P_i^{({\rm N1})}$ for $1 \leq i \leq 7$, up to isomorphism over $\mathbb{F}_{11}$.
\end{proof}

% Note in this case that the number of possible $(b_1, b_2, a_1, a_2, a_3, a_4)$, the coefficients which we run, is $3 \cdot 2 \cdot 10 \cdot 11 \cdot 11 \cdot 11 = 79860$.


%=============================
% \subsubsection{Case of (N1) (ii) for $q = 11$}
%=============================

% \begin{prop}\label{prop:N1(ii)q11}
% Consider the quadratic form $Q = 2 x w + 2 y z$ and
% \begin{eqnarray}
% P &=& ( a_1 y + a_2 z) x^2 + a_3 x z^2  \nonumber \\
% & & + b_1 y^2 z + b_2 y z^2 + a_4 z^3 \nonumber \\
% & & + ( a_5 y^2  + a_6 y z  + b_3 z^2 ) w + ( a_7  y + a_8 z ) w^2 + a_9 w^3, \nonumber
% \end{eqnarray}
% where $a_1 \neq 0$, $b_1 \in \{ 0, 1 \}$, $b_2 \in \{ 0, 1, \zeta  \}$ and $b_3 \in \{ 0, 1 \}$.
% Then $V (P, Q)$ is superspecial if and only if $(b_1, b_2, b_3, a_1, \ldots , a_9)$ is equal to one of the sequences in .... 
% \end{prop}

% \begin{proof}
% Put $t = 9$, $u = 3$ and
% \begin{eqnarray}
% \{ p_1, \ldots , p_t \} & = & \{ y x^2, z x^2, x z^2, z^3, y^2 w, y z w, y w^2, z w^2, w^3 \}, \nonumber \\
% \{ q_1, \ldots , q_u \} & = & \{ y^2 z, y z^2, z^2 w \}. \nonumber 
% \end{eqnarray}
% For each $( b_1, b_2, b_3 )$, we proceed the following three steps:
% \begin{enumerate}
% 	\item Compute $(P Q)^{p-1}$ over $\mathbb{F}_{11} [a_1, \ldots, a_9]$, where $a_1, \ldots, a_9$ are indeterminates. 
% 	\item Put $s := 5$, and $(i_1, \ldots , i_5) := ( 5, 6, 7, 8, 9)$ (we regard the $5$ coefficients $a_5$, $a_6$, $a_7$, $a_8$, $a_9$ as indeterminates).
% In this case we adopt the grevlex order with
% 	\[
% 	a_9 \prec a_8 \prec a_7 \prec a_6 \prec a_5,
% 	\]
% 	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
% 	Put $\mathcal{A} = \mathbb{F}_{11}^{\times} \times \mathbb{F}_{11} \times \mathbb{F}_{11} \times \mathbb{F}_{11}$.
% 	\item For each $( a_1, a_2, a_3, a_4 ) \in \mathcal{A}$, as in Case {\bf (N1)} (i), we enumerate $( a_5, a_6, a_7 , a_8, a_9 )$ such that $C$ is superspecial by Algorithm \ref{alg:enume}.
% \end{enumerate}
% It follows from the outputs of our computation that $V (P, Q)$ is superspecial if and only if $(b_1, b_2, b_3, a_1, \ldots , a_9)$ is equal to one of the sequences in .... 
% \end{proof}

% The number of possible $(b_1, b_2, b_3, a_1, a_2, a_3, a_4)$ is $2 \cdot 3 \cdot 2 \cdot 10 \cdot 11 \cdot 11 \cdot 11 = 159720$.


% %=============================
% \subsubsection{Case of (N1) (iii) for $q = 11$}
% %=============================

% \begin{prop}\label{prop:N1(iii)q11}
% Consider the quadratic form $Q = 2 x w + 2 y z$ and
% \begin{eqnarray}
% P &=& ( a_1 y^2 + a_2 y z + a_3 z^2) x   \nonumber \\
% & & + b_1 y z^2 + b_2 z^3 \nonumber \\
% & & + ( a_4 y^2  + a_5 y z  + b_3 z^2 ) w + ( a_6  y + a_7 z ) w^2 + a_8 w^3, \nonumber
% \end{eqnarray}
% where $a_1 \neq 0$, $b_1 \in \{ 0, 1 \}$, $b_2 \in \{ 0, 1, \zeta  \}$ and $b_3 \in \{ 0, 1 \}$.
% Then there does not exist $( b_1, b_2, b_3, a_1, \ldots , a_8 )$ such that $V (P, Q)$ is superspecial.?
% \end{prop}

% \begin{proof}
% We set $t = 8$, $u = 3$ and
% \begin{eqnarray}
% \{ p_1, \ldots , p_t \} & = & \{ y^2 x, y z x, x z^2, y^2 w, y z w, y w^2, z w^2, w^3 \}, \nonumber \\
% \{ q_1, \ldots , q_u \} & = & \{ y z^2, z^3, z^2 w \}. \nonumber 
% \end{eqnarray}
% For each $( b_1, b_2, b_3 )$, we conduct the following procedures:
% \begin{enumerate}
% 	\item Put $s := 5$, and $(i_1, \ldots , i_5) := ( 4, 5, 6, 7, 8)$ (we regard the $5$ coefficients $a_4$, $a_5$, $a_6$, $a_7$, $a_8$ as variables).
% In this case we adopt the grevlex order with
% 	\[
% 	a_8 \prec a_7 \prec a_6 \prec a_5 \prec a_4.
% 	\]
% 	For $\mathbb{F}_{11} [ x, y, z, w]$, we adopt the grevlex order with $w \prec z \prec y \prec x$.
% 	Put $\mathcal{A} = \mathbb{F}_{11}^{\times} \times \mathbb{F}_{11} \times \mathbb{F}_{11}$.
% 	\item For each $( a_1, a_2, a_3 ) \in \mathcal{A}$, as in Case {\bf (N1)} (i), we enumerate $( a_4, a_5, a_6, a_7 , a_8 )$ such that $C$ is superspecial by Algorithm \ref{alg:enume}.
% \end{enumerate}
% It follows from the outputs of our computation that there does not exist $( b_1, b_2, b_3, a_1, \ldots , a_8 )$ such that $V (P, Q)$ is superspecial.
% \end{proof}

% The number of possible $(b_1, b_2, b_3, a_1, a_2, a_3 )$ is $2 \cdot 3 \cdot 2 \cdot 10 \cdot 11 \cdot 11 = 14520$.


% %=============================
% \subsubsection{Case of (N1) (iv) for $q = 11$}
% %=============================

% \begin{prop}\label{prop:N1(iv)q11}
% Consider the quadratic form $Q = 2 x w + 2 y z$ and
% \begin{eqnarray}
% P &=& a_1 x y z   \nonumber \\
% & & + a_2 y^3 + a_3 y^2 z + b_1 y z^2 + b_2 z^3 \nonumber \\
% & & + ( a_4 y^2  + a_5 y z  + b_3 z^2 ) w + ( a_6  y + a_7 z ) w^2 + a_8 w^3, \nonumber
% \end{eqnarray}
% where $b_1 \in \{ 0, 1 \}$, $b_2 \in \{ 0, 1, \zeta  \}$ and $b_3 \in \{ 0, 1 \}$.
% ?Then there does not exist $( b_1, b_2, b_3, a_1, \ldots , a_8 )$ such that $V (P, Q)$ is superspecial.?
% \end{prop}

% \begin{proof}
% We set $t = 8$, $u = 3$ and
% \begin{eqnarray}
% \{ p_1, \ldots , p_t \} & = & \{ y z x, y^3, y^2 z, y^2 w, y z w, y w^2, z w^2, w^3 \}, \nonumber \\
% \{ q_1, \ldots , q_u \} & = & \{ y z^2, z^3, z^2 w \}. \nonumber 
% \end{eqnarray}
% For each $( b_1, b_2, b_3 )$, we conduct the following procedures:
% \begin{enumerate}
% 	\item Put $s := 5$, and $(i_1, \ldots , i_5) := ( 4, 5, 6, 7, 8)$ (we regard the $5$ coefficients $a_4$, $a_5$, $a_6$, $a_7$, $a_8$ as variables).
% In this case we adopt the grevlex order with
% 	\[
% 	a_8 \prec a_7 \prec a_6 \prec a_5 \prec a_4.
% 	\]
% 	For $\mathbb{F}_{11} [ x, y, z, w]$, we adopt the grevlex order with $w \prec z \prec y \prec x$.
% 	Put $\mathcal{A} = \mathbb{F}_{11}^{\times} \times \mathbb{F}_{11} \times \mathbb{F}_{11}$.
% 	\item For each $( a_1, a_2, a_3 ) \in \mathcal{A}$, as in Case {\bf (N1)} (i), we enumerate $( a_4, a_5, a_6, a_7 , a_8 )$ such that $C$ is superspecial by Algorithm \ref{alg:enume}.
% \end{enumerate}
% It follows from the outputs of our computation that there does not exist $( b_1, b_2, b_3, a_1, \ldots , a_8 )$ such that $V (P, Q)$ is superspecial.
% \end{proof}

% The number of possible $(b_1, b_2, b_3, a_1, a_2, a_3 )$ is $2 \cdot 3 \cdot 2 \cdot 11 \cdot 11 \cdot 11 = 15972$.



%================================================
\subsubsection{Case of (N2) for $q = 11$}\label{subsubsec:comp_N2_q11}
%================================================

\begin{prop}\label{prop:N2q11}
Consider the quadratic form $Q = 2 x w + y^2 - \epsilon z^2 \in \mathbb{F}_{11}$ with $\mathbb{F}_{11}^{\times} \smallsetminus ( \mathbb{F}_{11}^{\times} )^2$ and cubic forms of the form
\begin{equation}
\begin{split}
P = & ( a_1 y + a_2 z ) x^2 + a_3 (y^2 - \epsilon z^2) x + b_1 y ( y^2 - \epsilon z^2 ) + a_4 y ( y^2 + 3 \epsilon z^2 ) + a_5 z (3 y^2 + \epsilon z^2 ) \\
& + ( a_6 y^2 + a_7 y z + b_2 z^2 ) w + ( a_8 y + a_9 z ) w^2 + a_{10} w^3,
\end{split}\label{eq:N2q11}
\end{equation}
where $(a_1, a_2) \in (\mathbb{F}_{11} \times \mathbb{F}_{11}) \smallsetminus \{ (0, 0) \}$ and $b_1, b_2 \in \{ 0, 1 \}$.
Then a cubic form $P$ of the form \eqref{eq:N2q11} such that $V(P,Q)$ is superspecial is one of
\begin{eqnarray}
P_1^{({\rm N2})}& = & x^2 y + x^2 z + x y^2 + 9 x z^2 + 6 y^3 + y^2 z + 5 y^2 w + 3 y z^2 + 9 y w^2 + 8 z^3 + z^2 w + 9 z w^2 + 6 w^3, \nonumber \\
P_2^{({\rm N2})}&= & x^2 z + 5 y^3 + 4 z w^2, \nonumber \\
P_3^{({\rm N2})}&= & x^2 y + x^2 z + 9 y^3 + 8 y^2 z + 2 y z^2 + 4 y w^2 + 9 z^3 + 4 z w^2, \nonumber \\
P_4^{({\rm N2})}&= & 8 x^2 y + 2 x^2 z + y^3 + 8 y^2 z + 6 y^2 w + 9 y z^2 + 2 y z w + 5 y w^2 + 9 z^3 + z^2 w + 4 z w^2 + w^3, \nonumber \\
P_5^{({\rm N2})}&= & 6 x^2 y + 4 x^2 z + 6 x y^2 + 10 x z^2 + 10 y^3 + 4 y^2 z + 3 y^2 w + 8 y z^2 + 6 y z w + 9 y w^2 + 10 z^3 \nonumber \\
& & + z^2 w + z w^2 + 9 w^3, \nonumber
\end{eqnarray}
up to isomorphism over $\mathbb{F}_{11}$.
\end{prop}

\begin{proof}
Put $t = 10$, $u = 2$ and
\begin{eqnarray}
\{ p_1, \ldots , p_t \} & = & \{ y x^2, z x^2, ( y^2 - \epsilon z^2) x, y ( y^2 + 3 \epsilon z^2 ), z (3 y^2 + \epsilon z^2 ), y^2 w , y z w, y w^2, z w^2, w^3 \}, \nonumber \\
\{ q_1, \ldots , q_u \} & = & \{ y ( y^2 - \epsilon z^2 ), z^2 w \}. \nonumber 
\end{eqnarray}
For each $(b_1, b_2 ) \in \{0, 1 \}^{\oplus 2}$, execute Modified Version of Main Algorithm in \cite{KH16}, given in Section \ref{subsec:algorithm}.
We here give an outline of our computation together with our choices of $s_1$, $s_2$, $\{ k_1, \ldots , k_{s_1} \}$, $\{ i_1, \ldots , i_{s_2} \}$, $\mathcal{A}_1$, $\mathcal{A}_2$ and a term ordering in the algorithm.
\begin{description}
\item[{\rm (0)}]
We set $s_1:= 9$, and $( k_1, \ldots , k_{s_1} ):= ( 1, 2, 4, \ldots , 10)$ (we regard the $9$ coefficients $a_1$, $a_2$, $a_4$, $a_5$, $a_6$, $a_7$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
Let $\mathcal{A}_1:=\mathbb{F}_{11}$.
\end{description}
For each $a_3 \in \mathcal{A}_1 = \mathbb{F}_{11}$, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{11} [a_1, a_2, a_4, \ldots, a_{10}]$, where $a_1, a_2, a_4, \ldots, a_{10}$ are indeterminates. 
	\item[{\rm (2)}] Put $s_2 := 5$, and $(i_1, \ldots , i_{s_2}) := ( 6, 7, 8, 9, 10)$ (we regard the $5$ coefficients $a_6$, $a_7$, $a_8$, $a_9$, $a_{10}$ as indeterminates).
	 For solving multivariate systems over $\mathbb{F}_{11} [ a_6, a_7, a_8, a_9, a_{10}]$ in the next step, we adopt the grevlex order with
\[
a_{10} \prec a_9 \prec a_8 \prec a_7 \prec a_6,
\]
	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, the grevlex order with $w \prec z \prec y \prec x$ is adopted.
	Put $\mathcal{A}_2 := (\mathbb{F}_{11} \times \mathbb{F}_{11} \smallsetminus \{ (0, 0 ) \} ) \times \mathbb{F}_{11} \times \mathbb{F}_{11}$.
	\item[{\rm (3)}] We conduct a procedure similar to Case of $b_1 \neq 0$ in Proposition \ref{prop:N1q11}.
Specifically for each $( a_1, a_2, a_4, a_5 ) \in \mathcal{A}_2$, enumerate $( a_6, a_7, a_8, a_9, a_{10} )$ such that $C=V(P,Q)$ is superspecial.
\end{description}
Let $\mathcal{P}$ be the list of cubics $P$ such that $V(P,Q)$ was determined to be superspecial in the above procedures.
For the inputs $\mathcal{P}$ and $q=11$, we execute a variant of Isomorphism Classes Collecting Algorithm given in Section \ref{subsec:isom} (for constructing the variant, see Remark \ref{rem:isom} (2)).
By the outputs of our computation, a cubic form $P$ of the form \eqref{eq:N2q11} such that $V(P,Q)$ is superspecial is one of $P_i^{({\rm N2})}$ for $1 \leq i \leq 5$, up to isomorphism over $\mathbb{F}_{11}$.
\end{proof}

% The number of possible $(b_1, b_2, a_1, a_2 )$ is $2 \cdot 2 \cdot (25^2 - 1 ) = 2496$.

%====================================================
\subsubsection{Degenerate case for $q=11$}\label{subsubsec:comp_dege_q11}
%====================================================

\begin{prop}\label{prop:Degenerate_q11}
Consider the quadratic form $Q = 2 y w + z^2 \in \mathbb{F}_{11}[x,y,z,w]$ and cubic forms $P \in \mathbb{F}_{11}[x,y,z,w]$ of the form
\begin{equation}
\begin{split}
P =& a_0 x^3 + ( a_1 y^2 + a_2 z^2 + a_3 w^2 + a_4 y z  + a_5 z w ) x  \\
& + a_6 y^3 + a_7 z^3 + a_8 w^3 + a_9 y z^2 + b_1 z^2 w + b_2 z w^2,
\end{split}\label{eq:Degeq11}
\end{equation}
where $a_0, a_6 \in \mathbb{F}_{11}^{\times}$, $b_1, b_2 \in \{ 0, 1 \}$.
Then a cubic form $P$ of the form \eqref{eq:Degeq11} such that $V(P,Q)$ is superspecial is one of
\begin{eqnarray}
P_1^{({\rm Dege})}&= & w^3+x^3+y^3, \nonumber \\
P_2^{({\rm Dege})}&= & 2 w^3+x^3+y^3, \nonumber \\
P_3^{({\rm Dege})}&= & 5 w^3+x^3+y^3+z^3, \nonumber \\
P_4^{({\rm Dege})}&= & w^2 x+x^3+y^3, \nonumber \\
P_5^{({\rm Dege})}&= & 2 w^2 x+x^3+y^3, \nonumber \\
P_6^{({\rm Dege})}&= & w^3+w x z+x^3+y^3+7 z^3, \nonumber \\
P_7^{({\rm Dege})}&= & 4 w^3+w^2 x+x^3+x y z+y^3+5 z^3, \nonumber \\
P_8^{({\rm Dege})}&= & 8 w^3+6 w^2 x+x^3+x y z+y^3+8 z^3, \nonumber \\
P_9^{({\rm Dege})}&= & 4 w^3+w^2 z+x^3+5 y^3+2 y z^2+z^3, \nonumber \\
P_{10}^{({\rm Dege})}&= & 2 w^3+w z^2+x^3+y^3+8 y z^2, \nonumber \\
P_{11}^{({\rm Dege})} &= & 3 w^3+w z^2+x^3+2 y^3+2 y z^2+4 z^3, \nonumber \\
P_{12}^{({\rm Dege})} &= & 10 w^3+w z^2+x^3+2 y^3+4 y z^2, \nonumber \\
P_{13}^{({\rm Dege})}&= & 7 w^3+w^2 z+w z^2+x^3+2 y^3+4 y z^2+z^3, \nonumber \\
P_{14}^{({\rm Dege})}&= & 7 w^3+2 w^2 x+w^2 z+8 w x z+w z^2+x^3+x y^2+7 x y z+8 x z^2+2 y^3+4 y z^2+z^3, \nonumber \\
P_{15}^{({\rm Dege})} &= & 10 w^3+w^2 z+w z^2+x^3+5 y^3+3 y z^2+5 z^3, \nonumber \\
P_{16}^{({\rm Dege})}&= & 6 w^3+w^2 z+w z^2+x^3+6 y^3+2 y z^2+6 z^3, \nonumber \\
P_{17}^{({\rm Dege})}& =& w^2 z+w z^2+x^3+10 y^3+6 y z^2+7 z^3, \nonumber 
\end{eqnarray}
up to isomorphism over $\mathbb{F}_{11}$.
\end{prop}

\begin{proof}
Put $t = 10$, $u = 2$ and
\begin{eqnarray}
\{ p_1, \ldots , p_t \} & = & \{ x^3, x y^2, x z^2, x w^2, x y z, x z w, y^3, z^3, w^3, y z^2 \}, \nonumber \\
\{ q_1, \ldots , q_u \} & = & \{ z^2 w, z w^2 \}. \nonumber 
\end{eqnarray}
For each $(b_1, b_2 ) \in \{ 0,1 \}^{\oplus 2}$, execute Modified Version of Main Algorithm in \cite{KH16}, given in Section \ref{subsec:algorithm}.
We here give an outline of our computation together with our choices of $s_1$, $s_2$, $\{ k_1, \ldots , k_{s_1} \}$, $\{ i_1, \ldots , i_{s_2} \}$, $\mathcal{A}_1$, $\mathcal{A}_2$ and a term ordering in the algorithm.
\begin{description}
\item[{\rm (0)}]
We set $s_1:= 9$, and $( k_1, \ldots , k_{s_1} ):= ( 1, \ldots , 9)$ (we regard the $9$ coefficients $a_1$, $a_2$, $a_3$, $a_4$, $a_5$, $a_6$, $a_7$, $a_8$, $a_9$ as indeterminates).
Let $\mathcal{A}_1:=\mathbb{F}_{11}^{\times}$.
\end{description}
For each $a_0 \in \mathcal{A}_1:= \mathbb{F}_{11}^{\times}$, we proceed the following three steps:
\begin{description}
	\item[{\rm (1)}] Compute $h:= (P Q)^{p-1}$ over $\mathbb{F}_{11} [a_1, \ldots, a_9]$, where $a_1, \ldots, a_9$ are indeterminates. 
	\item[{\rm (2)}] Put $s_2 := 6$, and $(i_1, \ldots , i_{s_2}) := ( 2, 3, 5, 7, 8, 9)$ (we regard the $6$ coefficients $a_2$, $a_3$, $a_5$, $a_7$, $a_8$, $a_9$ as indeterminates).
	For solving multivariate systems over $\mathbb{F}_{11}[a_2, a_3, a_5, a_7, a_8, a_9]$, we adopt the grevlex order with
\[
a_8 \prec a_7 \prec a_9 \prec a_3 \prec a_5 \prec a_2,
\]
	whereas for $\mathbb{F}_{11} [ x, y, z, w]$, we adopt the grevlex order with $w \prec z \prec y \prec x$.
	Put $\mathcal{A}_2 := \mathbb{F}_{11} \times \mathbb{F}_{11} \times \mathbb{F}_{11}^{\times}$.
	\item[{\rm (3)}] We conduct a procedure similar to Case of $b_1 \neq 0$ in Proposition \ref{prop:N1q11}.
Specifically for each $( a_1, a_4, a_6 ) \in \mathcal{A}_2$, enumerate $( a_2, a_3, a_5, a_7, a_8, a_9 )$ such that $C=V(P,Q)$ is superspecial.
\end{description}
Let $\mathcal{P}$ be the list of cubics $P$ such that $V(P,Q)$ was determined to be superspecial in the above procedures.
For the inputs $\mathcal{P}$ and $q=11$, we execute a variant of Collecting Isomorphism Classes Algorithm given in Section \ref{subsec:isom} (for constructing the variant, see Remark \ref{rem:isom} (2)).
By the outputs of our computation, a cubic form $P$ of the form \eqref{eq:Degeq11} such that $V(P,Q)$ is superspecial is one of $P_i^{({\rm Dege})}$ for $1 \leq i \leq 17$, up to isomorphism over $\mathbb{F}_{11}$.
\end{proof}

% The number of possible $(b_1, b_2, a_0, a_1, a_6)$ is $2 \cdot 2 \cdot 24 \cdot 25 \cdot 24 = 57600$.

%===================================================
\subsubsection{Computational parts for our proof of Corollary \ref{MainCorollary}}
%===================================================

\begin{prop}\label{prop:for_cor}
Consider the quadratic forms $Q^{(\mathrm{N1})} = 2 x w + 2 y z$, $Q^{(\mathrm{N2})} = 2 x w + y^2 - \epsilon z^2$ with $\mathbb{F}_{11}^{\times} \smallsetminus ( \mathbb{F}_{11}^{\times} )^2$, $Q^{(\mathrm{Dege})} = 2 y w + z^2$ and the cubic forms
\begin{eqnarray}
P_1^{(\mathrm{alc})}&:=& x^2 y + x^2 z + 2 y^2 z + 5 y^2 w + 9 y z^2 + y z w + 4 z^3 + 3 z^2 w + 10 z w^2 + w^3, \nonumber \\
P_2^{(\mathrm{alc})} &:=& x^2 y + x^2 z + y^3 + y^2 z + 7 y z^2 + 4 y w^2 + 2 z^3 + 9 z w^2, \nonumber \\
P_3^{(\mathrm{alc})} &:=& x^2 y + x^2 z + y^3 + 8 y^2 z + 3 y z^2 + 10 y w^2 + 10 z^3 + 10 z w^2, \nonumber \\
P_4^{(\mathrm{alc})} &:=& x^3 + y^3 + w^3, \nonumber \\
P_5^{(\mathrm{alc})} &:=& x^3 + y^3 + z^3 + 5 w^3, \nonumber \\
P_6^{(\mathrm{alc})} &:=& x^3 + x w^2 + y^3, \nonumber \\
P_7^{(\mathrm{alc})} &:=& x^3 + x z w + y^3 + 7 z^3 + w^3, \nonumber \\
P_8^{(\mathrm{alc})} &:=& x^3 + x y z + x w^2 + y^3 + 5 z^3 + 4 w^3, \nonumber \\
P_9^{(\mathrm{alc})} &:=& x^3 + x y z + 6 x w^2 + y^3 + 8 z^3 + 8 w^3 \nonumber 
\end{eqnarray}
in $\mathbb{F}_{11}[x,y,z,w]$.
Let $P_i^{(\mathrm{N1})}$, $P_j^{(\mathrm{N2})}$ and $P_k^{(\mathrm{Dege})}$ be as in $\mathrm{Propositions}$ $\ref{prop:N1q11}$ -- $\ref{prop:Degenerate_q11}$.
\begin{enumerate}
\item[{\rm (1)}] Each of $V (P_i^{(\mathrm{N1})}, Q^{(\mathrm{N1})})$ and $V (P_j^{(\mathrm{N2})}, Q^{(\mathrm{N2})} )$ with $1 \leq i \leq 8$ and $1 \leq j \leq 5$ is isomorphic to $V ( P_k^{(\mathrm{alc})}, Q^{(\mathrm{N1})})$ over $\overline{\mathbb{F}_{11}}$ for some $1 \leq k \leq 3$, and vice versa.
Moreover, $V ( P_i^{(\mathrm{alc})}, Q^{(\mathrm{N1})})$ is not isomorphic to $V ( P_j^{(\mathrm{alc})}, Q^{(\mathrm{N1})})$ over $\overline{\mathbb{F}_{11}}$ for each $1 \leq i < j \leq 3$.
\item[{\rm (2)}] Each $V (P_i^{(\mathrm{Dege})}, Q^{(\mathrm{Dege})})$ with $1 \leq i \leq 17$ is isomorphic to $V ( P_j^{(\mathrm{alc})}, Q^{(\mathrm{Dege})})$ over $\overline{\mathbb{F}_{11}}$ for some $4 \leq j \leq 9$, and vice versa.
Moreover, $V ( P_i^{(\mathrm{alc})}, Q^{(\mathrm{Dege})})$ is not isomorphic to $V ( P_j^{(\mathrm{alc})}, Q^{(\mathrm{Dege})})$ over $\overline{\mathbb{F}_{11}}$ for each $4 \leq i < j \leq 9$.
\end{enumerate}
\end{prop}
\begin{proof}
We prove (1).
Take $\epsilon = 2 \in \mathbb{F}_{11}$.
We first transform $V ( P_i^{(\mathrm{N2})}, Q^{(\mathrm{N2})})$ into $V ( P, Q^{(\mathrm{N1})})$ for some cubic form $P$ by the actions of elements in $\mathrm{GL}_4 ( \overline{\mathbb{F}_{11}})$.
Put
\[
M_Q := 
\begin{pmatrix}
1 & 0 & 0 & 0\\
0 & 1/2 & 1 & 0\\
0 & 1/2 \sqrt{\epsilon} & -1/\sqrt{\epsilon} & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
\]
and $P_{8+i}^{(\mathrm{N1})}:=M_Q \cdot P_i^{(\mathrm{N2})} \ (\mbox{mod } Q^{({\rm N1})})$, where ``$(\mbox{mod } Q^{({\rm N1})})$'' means here replacing $x w$ in $M_Q \cdot P_i^{(\mathrm{N2})}$ by $- 2^{-1} (Q^{({\rm N1})} - 2 x w)$ via $x w \equiv - 2^{-1} (Q^{({\rm N1})} - 2 x w) \mbox{ mod }Q^{({\rm N1})}$.
Note that each $V ( P_i^{(\mathrm{N2})}, Q^{(\mathrm{N2})} )$ is isomorphic to $V ( P_{8+i}^{(\mathrm{N1})}, Q^{(\mathrm{N1})})$ over $\overline{\mathbb{F}_{11}}$.

For $\mathcal{P}:= ( P_1^{(\mathrm{N1})}, \ldots , P_8^{(\mathrm{N1})}, P_{9}^{(\mathrm{N1})}, \ldots , P_{13}^{(\mathrm{N1})} )$, we conduct a variant of Collecting Isomorphism Classes Algorithm given in the third paragraph of Section \ref{subsec:algorithm}.
By the outputs of our computations, we have that each $V (P_i^{(\mathrm{N1})}, Q^{(\mathrm{N1})})$ is isomorphic to $V ( P_j^{(\mathrm{alc})}, Q^{(\mathrm{N1})})$ over $\overline{\mathbb{F}_{11}}$ for some $1 \leq j \leq 3$, and vice versa.
The outputs also show that $V ( P_i^{(\mathrm{alc})}, Q^{(\mathrm{N1})})$ is not isomorphic to $V ( P_j^{(\mathrm{alc})}, Q^{(\mathrm{N1})})$ over $\overline{\mathbb{F}_{11}}$ for each $1 \leq i < j \leq 3$.

(2) is proved by a computation similar to (1).
\end{proof}

%===================================================
\subsection{Our implementation to prove the main theorems}\label{subsec:imple}
%===================================================
% We implemented computations in the proofs of Propositions \ref{prop:Degenerate_q5} -- \ref{prop:Degenerate_q11}, including the algorithms given in Sections \ref{subsec:algorithm} and \ref{subsec:isom}, in Magma V2.22-2 \cite{Magma}, \cite{MagmaHP}.
The algorithms given in Sections \ref{subsec:algorithm} and \ref{subsec:isom} are
\begin{itemize}
\item Modified Version of Main Algorithm in \cite{KH16} (pseudocode: Algorithm \ref{alg:enume}),
\item Isomorphism Testing Algorithm (pseudocode: Algorithm \ref{alg:isomorphic_tilde}), and
\item Collecting Isomorphism Classes Algorithm (pseudocode: Algorithm \ref{alg:isomorphic_family}).
\end{itemize}
Recall that Isomorphism Testing Algorithm is a sub-procedure in Collecting Isomorphism Classes Algorithm.
The source codes and the log files are available at the web page of the first author \cite{HPkudo}.
In this subsection, we show timing and sample codes for the case of $q =11$.

%===============================
\subsubsection{Timing}\label{subsubsec:timing}
%===============================

We measured time used in both of Modified Version of Main Algorithm in \cite{KH16} and Collecting Isomorphism Classes Algorithm for each case.
We show the timing only for Modified Version of Main Algorithm in \cite{KH16} since most of time was used in this step.
Table \ref{timing} shows the timing of Modified Version of Main Algorithm in \cite{KH16} in our computation to show Propositions \ref{prop:N1q11} -- \ref{prop:Degenerate_q11}.
% \begin{table}[h]
%   \begin{center}
%     \caption{Timing data of Modified Version of Main Algorithm in \cite{KH16} (pseudocode: Algorithm \ref{alg:enume}) in our computation to prove Propositions \ref{prop:N1q11} -- \ref{prop:Degenerate_q11}}\label{timing}
% \vspace{0.2cm}
%     \scalebox{0.8}{
%     \begin{tabular}{c|l|c|c|l|c|l|l|r|r} \hline
%     $q$ & Case & $s_1$ & Iterations 1 & ~~~~~$t_{mlt}$ & $s_2$ & ~~~~~$t_{GBslv}$ & ~~~~~$t_{total}$ & Iterations 2 & Total time~~~ \\ \hline
% $11$ & {\bf N1} (i) & $8$ & 484 & 0.57188s & $6$ & 1.0036s & 1.0043s & 58564 & 59127.514s \\
%  & & & & & & & & & (about 16.4 hours) \\
%  & {\bf N1} (ii) & $9$ & 22 & 0.40118s & $5$ & 0.0072295s  & 0.010360s & 292820 & 3425.283s\\ 
%  & {\bf N1} (iii) & $8$ & 3456  & 0.19745s & $4$ & 0.0058428s & 0.0092311s & 322102& 3457.706s \\
%  & {\bf N2} & $9$ & 22 & 9.0721s & $5$ & 0.061044s & 0.067900s & 638880 & 45782.984s  \\
%  & & & & & & & & & (about 12.7 hours) \\
%  & {\bf Dege} & $9$ & 40 & 0.39785s & $6$ & 0.30259s & 0.30512s & 48400 & 14794.521s \\ \hline
% 	 \end{tabular}}
%  \end{center}
% \end{table}
\begin{table}[h]
  \begin{center}
    \caption{Timing data of Modified Version of Main Algorithm in \cite{KH16} (pseudocode: Algorithm \ref{alg:enume}) in our computation to prove Propositions \ref{prop:N1q11} -- \ref{prop:Degenerate_q11}}\label{timing}
\vspace{0.2cm}
    \scalebox{0.8}{
    \begin{tabular}{c|l|c|c|l|c|l|l|r|r} \hline
    $q$ & Case & $s_1$ & Iterations 1 & ~~~~~$t_{mlt}$ & $s_2$ & ~~~~~$t_{GBslv}$ & ~~~~~$t_{total}$ & Iterations 2 & Total time~~~ \\ \hline
$11$ & {\bf N1} (i) & $8$ & 484 & 0.59267s & $6$ & 0.88283s & 0.88361s & 58564 & 52067.856s \\
 & & & & & & & & & (about 14.5 hours) \\
 & {\bf N1} (ii) & $9$ & 22 & 0.39381s & $5$ & 0.036043s  & 0.039275s & 292820 & 11901.708s\\ 
 & {\bf N1} (iii) & $8$ & 3456  & 0.19923s & $4$ & 0.011823s & 0.014758s & 322102& 5130.876s \\
 & {\bf N2} & $9$ & 22 & 9.1519s & $5$ & 0.16173s & 0.17191s & 638880 & 113056.172s  \\
 & & & & & & & & & (about 31.4 hours) \\
 & {\bf Dege} & $9$ & 40 & 0.39938s & $6$ & 0.13430s & 0.13676s & 48400 & 6645.091s \\ \hline
	 \end{tabular}}
 \end{center}
\end{table}

%=================
\paragraph{Table Notation}
%=================
Let $q$ denote the cardinality of $K$.
``Iterations 1'' denotes the number of iterations on $b_i$ and $a_j$ which are not regarded as indeterminates at Step (1) of Modified Version of Main Algorithm in \cite{KH16}.
Let ``$s_1$'' denote the number of indeterminates in the multiplication $(PQ)^{p-1}$ in Step (1) for each case.
We denote by ``$t_{mlt}$'' the time used in Step (1) for computing $(P Q)^{p-1}$.
Note that we regard $s_1$ coefficients in $P$ as indeterminates and thus this computation is done over a multivariate polynomial ring with the indeterminates $x$, $y$, $z$, $w$ whose ground ring is a polynomial ring of $s_1$ indeterminates.
Let ``$s_2$'' denote the number of indeterminates in the computation to solve a multivariate system in Step (3b) for each case.
The notation``$t_{GBslv}$'' is the time used in Step (3b) for solving a multivariate system over $K$.
``Iterations 2'' denotes the number of iterations on $b_i$ and $a_j$ which are not regarded as indeterminates at Step (3b).
Let ``$t_{total}$'' denote the time used in Steps (3a)-(3c) for each iteration, whereas ``Total time'' denotes the total time used in Steps (1)-(3), namely the total time taken for each case.

%================
\paragraph{Workstation.}
%================
We conducted the computation to prove Propositions \ref{prop:Degenerate_q5} -- \ref{prop:Degenerate_q11} by a Windows 10 home OS, 64 bit computer with 3.40 GHz CPU (Intel Core i7) and 20 GB memory.
In our implementation, the following built-in functions in Magma are called:
\begin{enumerate}
	\item \texttt{GroebnerBasis}:
%Fix a decidable term ordering $\succ$.
Let $K$ be a computable field.
For given polynomials $f_1, \ldots , f_s$ in $R:=K [ X_1, \ldots , X_n]$, this function outputs the (reduced) Gr\"{o}bner basis of the ideal $\langle f_1, \ldots , f_s \rangle_R$ with respect to a decidable term order $\succ$. %by the $F_4$ algorithm \cite{F4}.
	\item \texttt{Variety}: Let $K$ be a computable field and $R:=K [ X_1, \ldots , X_n]$ the polynomial ring in $n$ indeterminates over $K$.
For given polynomials $f_1, \ldots , f_s \in R$ such that $V_{\overline{K}}(f_1, \ldots , f_s) = \{ (a_1, \ldots , a_n) \in \overline{K}^n : f_i (a_1, \ldots , a_n) = 0 \mbox{ for all } 1 \leq i \leq s \}$ is finite, this function outputs $V_{K}(f_1, \ldots , f_s) = \{ (a_1, \ldots , a_n) \in K^n : f_i (a_1, \ldots , a_n) = 0 \mbox{ for all } 1 \leq i \leq s \}$.
Note that this function also works for higher-dimensional ideals if $K$ is finite.
\end{enumerate}
As we will show in a piece of our codes in the next subsection, we implemented the following function as a sub-routine.
\begin{enumerate}
\item[(3)] \texttt{RestrictedVariety}: Let $K$ be a computable field and $R=K[ X_1, \ldots, X_n ]$ the polynomial ring in $n$ indeterminates over $K$.
Let $f_1, \ldots , f_s \in R$ be polynomials such that $V_{\overline{K}}(f_1, \ldots , f_s) = \{ (a_1, \ldots , a_n) \in \overline{K}^n : f_j (a_1, \ldots , a_n) = 0 \mbox{ for all } 1 \leq j \leq s \}$ is finite.
Let $\underline{i} = ( i_1, \ldots , i_n )$ be a sequence with $0$ or $1$ entries, and $k_1 < \cdots < k_{n-h(\underline{i})}$ indexes on the $0$ entries $i_k = 0$ of $\underline{i}$, where $h(\underline{i})$ denotes the Hamming weight of $\underline{i}$.
Let $c = (c_1, \ldots , c_{n-h(\underline{i})}) \in K^{n-h(\underline{i})}$ be a tuple.
Given $f_1, \ldots , f_s$, $\underline{i}$ and $c$, this function computes
\[
\{ (a_1, \ldots , a_n) \in K^n : f_j (a_1, \ldots , a_n) = 0 \mbox{ for all } 1 \leq j \leq s, \mbox{ and } a_{k_{\ell}} = c_{\ell} \mbox{ for all } 1 \leq \ell \leq n - h (\underline{i}) \}
\]
by substituting $c_{\ell}$ into $X_{k_{\ell}}$ together with the built-in function $\texttt{Variety}$.
\end{enumerate}



% \begin{ex}
% We reconsider Example \ref{ex:N2}.
% The notation is same as in Example \ref{ex:N2}.
% The number of possible $(b_1, b_2, a_1, a_2, a_3 )$, the coefficients which we run, is $2 \cdot 2 \cdot ( 49^2 - 1 ) \times 49 = 470400$.
% In our computation over Magma, the average of the time for Step (2b) was $0.067364$ seconds.
% The average of the number of the solutions in Step (2b) was $0.091792$, which implies that each system in Step (2b) has no solution or has only the trivial solution $( a_4, a_5, a_6, a_7, a_8, a_9, a_{10} ) = ( 0, \ldots , 0)$ in most cases; in such a case, as this result shows, solving a system of algebraic equations over a finite field with the Gr\"{o}bner basis computation (with respect to a grevlex order) can be much efficient.
% Moreover, if the system has no solution, we skip Step (2c).
% The average of the time for Step (2c) was $0.00016677$ seconds.
% As a result, all the computations for the case of (N2) with $q = 49$ was done in $309667.773$ seconds, which is extremely practical time.
% \end{ex}

%==================================================
\subsubsection{Codes for our computation}\label{subsubsec:implementation}
%==================================================

\paragraph{Loading our implementation program.}
% One can execute our implementation programs on Magma as follows.
% Assume that the file \texttt{ssp\_code\_q11N1\_b1nonzero\_v2.txt}, which is one of our programs, is in the directory \texttt{C:/Users}. 

Our codes are executed on Magma as follows.
Assume that the code file \texttt{ssp\_code\_q11N1\_b1nonzero\_v2.txt} is in the directory \texttt{C:/Users}. 

\begin{framed}
\vspace{-0.5cm}
\begin{small}
\begin{verbatim}
Magma V2.22-2     Wed Jan 25 2017 12:53:45 on DESKTOP-GN95KFP [Seed = 670522909]
Type ? for help.  Type <Ctrl>-D to quit.
> load"C:/Users/ssp_code_q11N1_b1nonzero_v2.txt";
\end{verbatim}
\end{small}
\vspace{-0.5cm}
\end{framed}

\paragraph{Sample code.}

In the following, a piece of our implementation codes is given.

% \begin{framed}
% \vspace{-0.5cm}
% \begin{small}
% \begin{verbatim}
% Magma V2.22-2     Wed Jan 25 2017 12:53:45 on DESKTOP-GN95KFP [Seed = 670522909]
% Type ? for help.  Type <Ctrl>-D to quit.
% > p:=11;
% > q:=p;
% > K:=GF(q);
% > count_HW0:=0;
% > b1:=K!1;
% > b2:=K!0;
% > a1:=K!1;
% > a2:=K!0;
% > s1:=8;
% > s2:=6;
% > R<[t]>:=PolynomialRing(K,s1,"grevlex");
% > S<x,y,z,w>:=PolynomialRing(R,4,"grevlex");
% > exponents_set:=[
% > [ 2*p-2, p-1, p-1, p-1],
% > [ 2*p-1, p-2, p-1, p-1],
% > [ 2*p-1, p-1, p-2, p-1],
% > [ 2*p-1, p-1, p-1, p-2],
% > [ p-1, 2*p-2, p-1, p-1],
% > [ p-2, 2*p-1, p-1, p-1],
% > [ p-1, 2*p-1, p-2, p-1],
% > [ p-1, 2*p-1, p-1, p-2],
% > [ p-1, p-1, 2*p-2, p-1],
% > [ p-2, p-1, 2*p-1, p-1],
% > [ p-1, p-2, 2*p-1, p-1],
% > [ p-1, p-1, 2*p-1, p-2],
% > [ p-1, p-1, p-1, 2*p-2],
% > [ p-2, p-1, p-1, 2*p-1],
% > [ p-1, p-2, p-1, 2*p-1],
% > [ p-1, p-1, p-2, 2*p-1]];
% > not_vanished_monomials:=
% > {@ x^(E[1])*y^(E[2])*z^(E[3])*w^(E[4]) : E in exponents_set @};
% > Coeff_set:=MonomialsOfDegree(R,1);
% > f:= x^2*y + b1*x^2*z + b2*x*z^2 + a1*y^3 + a2*y^2*z;
% > g:= 2*x*w + 2*y*z;
% > Mono_set_deg3_unknown:={@ y*z^2, y^2*w, y*z*w, z^2*w, y*w^2, z^3, z*w^2, w^3 @}; // 8
% > // a3, a5, a6, a7, a8, a4, a9, a10
% > for i in [1..#Mono_set_deg3_unknown] do
% for> f:= f + S!(Coeff_set[i])*(Mono_set_deg3_unknown[i]);
% for> end for;
% > f1:=f^(p-1);
% > g1:=g^(p-1);
% > h:=f1*g1;
% > for a3 in K do
% for> for a7 in K do
% for|for> F:=[];
% for|for> for i in [1..#(not_vanished_monomials)] do
% for|for|for>     F[i]:=MonomialCoefficient(h,not_vanished_monomials[i]);
% for|for|for> end for;
% for|for> /***********************/
% for|for> F:=F cat [t[1] - a3, t[4] - a7];
% for|for> /***********************/
% for|for> G:=F;
% for|for> I:=ideal<R|G>;
% for|for> V:=Variety(I);
% for|for> count_HW0:=count_HW0 + #V;
% for|for> end for; // a7
% for> end for; // a3
% > count_HW0;
% 8
% \end{verbatim}
% \end{small}
% \vspace{-0.5cm}
% \end{framed}

\begin{framed}
\vspace{-0.5cm}
\begin{small}
\begin{verbatim}
Magma V2.22-2     Wed Jan 25 2017 12:53:45 on DESKTOP-GN95KFP [Seed = 670522909]
Type ? for help.  Type <Ctrl>-D to quit.
> /*******************************************/
> RestrictedVariety:= function(P,B,ind,tup);
function>       rank_PP:=Rank(P)-#tup;
function>       PP<[s]>:=PolynomialRing(CoefficientRing(P),rank_PP,"grevlex");
function>       P_new:=ChangeRing(P,PP);
function>       B0:=[P_new!(B[i]) : i in [1..#B]];
function>       B1:=[];
function>       v:=[];
function>       ii:=0;
function>       for i in [1..#ind] do
function|for>           if ind[i] eq 1 then
function|for|if>                        v[i]:=s[i-ii];
function|for|if>                else
function|for|if>                        ii:=ii+1;
function|for|if>                        v[i]:=PP!tup[ii];
function|for|if>                end if;
function|for>   end for;
function>       for i in [1..#B0] do
function|for>           B1[i]:=Evaluate(B0[i],v);
function|for>   end for;
function>       B_new:=B1;
function>       II:=ideal<PP|B_new>;
function>       VV:=Variety(II);
function>       V_out:=[];
function>       for i in [1..#VV] do
function|for>           vi:=<>;
function|for>           k:=0;
function|for>           for j in [1..#ind] do
function|for|for>                       if ind[j] eq 1 then
function|for|for|if>                            k:=k+1;
function|for|for|if>                            vi:=Append(vi,VV[i][k]);
function|for|for|if>                    else
function|for|for|if>                            vi:=Append(vi,tup[j-k]);
function|for|for|if>                    end if;
function|for|for>               end for;
function|for>           V_out[i]:=vi;
function|for>   end for;
function>       return V_out;
function> end function;
> //-------------------------------------------
> p:=11;
> q:=p;
> K:=GF(q);
> count_HW0:=0;
> b1:=K!1; b2:=K!0;
> a1:=K!1; a2:=K!0;
> s1:=8;
> s2:=6;
> R<[t]>:=PolynomialRing(K,s1,"grevlex");
> S<x,y,z,w>:=PolynomialRing(R,4,"grevlex");
> exponents_set:=[
> [ 2*p-2, p-1, p-1, p-1],
> [ 2*p-1, p-2, p-1, p-1],
> [ 2*p-1, p-1, p-2, p-1],
> [ 2*p-1, p-1, p-1, p-2],
> [ p-1, 2*p-2, p-1, p-1],
> [ p-2, 2*p-1, p-1, p-1],
> [ p-1, 2*p-1, p-2, p-1],
> [ p-1, 2*p-1, p-1, p-2],
> [ p-1, p-1, 2*p-2, p-1],
> [ p-2, p-1, 2*p-1, p-1],
> [ p-1, p-2, 2*p-1, p-1],
> [ p-1, p-1, 2*p-1, p-2],
> [ p-1, p-1, p-1, 2*p-2],
> [ p-2, p-1, p-1, 2*p-1],
> [ p-1, p-2, p-1, 2*p-1],
> [ p-1, p-1, p-2, 2*p-1]];
> not_vanished_monomials:=
> {@ x^(E[1])*y^(E[2])*z^(E[3])*w^(E[4]) : E in exponents_set @};
> Coeff_set:=MonomialsOfDegree(R,1);
> f:= x^2*y + b1*x^2*z + b2*x*z^2 + a1*y^3 + a2*y^2*z;
> g:= 2*x*w + 2*y*z;
> Mono_set_deg3_unknown:={@ y*z^2, y^2*w, y*z*w, z^2*w, y*w^2, z^3, z*w^2, w^3 @}; // 8
> // 8 = s1 - s2
> // a3, a5, a6, a7, a8, a4, a9, a10
> for i in [1..#Mono_set_deg3_unknown] do
for> f:= f + S!(Coeff_set[i])*(Mono_set_deg3_unknown[i]);
for> end for;
> f1:=f^(p-1);
> g1:=g^(p-1);
> h:=f1*g1;
> for a3 in K do
for> for a7 in K do
for|for> F:=[];
for|for> for i in [1..#(not_vanished_monomials)] do
for|for|for>     F[i]:=MonomialCoefficient(h,not_vanished_monomials[i]);
for|for|for> end for;
for|for> ind:=[0,1,1,0,1,1,1,1]; // a3, a5, a6, a7, a8, a4, a9, a10
for|for> tup:=[a3,a7];
for|for> V:=RestrictedVariety(R,F,ind,tup);
for|for> count_HW0:=count_HW0 + #V;
for|for> end for; // a7
for> end for; // a3
> count_HW0;
8
\end{verbatim}
\end{small}
\vspace{-0.5cm}
\end{framed}

In the above piece of codes, we compute roots of a multivariate system constructed from our criterion for superspecialty  for Case {\bf (N1)} (i) for $q=11$ and certain fixed coefficients.
Here the notation are the same as in Proposition \ref{prop:N1q11}.
For $( b_1, b_2) = (1, 0)$ and $(a_1, a_2) = ( 1, 0)$, we seek all the tuples $( a_3, a_4, a_5, a_6, a_7, a_8, a_9, a_{10}) \in (\mathbb{F}_{11})^{\oplus 8}$ of coefficients in $P$ such that the Hasse-Witt matrix of $C = V ( P, Q)$ is zero.
From the final output, one has that the number of roots $( a_3, \ldots , a_{10})$ is $8$.

SSP_genus4_PF.tex
%\documentclass[manuscript]{aomart}
\documentclass[11pt]{article}

\usepackage{ulem}
\usepackage{framed}
%\documentclass[reqno]{amsart}

\input{preamble.tex}
\newcommand{\cFT}{\operatorname{\mathcal{FT}}}

\makeatletter
\def\@seccntformat#1{\csname the#1\endcsname. }
\makeatother
\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
 {-3.5ex \@plus -1ex \@minus -.2ex}%
 {2.3ex \@plus.2ex}%
 {\normalfont\large\bfseries}}
% {\normalfonft\centering\large\bfseries}}
\makeatother

\newcommand{\keywords}[1]{\textbf{{Keywords: }} #1}
\newcommand{\MSC}[1]{\textbf{{2010 Mathematical Subject Classification: }} #1}
\begin{document}

\title%[]
{\bf Enumerating superspecial curves of genus $4$\\ over prime fields}
\author%[S. Harashita]
{Momonari Kudo\thanks{Graduate School of Mathematics, Kyushu University.
E-mail: \texttt{m-kudo@math.kyushu-u.ac.jp}}
\ and Shushi Harashita\thanks{Graduate School of Environment and Information Sciences, Yokohama National University.
E-mail: \texttt{harasita@ynu.ac.jp}}}
%{Momonari Kudo and Shushi Harashita
%\thanks{
%Graduate School of Environment and Information Sciences,
%M. Kudo
%\protect \\
%\hspace{6mm} Kyushu University,
%\protect \\
%\hspace{6mm} E-mail address: {\texttt{m-kudo@math.kyushu-u.ac.jp}}
%\protect \\
%\hspace{5mm} S. Harashita
%\protect \\
%\hspace{6mm} Yokohama National University,
%79-7 Tokiwadai Hodogaya-ku Yokohama 240-8501 Japan.
%\protect \\
%\hspace{6mm} E-mail address: {\texttt{harasita@ynu.ac.jp}}
%\protect \\
%{\bf Keywords: }$p$-divisible groups, Newton polygons, Oort's conjecture
%\protect \\
%{\bf 2010 Mathematical Subject Classification: }14L05, 14L15, 14D15
%}
%\date{}
\maketitle
%\begin{flushright}
%{\it Informal, confidential notes}\\
%Not for distribution.\\
%May only be read by Professor Frans Oort
%\end{flushright}
\begin{abstract}
In this paper we enumerate nonhyperelliptic
superspecial curves of genus $4$ over prime fields of characteristic $p\le 11$.
Our algorithm works for nonhyperelliptic curves
over an arbitrary finite field in characteristic $p \ge 5$.
We execute the algorithm for prime fields of $p\le 11$ with our implementation on a computer algebra system Magma.
Thanks to the fact that
the cardinality of $\F_{p^a}$-isomorphism classes of
superspecial curves over $\F_{p^a}$ of a fixed genus 
depends only on the parity of $a$, this paper contributes
to the odd-degree case for genus $4$, whereas
\cite{KH16} contributes to the even-degree case.
\end{abstract}
%\tableofcontents

\input{section1_PF.tex}
\input{section2_PF.tex}
\input{section3_PF.tex}
\input{section4_new_PF.tex}
%\input{section5_new_PF.tex}
% \input{appendix_PF.tex}
% \input{section6_new.tex}
% \input{section7_new.tex}


\begin{thebibliography}{99}

% \bibitem{Ayad}
% Ayad, A.: \textit{A Survey on the Complexity of Solving Algebraic Systems}, International Mathematical Forum {\bf 5}, 333--353 (2010)

\bibitem{Berthelot}
Berthelot, P.:
{\it Cohomologie cristalline des sch\'emas de caract\'eristique $p>0$.}
Lecture Notes in Mathematics, Vol. {\bf 407}. Springer-Verlag, Berlin-New York, 1974.

\bibitem{BFP}
Bettale, L., Faug\`ere, J.-C.\ and Perret, L.: {\it Hybrid approach for solving multivariate systems over finite fields}, J. Math. Crypt. {\bf 3} (2009), 177--197. 

\bibitem{Magma}
Bosma, W., Cannon, J.\ and Playoust, C.: \textit{The Magma algebra system. I. The user language}, Journal of Symbolic Computation {\bf 24}, 235--265 (1997)


\bibitem{MagmaHP}
Cannon, J., et al.: \textit{Magma A Computer Algebra System},
School of Mathematics and Statistics, University of Sydney, 2016.\ \texttt{http://magma.maths.usyd.edu.au/magma/}


% \bibitem{Carter}
% Carter, R. W.: {\it Finite groups of Lie type. Conjugacy classes and complex characters.}
% Pure and Applied Mathematics (New York). A Wiley-Interscience Publication. John Wiley \& Sons, Inc., New York, 1985. xii+544 pp.

% \bibitem{CLO1}
% Cox, D., Little, J.\ and O'shea, D.: {\it Ideals, Varieties, and Algorithms}, Springer-Verlag, New York (1992)


% \bibitem{DL}
% Decker, W.\ and Lossen, C.: {\it Computing in Algebraic Geometry, A Quick Start using SINGULAR}, ACM {\bf 16}, Springer (2000)

\bibitem{Deuring}
Deuring, M.:
Die Typen der Multiplikatorenringe elliptischer Funktionenk\"orper.
Abh. Math. Sem. Univ. Hamburg {\bf 14} (1941), no. 1, 197--272. 


% \bibitem{Eisenbud_c}
% Eisenbud, D.: {\it Commutative Algebra with a View Toward Algebraic Geometry}, GTM {\bf 150}, Springer (1995)


% \bibitem{Eisenbud}
% Eisenbud, D.: {\it The Geometry of Syzygies - A Second Course in Algebraic Geometry and Commutative Algebra -}, GTM {\bf 229}, Springer (2005)

\bibitem{Ekedahl}
Ekedahl, T.: {\it On supersingular curves and abelian varieties},
Math. Scand. {\bf 60} (1987), 151--178.


\bibitem{F4}
Faug\`ere,\ J.-C.: \textit{A new efficient algorithm for computing Gr\"{o}bner bases (F4)}, Journal of Pure and Applied Algebra {\bf 139}, 61--88 (1999)

\bibitem{FGT} Fuhrmann R., Garcia, A., Torres, F.:
{\it On maximal curves},
Journal of number theory {\bf 67}, 29--51 (1997)

\bibitem{ManyPoints}
van der Geer, et al.:
{\it Tables of Curves with Many Points},
2009,
\texttt{http://www.manypoints.org},
Retrieved at 5th April, 2017.

\bibitem{GV}
van der Geer, G. and van der Vlugt, M.:
{\it Tables of curves with many points},
Math. Comp. {\bf 69} (2000), no. 230, 797--810.

% \bibitem{Goppa}
% Goppa, V.\ D.:
% {\it A New Class of Linear Correcting Codes},
% Probl. Peredachi Inf., 6:3 (1970), 24--30;
% Problems Inform. Transmission, 6:3 (1970), 207--212.


\bibitem{Har}
Hartshorne, R.: {\it Algebraic Geometry}, GTM {\bf 52}, Springer-Verlag (1977)

\bibitem{Hashimoto}
Hashimoto K.:
{\it Class numbers of positive definite ternary quaternion Hermitian forms.}
Proc. Japan Acad. Ser. A Math. Sci. {\bf 59} (1983), no. 10, 490--493.

\bibitem{HI}
Hashimoto, K. and Ibukiyama, T.:
{\it On class numbers of positive definite binary quaternion Hermitian forms. II}, J. Fac. Sci. Univ. Tokyo Sect. IA Math. {\bf 28} (1981), no. 3, 695--699 (1982).


\bibitem{Howe}
Howe, E. W.:
{\it New bounds on the maximum number of points on genus-4 curves over small finite fields}, 
pp. 69--86 in: 
Arithmetic, Geometry, Cryptography and Coding Theory (Y. Aubry, C. Ritzenthaler, and A. Zykin, eds.), 
Contemporary Mathematics 574, American Mathematical Society, Providence, RI, 2012.

\bibitem{Howe-Lauter}
Howe, E. W. and Lauter, K. E.:
{\it New methods for bounding the number of points on curves over finite fields}, pp. 173--212 in:  Geometry and Arithmetic (C. Faber, G. Farkas, and R. de Jong, eds.), European Mathematical Society, 2012.

\bibitem{Ibukiyama}
Ibukiyama, T.:
{\it On rational points of curves of genus $3$ over finite fields},
Tohoku Math. J. {\bf 45} (1993), 311-329.

\bibitem{IK}
Ibukiyama, T. and Katsura, T.:
{\it On the field of definition of superspecial polarized abelian varieties and type numbers}, Compositio Math. {\bf 91} (1994), no. 1, 37--46.

\bibitem{IKO}
Ibukiyama, T., Katsura, T. and Oort, F.:
{\it Supersingular curves of genus two and class numbers}, 
Compositio Math. {\bf 57} (1986), no. 2, 127--152. 

\bibitem{Kudo}
Kudo, M.: {\it Analysis of an algorithm to compute the cohomology groups of coherent sheaves and its applications},
Japan Journal of Industrial and Applied Mathematics, to appear
(preprint version: MI preprints 2016-1, 2016, available at\\
\texttt{http://www.imi.kyushu-u.ac.jp/eng/publishes/pub\_inner/id:3})


\bibitem{KH16}
Kudo, M.\ and Harashita, S.: \textit{Superspecial curves of genus $4$ in small characteristic}, Finite Fields and Their Applications {\bf 45}, 131--169 (2017)
%arXiv, math. AG: 1607.\ 01114 (2016)

\bibitem{KHS}
Kudo, M.,\ Harashita, S. and\ Senda, H.:
{\it Automorphism groups of superspecial curves of genus 4 over prime field},
in preparation.

\bibitem{OU}
Oort, F. and Ueno, K.:
{\it Principally polarized abelian varieties of dimension two or three are Jacobian varieties},
J. Fac. Sci. Univ. Tokyo Sect. IA Math. {\bf 20} (1973), 377--381. 


% \bibitem{KW}
% Kredel,\ H.\ and Weispfenning,\ V.: \textit{Computing dimension and independent sets for polynomial ideals}.\ Journal of Symbolic Computation {\bf 12}, 231--247 (1988)

% \bibitem{Noro_Yokoyama}
% Noro,\ M.\ and Yokoyama,\ K.: \textit{Computation of Gr\" {o}bner bases} (Japanese).\ Tokyo University Publisher (2003)

%\bibitem{Lauter}
%Lauter, K. E.:
%{\it Geometric methods for improving the upper bounds on the number of rational% points on algebraic curves over finite fields},
%Journal of Algebraic Geometry {\bf 10} (2001), no.~1, 19--36.


% \bibitem{WCC2015}
% \"{O}zbudak, F.\ and Sayg\i, Z.:
% {\it Explicit Maximal and Minimal Curves over Finite Fields of Odd Characteristics},
% In: Proceedings of the $9$th International Workshop on Coding and Cryptography 2015 (WCC2015),
% Apr 2015, Paris, France, 2016.

\bibitem{Serre1983}
Serre, J.-P.:
{\it Nombre des points des courbes algebrique sur $\F_q$},
S\'em. Th\'eor. Nombres Bordeaux (2)
1982/83, 22 (1983).

\bibitem{Serre}
Serre, J.-P.: {\it Rational points on curves over finite fields},
Lectures given at Harvard University 1985.
Notes by Fernando Q. Gouv\'ea.
% of lectures at Harvard University 1985.5
%Unpublished notes by Fernando Q. Gouv\'ea
%of lectures at Harvard University 1985.

\bibitem{XYY16}
Xue, J., Yang, T.-C. and Yu, C.-F.:
{\it On superspecial abelian surfaces over finite fields},
Doc. Math. {\bf 21} (2016) 1607--1643.

%\bibitem{Yui} Yui, N.: {\it On the Jacobian varieties of
%hyperelliptic curves over fields of characterisctic $p>2$},
%Journal of algebra {\bf 52}, 378--410 (1978)

% \bibitem{MapleHP} Maple User Manual: Toronto: Maplesoft, a division of Waterloo Maple Inc., 2016., available on the web page\\
% \texttt{http://www.maplesoft.com/products/maple/}

\bibitem{HPkudo} Computation programs and log files for the paper ``Enumerating superspecial curves of genus 4 in small characteristic'', available on the web page\\
\texttt{http://www2.math.kyushu-u.ac.jp/\~{}m-kudo/kudo-harashita-comp-PF.html}
\end{thebibliography} 

\input{appendix_PF.tex}

\end{document}

1702.05313.extracted_bib
{Ayad % Ayad, A.: A Survey on the Complexity of Solving Algebraic Systems, International Mathematical Forum {5, 333--353 (2010)
1702.05313.extracted_bib
{Berthelot Berthelot, P.: {Cohomologie cristalline des sch\'emas de caract\'eristique $p>0$. Lecture Notes in Mathematics, Vol. {407. Springer-Verlag, Berlin-New York, 1974.
1702.05313.extracted_bib
{BFP Bettale, L., Faug\`ere, J.-C.\ and Perret, L.: {Hybrid approach for solving multivariate systems over finite fields, J. Math. Crypt. {3 (2009), 177--197.
1702.05313.extracted_bib
{Magma Bosma, W., Cannon, J.\ and Playoust, C.: The Magma algebra system. I. The user language, Journal of Symbolic Computation {24, 235--265 (1997)
1702.05313.extracted_bib
{MagmaHP Cannon, J., et al.: Magma A Computer Algebra System, School of Mathematics and Statistics, University of Sydney, 2016.\ http://magma.maths.usyd.edu.au/magma/ %
1702.05313.extracted_bib
{Carter % Carter, R. W.: {Finite groups of Lie type. Conjugacy classes and complex characters. % Pure and Applied Mathematics (New York). A Wiley-Interscience Publication. John Wiley \& Sons, Inc., New York, 1985. xii+544 pp. %
1702.05313.extracted_bib
{CLO1 % Cox, D., Little, J.\ and O'shea, D.: {Ideals, Varieties, and Algorithms, Springer-Verlag, New York (1992) %
1702.05313.extracted_bib
{DL % Decker, W.\ and Lossen, C.: {Computing in Algebraic Geometry, A Quick Start using SINGULAR, ACM {16, Springer (2000)
1702.05313.extracted_bib
{Deuring Deuring, M.: Die Typen der Multiplikatorenringe elliptischer Funktionenk\"orper. Abh. Math. Sem. Univ. Hamburg {14 (1941), no. 1, 197--272. %
1702.05313.extracted_bib
{Eisenbud_c % Eisenbud, D.: {Commutative Algebra with a View Toward Algebraic Geometry, GTM {150, Springer (1995) %
1702.05313.extracted_bib
{Eisenbud % Eisenbud, D.: {The Geometry of Syzygies - A Second Course in Algebraic Geometry and Commutative Algebra -, GTM {229, Springer (2005)
1702.05313.extracted_bib
{Ekedahl Ekedahl, T.: {On supersingular curves and abelian varieties, Math. Scand. {60 (1987), 151--178.
1702.05313.extracted_bib
{F4 Faug\`ere,\ J.-C.: A new efficient algorithm for computing Gr\"{obner bases (F4), Journal of Pure and Applied Algebra {139, 61--88 (1999)
1702.05313.extracted_bib
{FGT Fuhrmann R., Garcia, A., Torres, F.: {On maximal curves, Journal of number theory {67, 29--51 (1997)
1702.05313.extracted_bib
{ManyPoints van der Geer, et al.: {Tables of Curves with Many Points, 2009, http://www.manypoints.org, Retrieved at 5th April, 2017.
1702.05313.extracted_bib
{GV van der Geer, G. and van der Vlugt, M.: {Tables of curves with many points, Math. Comp. {69 (2000), no. 230, 797--810. %
1702.05313.extracted_bib
{Goppa % Goppa, V.\ D.: % {A New Class of Linear Correcting Codes, % Probl. Peredachi Inf., 6:3 (1970), 24--30; % Problems Inform. Transmission, 6:3 (1970), 207--212.
1702.05313.extracted_bib
{Har Hartshorne, R.: {Algebraic Geometry, GTM {52, Springer-Verlag (1977)
1702.05313.extracted_bib
{Hashimoto Hashimoto K.: {Class numbers of positive definite ternary quaternion Hermitian forms. Proc. Japan Acad. Ser. A Math. Sci. {59 (1983), no. 10, 490--493.
1702.05313.extracted_bib
{HI Hashimoto, K. and Ibukiyama, T.: {On class numbers of positive definite binary quaternion Hermitian forms. II, J. Fac. Sci. Univ. Tokyo Sect. IA Math. {28 (1981), no. 3, 695--699 (1982).
1702.05313.extracted_bib
{Howe Howe, E. W.: {New bounds on the maximum number of points on genus-4 curves over small finite fields, pp. 69--86 in: Arithmetic, Geometry, Cryptography and Coding Theory (Y. Aubry, C. Ritzenthaler, and A. Zykin, eds.), Contemporary Mathematics 574, American Mathematical Society, Providence, RI, 2012.
1702.05313.extracted_bib
{Howe-Lauter Howe, E. W. and Lauter, K. E.: {New methods for bounding the number of points on curves over finite fields, pp. 173--212 in: Geometry and Arithmetic (C. Faber, G. Farkas, and R. de Jong, eds.), European Mathematical Society, 2012.
1702.05313.extracted_bib
{Ibukiyama Ibukiyama, T.: {On rational points of curves of genus $3$ over finite fields, Tohoku Math. J. {45 (1993), 311-329.
1702.05313.extracted_bib
{IK Ibukiyama, T. and Katsura, T.: {On the field of definition of superspecial polarized abelian varieties and type numbers, Compositio Math. {91 (1994), no. 1, 37--46.
1702.05313.extracted_bib
{IKO Ibukiyama, T., Katsura, T. and Oort, F.: {Supersingular curves of genus two and class numbers, Compositio Math. {57 (1986), no. 2, 127--152.
1702.05313.extracted_bib
{Kudo Kudo, M.: {Analysis of an algorithm to compute the cohomology groups of coherent sheaves and its applications, Japan Journal of Industrial and Applied Mathematics, to appear (preprint version: MI preprints 2016-1, 2016, available at\\ http://www.imi.kyushu-u.ac.jp/eng/publishes/pub\_inner/id:3)
1702.05313.extracted_bib
{KH16 Kudo, M.\ and Harashita, S.: Superspecial curves of genus $4$ in small characteristic, Finite Fields and Their Applications {45, 131--169 (2017) %arXiv, math. AG: 1607.\ 01114 (2016)
1702.05313.extracted_bib
{KHS Kudo, M.,\ Harashita, S. and\ Senda, H.: {Automorphism groups of superspecial curves of genus 4 over prime field, in preparation.
1702.05313.extracted_bib
{OU Oort, F. and Ueno, K.: {Principally polarized abelian varieties of dimension two or three are Jacobian varieties, J. Fac. Sci. Univ. Tokyo Sect. IA Math. {20 (1973), 377--381. %
1702.05313.extracted_bib
{KW % Kredel,\ H.\ and Weispfenning,\ V.: Computing dimension and independent sets for polynomial ideals.\ Journal of Symbolic Computation {12, 231--247 (1988) %
1702.05313.extracted_bib
{Noro_Yokoyama % Noro,\ M.\ and Yokoyama,\ K.: Computation of Gr\" {obner bases (Japanese).\ Tokyo University Publisher (2003) %
1702.05313.extracted_bib
{Lauter %Lauter, K. E.: %{Geometric methods for improving the upper bounds on the number of rational% points on algebraic curves over finite fields, %Journal of Algebraic Geometry {10 (2001), no.~1, 19--36. %
1702.05313.extracted_bib
{WCC2015 % \"{Ozbudak, F.\ and Sayg\i, Z.: % {Explicit Maximal and Minimal Curves over Finite Fields of Odd Characteristics, % In: Proceedings of the $9$th International Workshop on Coding and Cryptography 2015 (WCC2015), % Apr 2015, Paris, France, 2016.
1702.05313.extracted_bib
{Serre1983 Serre, J.-P.: {Nombre des points des courbes algebrique sur $\F_q$, S\'em. Th\'eor. Nombres Bordeaux (2) 1982/83, 22 (1983).
1702.05313.extracted_bib
{Serre Serre, J.-P.: {Rational points on curves over finite fields, Lectures given at Harvard University 1985. Notes by Fernando Q. Gouv\'ea. % of lectures at Harvard University 1985.5 %Unpublished notes by Fernando Q. Gouv\'ea %of lectures at Harvard University 1985.
1702.05313.extracted_bib
{XYY16 Xue, J., Yang, T.-C. and Yu, C.-F.: {On superspecial abelian surfaces over finite fields, Doc. Math. {21 (2016) 1607--1643. %
1702.05313.extracted_bib
{Yui Yui, N.: {On the Jacobian varieties of %hyperelliptic curves over fields of characterisctic $p>2$, %Journal of algebra {52, 378--410 (1978) %
1702.05313.extracted_bib
{MapleHP Maple User Manual: Toronto: Maplesoft, a division of Waterloo Maple Inc., 2016., available on the web page\\ % http://www.maplesoft.com/products/maple/
1702.05313.extracted_bib
{HPkudo Computation programs and log files for the paper ``Enumerating superspecial curves of genus 4 in small characteristic'', available on the web page\\ http://www2.math.kyushu-u.ac.jp/\~{m-kudo/kudo-harashita-comp-PF.html