Case 88 s = 4 (remaining cases):

<table><thead><tr><th>P(Y)</th><th>p = 7</th></tr></thead><tbody><tr><td>Y<sup>-1</sup></td><td>no codes.</td></tr><tr><td>Y<sup>3</sup> - 1</td><td>no codes.</td></tr><tr><td>Y<sup>5</sup> - 1</td><td>no codes.</td></tr><tr><td>Y<sup>7</sup> - 1</td><td>inseparable</td></tr><tr><td>Y<sup>9</sup> - 1</td><td>no codes.</td></tr><tr><td>Y + 1</td><td>58 ms<br>275200 codes.</td></tr><tr><td>Y<sup>2</sup> + 1</td><td>89 ms<br>38093535023104 codes.</td></tr><tr><td>Y<sup>3</sup> + 1</td><td>90 ms<br>14058141548980940800 codes.</td></tr><tr><td>Y<sup>4</sup> + 1</td><td>174 ms<br>1451117410556451065813794816 codes.</td></tr><tr><td>Y<sup>5</sup> + 1</td><td>336 ms<br>310143959656077473500600000000000 codes.</td></tr><tr><td>Y<sup>6</sup> + 1</td><td>388 ms<br>44720054178174175715919090093196510756864 codes.</td></tr><tr><td>Y<sup>7</sup> + 1</td><td>inseparable</td></tr><tr><td>Y<sup>8</sup> + 1</td><td>586 ms<br>1378167769989025647558183098742522084711929172008697856 codes.</td></tr><tr><td>Y<sup>9</sup> + 1</td><td>784 ms<br>520511733411611481332101989569876054129043946067087397683200 codes.</td></tr></tbody></table>

(8.5)
Case 89 s = 4 (remaining cases):

<table><thead><tr><th>P(Y)</th><th>p = 3<sup>2</sup></th></tr></thead><tbody><tr><td>Y - 1</td><td>no codes.</td></tr><tr><td>Y<sup>3</sup> - 1</td><td>inseparable</td></tr><tr><td>Y<sup>5</sup> - 1</td><td>no codes.</td></tr><tr><td>Y<sup>7</sup> - 1</td><td>no codes.</td></tr><tr><td>Y<sup>9</sup> - 1</td><td>inseparable</td></tr><tr><td>Y + 1</td><td>177 ms<br>1197200 codes.</td></tr><tr><td>Y<sup>2</sup> + 1</td><td>69 ms<br>2584219514040576 codes.</td></tr><tr><td>Y<sup>3</sup> + 1</td><td>inseparable</td></tr><tr><td>Y<sup>4</sup> + 1</td><td>412 ms<br>6678190496748110778001774411776 codes.</td></tr><tr><td>Y<sup>5</sup> + 1</td><td>723 ms<br>508917688627993620986015300000000000 codes.</td></tr><tr><td>Y<sup>6</sup> + 1</td><td>inseparable</td></tr><tr><td>Y<sup>7</sup> + 1</td><td>1367 ms<br>7648811836043991967219161153740387628370395393331200 codes.</td></tr><tr><td>Y<sup>8</sup> + 1</td><td>2159 ms<br>12694947374150045644296214566181599847702416136079653858246656 codes.</td></tr><tr><td>Y<sup>9</sup> + 1</td><td>inseparable</td></tr></tbody></table>

(8.6)

# A Enumeration of inseparable selfdual skew cyclic codes

Factorizations over inseparable $E_k$ have been studied in [BU14]. But we will use another approach using twisted skew separable codes $E_{k,1}^{(\xi X^t)}$. These are defined as skew separable codes of $E_{k,1}$ corresponding to the usual adjunction on $E_{k,1}$ composed with the conjugation by $\xi X^t$. We aim at obtaining all inseparable codes as products of twisted skew separable codes.

## A.1 Counting selfdual skew separable twisted codes

We can count all possible selfdual skew codes from one single skew code by using the transitive right action of the orthogonal group in the Euclidean case, the unitary group in the Hermitian case, the symplectic group in the skew-Euclidean case or the skew-unitary group in the skew-Hermitian case, on those codes. The action is well defined as the following computation shows in the Euclidean or Hermitian case:

$$ \forall o \in \{\text{orthogonal group}\} \forall f \in \{\text{maximal orthogonal codes}\} fo(fo)^* = foo^*f^* = ff^* = 0. $$
In the skew-Euclidean or skew-Hermitian case:

$$ \forall o \in \{\text{symplectic group}\} \forall f \in \{\text{maximal orthogonal codes}\} \mathit{fs}(\mathit{fs})^* = \mathit{fss}^* \mathit{f}^* = -\mathit{ff}^* = 0. $$

Choosing a base, these classical groups corresponding to the coordinatewise bilinear form are conjugated to those related to our trace bilinear form. So in order to get the number of maximal orthogonal codes, we can take the cardinal of the quotient of the classical group by its stabilizer.

In the Euclidean case, choosing a base $\langle U, V \rangle$ constituted pairwise by hyperbolic pairs $\langle u, v \rangle$ as described in the algorithm 67, this cardinal is that of the general linear subgroup acting on the maximal isotropic spaces times the number of matrices in the upper right block: i.e. $q_l^{s^2}$ divided by the number of equations for the rows to be isotropic: $q_l^{s^{(s+1)/2}}$. So in the end we find the orthogonal Segre's formula again for the number of maximal isotropic subspaces:

$$ \prod_{0 \le i < s} (1 + q^i) $$

In the skew-Euclidean case, the cardinal of the stabilizer, is $q_l^{s^2}$ divided by the number of equations for the rows to be isotropic, which is now less than in the Euclidean case: $q_l^{s^{(s-1)/2}}$. So in the end we find the symplectic Segre's formula again for the number of maximal isotropic subspaces: $\prod_{0 < i \le s} (1 + q^i)$, using the symplectic action [Han05].

```
sage: G=GO(14,GF(9),1)
.....: H=GL(7,GF(9))
.....: segre=prod(1+9^i for i in range(7))
.....: G.cardinality()/H.cardinality()/9**(21)==segre
True

sage: G=Sp(14,GF(9),1)
.....: H=GL(7,GF(9))
.....: segre=prod(1+9^i for i in range(1,8))
.....: G.cardinality()/H.cardinality()/9**(28)==segre
True
```

## A.2 Enumeration of inseparable selfdual skew cyclic codes

**Definition 90** We fix parameters $t \in \{0, s\}$ and $\xi \in \mathbf{K} \otimes_{\mathbf{F}} \mathbf{F}_l$ with $\sigma_l(\xi) = \xi$, and $\theta^t(\xi) = -\xi$ if $t=s$. We define $\mathbf{E}_{\mathbf{k},l}^{(\xi \mathbf{X}^t)}$, the quadratic space $\mathbf{E}_{k,l}$ along with its $\xi X^t$-twisted bilinear form $(\kappa, \rho) = \text{Trace}_{\mathbf{K}_l/\mathbf{F}_l}(\zeta \cdot \xi \kappa \theta^t(\sigma_l(\rho)))$ corresponding to the twisted adjunction: $f^{\bullet}_{\xi X^t} = X^t \xi^{-1} \zeta^{-1} \sum_i X^{-i} \sigma_l(f_i) \zeta \xi X^{-t}$.

The $\xi X^t$-twisted bilinear form is Euclidean if $y_l = \pm 1$ and $t=0$

It is Hermitian if $y_l \neq \pm 1$ and $t=0$

It is skew-Euclidean if $y_l = \pm 1$ and $t=s$

It is skew-Hermitian if $y_l \neq \pm 1$ and $t=s$
**Lemma 91** The two expressions $(\kappa, f(\rho))_{\mathbf{F}_l}^{(\xi X^t)}$ and $(f^{\bullet} \varepsilon X^t(\kappa), \rho)_{\mathbf{F}_l}^{(\xi X^t)}$ coincide.

**Lemma 92** The set of $\xi$-twisted selfdual skew codes is in bijection with the set of non-twisted selfdual skew codes and their intersection is empty for any twisting verifying $\theta^s(\xi) = -\xi$.

*Proof.* We have trivially for any monic skew polynomial $f$ of degree $s$ generating a selfdual code $C_f$ of $\mathbf{E}_{k,l}$:

$$f\xi f^{\bullet}\varepsilon\xi^{-1} = \frac{ff^{\bullet}}{X^s(X^r - 1)}X^s(X^r - 1) = f(0)X^s(X^r - 1)$$

We assume $\xi$ to be $\sigma_l$-invariant. So, by Hilbert-90, we can solve the equation $\gamma\sigma_l(\gamma) = \xi$ for $\gamma$ in $\mathbf{K}_l^{\theta^s}$. Noting then $g = \sigma_l(\gamma)f\gamma^{-1}$, we get a bijection $f \mapsto g$ between nontwisted and $\xi$-twisted selfdual skew codes:

$$gg^{\bullet\xi} = \sigma_l(\gamma)f\xi f^{\bullet\xi}\gamma = \sigma_l(\gamma)ff^{\bullet}\frac{1}{\sigma_l(\gamma)} = f(0)X^s(X^r - 1)$$

Moreover if we assume $\theta^s(\xi) = -\xi$ and $ff^{\bullet} = ff^{\bullet\xi} = f\xi^{-1}f^{\bullet}\xi = 0$ in $\mathbf{E}_{k,l}$ then by evaluating lifts at 0, we get: $f(0) = \frac{\theta^s(\xi)}{\xi} = -1$. But this is not possible because $X^s(X^r - 1) \neq ff^{\bullet}$. Indeed $ff^{\bullet}_{r+s} = ff^{\bullet}_s = -1$ whereas $X^s(X^r - 1)_{r+s} = 1 \neq -1 = X^s(X^r - 1)_s$. $\square$

**Algorithm 93** Enumeration of inseparable selfdual skew cyclic codes

**Input:** $(X^k - 1)^n$: The cyclic polynomial to factorize as $ff^*$, $C_\kappa$: The family of all $\kappa$-twisted code indexed by $\kappa$

**Output:** $f$: The next selfdual skew code

1: $i \leftarrow n$

2: $\kappa \leftarrow 1$

3: $f \leftarrow 1$

4: **while** $i > 0$ **do**

5: Find the next solution $f_i$ from the family $C_\kappa$

6: $f \leftarrow f_i f$

7: $\kappa \leftarrow \kappa f_i(0)X^s(i\%2)$

8: $i \leftarrow i - 1$

9: **end while**

10: yield $f$

**Proposition 94** The enumeration algorithm 93 is exhaustive
**Proof.** (sketch of a proof) If we are in the Hermitian case or if the existence criterion is full-
filled in the Euclidean case, there exists at least one inseparable case of the form: $\prod_l f_i$ with
$f_i f_i^{\bullet}_{\kappa_i X^{s(i\%2)}} = 0$ The theorem 1.3 in [Gie98] due to Ore (1933) guarantees that the degree
of each $f_i$ in any other factorization in irreducible factors is equal to $s$. We thus search all
solutions $\prod_{1\le i \le n} f_i$ with $\deg(f_i) = s$ satisfying $\prod_{1\le i \le n} f_i (\prod_{1\le i \le n} f_i)^* \alpha X^{sn}(X^r-1)^n$. Per
induction, it suffices to show that $f_n$ is twisted selfdual. If $f_n$ divides $X^r-1$, $f_n^{\bullet}$ too, and so
by left and right Euclidean division, we get: $f_n \kappa f_n^{\bullet} = \alpha X^s (X^r-1)$ for a scalar $\kappa \in K_l$. If $f_n$
does not divide $X^r-1$, as it is irreducible, it is coprime to $X^r-1$. Thus having fixed such a
skew polynomial $f_n$ invertible in $E_k$, we can make an explicit bijection between the solutions of
$S_{n-1} = \{\prod_{1\le i \le n-1} f_i | \prod_{1\le i \le n-1} f_i (\prod_{1\le i \le n-1} f_i)^* \in (X^{sm}(X^r-1)^m) \text{ maximal}\}$ and $S_n|_{f_n} =
\{\prod_{1\le i \le n} f_i | \prod_{1\le i \le n} f_i (\prod_{1\le i \le n} f_i)^* \in (X^{sm}(X^r-1)^m) \text{ maximal}\}$, by conjugating $S_{n-1}$ with
$f_n$. To be explicit, this conjugation formula leads to the twisted nondegenerate sesquilinear form:
$(\kappa, \rho) = \text{Trace}_{K_l/\mathbb{F}_l}(\zeta \cdot \kappa(f_n f_n^*)(\theta)(\sigma_l(\rho)));$ the nondegeneration coming from the fact that $f_n$ is
coprime to $X^r-1$ and thus $f_n^{\wedge} \ast$ and $f_n f_n^{\wedge} \ast$ too. As the order $m$ corresponding to $S_{n-1}$ is less
than $n-1$, the order of $S_n|_{f_n}$ too. We deduce from this fact that there are no selfdual codes
$\prod_{1\le i \le n} f_i$ for $f_n$ coprime to $X^r-1$.
$\square$

**Proposition 95** The algorithm is correct

**Proof.** In order to enumerate all inseparable selfdual skew cyclic codes, at the price of some
redundancy, we can assume without loss of generality (see 94) that the general solution is a
product of twisted selfdual skew codes $f_1 \dots f_n$, taking the $f_i$ left monic, and we start by solving
the equation $f_n f_i^{\bullet} = 0(X^r - 1)$. This has been done in the preceding section. Now we obtain
a scalar $\kappa_n = \frac{f_n f_i^{\bullet}}{X^s (X^r - 1)}$ which is equal to $f_n(0)$. We then define another twisted adjunction to
solve $f_{n-1} \kappa_n X^s f_{n-1}^{\bullet} = 0(X^r - 1)$. Let $\bullet_{\kappa_n}$ be defined by: $f_i^{\bullet \kappa_n} = \sigma_l(\kappa_n) f_i^{\bullet} \kappa_n^{-1}$. The equation
becomes $f_{n-1} X^s f_{n-1}^{\bullet \kappa_n} = 0(X^r - 1)$. Solving it, we now obtain a scalar $\kappa_{n-1} \kappa_n = \frac{f_{n-1} X^s f_{n-1}^{\bullet \kappa_n}}{X^r (X^r - 1)}$.
At the next step, the monomials $X^s$ cancel and we are back in the Hermitian case. And so on
so forth, getting alternatively a skew Hermitian (resp. skew Euclidean) and a Hermitian (resp.
Euclidean) bilinear form. We have to check that the $\kappa_i$ satisfy the required symmetry for the
selfdual skew codes to exist: A monic polynomial $f$ satisfying the product criterion: $f f^{\bullet}_{\kappa_i X^t} = 0$
in $E_k^{(1,\kappa_i X^t)}$ has a constant term $f_0 = f(0)$ satisfying:

$$
(X^s + \dots + f_0) \kappa X^t (X^r f_0 + \dots + X^s) = \theta^s(\kappa) \theta^{s+t}(f_0) X^s X^t X^r + f_0 \kappa X^t X^s \alpha X^{r+s+t} - X^{s+t}
$$
Thus we have:

$$ 
\left\{ 
\begin{array}{l}
\theta^s(f_0) = -f_0 \text{ for } \theta^s(\kappa) = \kappa, t = 0 \quad (1) \\
\theta^s(\kappa) = -\kappa \text{ for } t = s \text{ symplectic case} \quad (2) \\
-f_0\kappa = \theta^s(\kappa f_0) \text{ for } t = 0 \quad (3)
\end{array}
\right. 
\qquad (A.1) 
$$

If we start with $\kappa = 1$, we get the symplectic case from (1) and (2) with $\kappa$ satisfying $\theta^s(\kappa) = -\kappa$, at the next step then an orthogonal case, then again alternatively a symplectic case with $\kappa$ satisfying $\theta^s(\kappa) = -\kappa$ from (3) etc ... □

**Remark 96** Noting $f_i^{(j)} = X^j f_i X^{-j}$, we have $r$ redundant factorizations of the form $\prod_i f_i^{(j)} = \prod_i f_i$ modulo $(X^r - 1)^n$ except for $\theta^j$ invariant $f_i$'s.

## A.3 SageMath enumeration of inseparable selfdual skew cyclic codes

For $F = GF(3)$ and $K = GF(3^6)$, $k = 1$ and $m = 1$, the upper bound on the number of generated inseparable selfdual skew codes is numerically equal to: $80 * 1120 * 80$, where 80 is the number of orthogonal isotropic spaces and 1120 the number of symplectic isotropic spaces. A sage enumeration based on this algorithm provides a number $n$ of maximal isotropic codes equal to $n = 2360960$. We have not much redundancies since $80 * 1120 * 80 \approx 3 * 2360960$.

**Remark 97** In addition to those codes, there are Euclidean cases where the global code $\prod_i f_i$ contains at least one sequence $f_i f_{i+1}$ with $f_{i+1} = f_i^*$. In these cases (whose count is given by the catalan numbers) we can cancel this product in our algorithm taking the resulting constant term into account. Their number for $F = GF(3)$ and $K = GF(3^6)$, $k = 1$ and $m = 1$ is 14224.

**Remark 98** In our example, the $\theta^s$ invariance (for $s = 3$) does not occur since it would imply the existence of selfdual skew cyclic codes in $K^{\theta^s}[X; \theta]/(X^s - 1)$ and $K^{\theta^s}[X; \theta]/(X^s + 1)$. But as $s$ is odd this can not happen. The $\theta^2$ invariance does obviously not occur either on the $f_i$'s.

## References

[Ann09] Guenther Annika. A mass formula for selfdual permutation codes. *Finite Fields and their Applications*, 15:517–533, 2009.

[Art11] M. Artin. *Algebra*. Pearson Education, 2011.
[BBB20] Aicha Batoul, Delphine Boucher, and Ranya Boulanouar. A construction of selfdual skew cyclic and negacyclic codes of length $n$ over $\mathbb{F}_{p^n}$. In *WAIFI 2020: Arithmetic of Finite Fields*, volume 12542 of *Lecture Notes in Computer Science*, RENNES, France, July 2020.

[Ber] Grégory Berhuy. More one vector space duality.

[BGU06] Delphine Boucher, Willi Geiselmann, and Félix Ulmer. Skew-cyclic codes, 2006.

[Bou16] Delphine Boucher. Construction and number of selfdual skew codes over $F_{p^2}$. *Advances in Mathematics of Communications*, Volume 10(Issue 4):765–795, November 2016.

[BU14] Delphine Boucher and Felix Ulmer. Self-dual skew codes and factorization of skew polynomials. *Journal of Symbolic Computation*, 60:47–61, 01 2014.

[CL17] Xavier Caruso and Jérémy Le Borgne. A new faster algorithm for factoring skew polynomials over finite fields. *Journal of Symbolic Computation*, 79:411–443, 2017.

[Gie98] M. Giesbrecht. Factoring in skew-polynomial rings over finite fields. *Journal of Symbolic Computation*, 26(4):463–486, 1998.

[Han05] Genevieve Hanlon. Counting points in sp(2n, fq) maximal parabolic subgroup. 04 2005.

[Jac96] Nathan Jacobson. Finite dimensional division algebras over fields. 1996.

[Mil20] J.S. Milne. *Fields and Galois theory*. 2020.

[PA71] G. Pólya and G.L. Alexanderson. Gaussian binomial coefficients. *Elemente der Mathematik*, 26:102–109, 1971.

[Ple65] V. Pless. The number of isotropic subspaces in a finite geometry. *Atti Accad. Naz. Lincei, VIII. Ser.*, Rend., Cl. Sci. Fis. Mat. Nat., 39:418–421, 1965.

[Seg59] Beniamino Segre. Le geometrie di galois. *Annali di Matematica Pura ed Applicata*, 48:1–96, 1959.

[Wis91] R. Wisbauer. *Foundations of Module and Ring Theory: A Handbook for Study and Research (1st ed.)*. 1991.