Monomial Isomorphism for Tensors and Applications to Code Equivalence Problems

Starting from the problem of d -Tensor Isomorphism ( d - TI ), we study the relation between various Code Equivalence problems in different metrics. In particular, we show a reduction from the sum-rank metric ( CE sr ) to the rank metric ( CE rk ). To obtain this result, we investigate reductions between tensor problems. We deﬁne the Monomial Isomorphism problem for d -tensors ( d - TI ∗ ), where, given two d -tensors, we ask if there are d − 1 invertible matrices and a monomial matrix sending one tensor into the other. We link this problem to the well-studied d - TI and the TI -completeness of d - TI ∗ is shown. Due to this result, we obtain a reduction from CE sr to CE rk . In the literature, a similar result was known, but it needs an additional assumption on the automorphisms of matrix codes. Since many constructions based on the hardness of Code Equivalence problems are emerging in cryptography, we analyze how such reductions can be taken into account in the design of cryptosystems based on CE sr .


Introduction
Equivalence problems.An equivalence problem is a computational problem where, given two objects A and B of the same nature, it asks whether there exists a map with some properties (an equivalence) sending A to B. Different problems can be stated, depending on the nature of the considered objects or the properties of the map.One of the most well-known equivalence problems is Graph Isomorphism, but in the literature one can find problems concerning groups, quadratic forms, algebras, linear codes, tensors, and many other objects.We will focus on the latter, with the Code Equivalence and the Tensor Isomorphism problems.An interesting fact is that the isomorphism problem for tensors seems "central" among others.In particular, a large class of equivalence problems can be polynomially reduced to it.In other words, given a pair of objects (groups, algebras, graphs, etc.), a pair of tensors can be built such that they are isomorphic if and only if the starting objects are equivalent.This led to the definition of the complexity class TI in [GQ21].Different reductions among these problems can be found in [GQ23; GQT21; PR97; CDG20; RST22].In general, there are no known polynomial algorithms for most of the above problems.Because of this, many public key cryptosystems base their security on the hardness of solving these kinds of problems, for example, Isomorphism of Polynomials [Pat96], Code Equivalence [BBPS21; CNP+23], Tensor Isomorphism [JQSY19], Lattice Isomorphism [DPPW23], Trilinear Forms Equivalence [TDJ+22], and problems from isogenies of elliptic curves [DG19; BKV19; FFK+23].
Code Equivalence.One of the most studied equivalence problems concerns linear codes.In the Hamming metric, the maps that generate an equivalence were classified in [Mac62], leading to the Monomial Equivalence Problem, which was studied in [PR97;SS13].Worth mentioning is the Support Splitting Algorithm [Sen00], which solves the above problem in average polynomial time for a large class of codes over F q for q < 5.For a detailed analysis, the interested reader can refer to [BBPS23].Recently, the problem of equivalence in different metrics has been studied, and we will focus on the rank metric and the sum-rank one.Concerning the rank metric, the classification of equivalence maps is given in [Mor14], while in [CDG20], the authors analyze the Matrix Code Equivalence, and they reduce the Hamming case to it.The same result is given in an independent work [GQ23], where the former problem is called Matrix Space Equivalence.In [RST22], it is shown that Matrix Code Equivalence is polynomially equivalent to problems on bilinear and quadratic maps.Moreover, the link between the rank and the sumrank metric is studied, leading to a reduction from the latter to the former in a special case.Here we extend this analysis, finding an unconditional reduction from the code equivalence in the sum-rank metric to the rank one.
Our contribution and techniques.In this work, we give two results of different nature.The first one concerns some relations between tensors problems.The d-Tensor Isomorphism Problem (d-TI) asks, given two d-tensors T 1 and T 2 , if there are d invertible matrices A 1 , . . ., A d sending T 1 to T 2 .We introduce another problem called d-Tensor Monomial Isomorphism Problem (d-TI * ), where instead of having d invertible matrices, we require that one of them must be monomial.We show that d-TI * reduces to 3-TI for every d ≥ 4. To show this, we use techniques from [CDG20] where the authors exhibit a reduction from Monomial Code Equivalence to Matrix Code Equivalence.We reformulate this reduction in terms of tensors, and we generalize it in higher dimensions.In particular, we show that d-TI * is reducible to (2d − 1)-TI, and then, using a result from [GQ23], we get as corollary that d-TI * reduces to 3-TI.Our techniques are the following: given the reduction Ψ and the (2d − 1)-tensors Ψ(T 1 ) and Ψ(T 2 ), we project to the vector space W where we expect the action of the monomial matrix.Then, we consider the projected tensor as a 2-tensor in order to compute its rank.We show that some constrains on the rank imply that the matrix acting on W is monomial.Observe that the techniques from [GQ23] can be adapted and used as well, but they are less efficient in terms of output dimension, since the reduction is looser Cor. 17  with respect to the one given in [CDG20].
Another contribution is about the sum-rank code equivalence.Using the result from above, we reduce the problem of deciding whether two sum-rank codes are equivalent to the problem of deciding if two matrix codes are equivalent.Note that a similar result is given in [RST22] with the assumption that some automorphisms group are of a given form.While such hypothesis is mostly satisfied for randomly generated matrix codes (for example the ones used in cryptography [CNP+23]), here we give an unconditional reduction.Unfortunately, our reduction produces matrix codes with dimension and sizes that are polynomially bigger than the starting parameters of the sum-rank codes.In particular, we get a O(x 6 ) overhead.
Due to this result, we can conclude that for the three considered metrics (Hamming, rank, sum-rank), Code Equivalence problems are in the class TI. Figure 1 summarizes new and known reductions between code equivalence and other problems, showing the route we used.This work is organized as follows.In Section 2 we give some preliminaries on tensors, linear codes and equivalence problems in different metrics.Section 3 introduces the Monomial Isomorphism problem for tensors and a proof of its TI-hardness is given.Section 4 concerns the proof that the Code Equivalence problem in the sum-rank metric can be reduced to the same problem in the rank metric.

Preliminaries
For a prime power q, F q is the finite field with q elements, and F n q is the n-dimensional vector space over F q .The span of vectors v 1 , . . ., v k is denoted with v 1 , . . ., v k .With F n×m q we denote the linear space of n × m matrices with coefficients in F q .Let GL(n, F q ) be the group of invertible n × n matrices with coefficients in F q .When the field is implicit, we use GL(n) instead.A monomial n × n matrix is given by the product of an n × n diagonal matrix with non-zero entries on the diagonal, with an n × n permutation matrix.The group of n × n monomial matrices over the field F q is denoted with Mon(n, F q ) or Mon(n), and is a subgroup of GL(n).We denote with W 1 ⊕ W 2 the direct sum of vector spaces W 1 and W 2 and its elements are written as (w 1 , w 2 ), where w i is in W i .With S t we denote the symmetric group over a set of t elements.The transpose of a matrix A is denoted with A t and I denotes the × identity matrix.

Tensors
Given a positive integer d, a d-tensor over F q is an element of the tensor space If we fix the bases {e ni } for every linear space F ni q , we can represent a d-tensor T with respect to its coefficients We say that T has size n 1 × . . .× n d .For example, observe that 1-tensors and 2-tensors can be represented as vectors and matrices, respectively.
A rank one (or decomposable) tensor is an element of the form Given a d-tensor T , its rank is the minimal non-negative integer r such that there exist t 1 , . . ., t r rank one tensors for which T = r i=1 t i .In general, computing the rank of a d-tensor is a hard task for d ≥ 3 [Hås89; S Š18; Shi16].
The projection to a can be defined for any a in F nj q .Since we are interested mainly in projections to an element of the basis e (j) (1) (1) In other words, we send to zero every component of i1,...,i d T (i 1 , . . ., i d )e (1) k , obtaining a (d − 1)-tensor.A group action can be defined on the vector space T = d i=1 F ni q of d-tensors of size from the Cartesian product of invertible matrices G = GL(n 1 ) × . . .× GL(n d ) as follows It can be shown that the action defined above does not change the rank of a tensor1 .In particular, this implies that the action of an element in GL(n 1 ) × . . .× GL(n i−1 ) × GL(n i+1 ) × . . .× GL(n d ) on the projection proj e (i) k (T ) of a tensor T has the same rank as proj e (i) k (T ).We summarize these properties in formulas The isomorphism problem between tensors has some interesting links and properties in computational complexity theory.Here we recall the formal definition of the problem.
Definition 1.The d-Tensor Isomorphism (d-TI) problem is given by The search version is the problem of finding such matrices, given two isomorphic d-tensors.
If we recall the decision problems d-Colourability (d-COL) and d-SAT, it is known that the first integer for which these problems are NP-complete is d = 3.In particular, there are polynomial reductions from d-COL to 3-COL and from d-SAT to 3-SAT.The same happens for d-TI and 3-TI, as shown in the following astonishing result from [GQ23].
Since a lot of different problems can be reduced to d-TI, in the same flavor of the complexity class GI (the set of problems reducible in polynomial time to Graph Isomorphism [KST12]), the authors of [GQ21] define the TI class.
Definition 3. The Tensor Isomorphism class (TI) contains decision problems that can be polynomially reduced to d-TI for a certain d.A problem D is said TI-hard if d-TI can be reduced to D, for any d.A problem is said TI-complete if it is in TI and is TI-hard.
It is easy to see that TI is a subset of NP, and we can adapt the AM protocol for Graph Non-Isomorphism [GMW91] and Code Non-Equivalence [PR97] to show that TI is in coAM.This means that no problem in TI cannot be NP-complete unless the polynomial hierarchy collapses at the second level [BHZ87].

Linear codes in different metrics
A linear code C of dimension k is a linear space of dimension k.A linear code can be embedded in different linear spaces V over F q , depending on the form of the code.A code is endowed with a map weight w defined on V w : V → N such that w(x) = 0 if and only if x = 0. We can define a metric d from a weight w Throughout this paper, we will consider three weights with their metrics.We highlight that, even if we can endow the same code with two or more different metrics, we consider a code with just a metric.
The first one is the Hamming weight.Here we consider linear codes embedded in F n q , and we say that the code C has length n.This weight is defined as the number of non-zero entries of a vector: We refer to the distance induced by w H as d H .A useful representation of a kdimensional code C of length n in the Hamming metric is given by its generator matrix, a k × n matrix having a basis {v 1 , . . ., v k } of C as rows.Notice that the generator matrix is not unique since there are many bases for the same linear code.
The second weight we consider is defined on matrices.This means that our code C is a space of matrices and usually we refer to it as a matrix code.If we consider n × m matrices, the code has length n × m.The map w R : is defined as the rank of the matrix M .Hence, the distance d R between M 1 and M 2 is given by the rank of M 2 − M 1 .
The last class of codes we consider is embedded into the direct sum (or Cartesian product) of spaces of matrices.Given natural numbers d, n 1 , . . ., n d , m 1 , . . ., m d , we have that the linear space V defined above is We can define the Sum-rank weight as the sum of the ranks The distance d SR induced by w SR is called sum-rank metric and we call a code endowed with this distance a sum-rank code of parameters d, n 1 , . . ., n d , m 1 , . . ., m d .
Observe that the sum-rank metric is both a generalization of the Hamming and the rank distance.For , the sum-rank metric coincides with the Hamming metric, and sum-rank codes can be seen as linear codes of length d in F d q .If we have d = 1, then d SR is the rank metric, and sum-rank codes are matrix codes of size n 1 × m 1 .

Code Equivalence
We recall the general problem of deciding whether two linear codes are equivalent.Given a weight w and a metric d, we say that an invertible linear map f from the vector space V to itself preserves the metric (or, equivalentely, the weight) if f (w(x)) = w(x) for every x in V. We call such maps linear isometries, and they form a group with the composition.Two linear codes are linearly equivalent if there exists a linear isometry between them.The task of checking if two codes are equivalent is called Linear Code Equivalence Problem.Since in the rest of the paper we will consider only linear isometries, sometimes we drop the word "linear" when we talk about isometries or equivalences, in particular we refer to the problem above as Code Equivalence (CE).Its hardness depends on which codes and metric we consider.In the following, we define CE with respect to the three different metrics we saw in Subsection 2.2.
We can characterize linear isometries in the Hamming metric, reporting a wellknown result from [Mac62].
Proposition 4. If f : F n q → F n q is a linear isometry in the Hamming metric, then there exists an n × n monomial matrix Q such that f (x) = xQ for all x in F n q .
Then two codes C and D are linearly equivalent if there exists a monomial matrix Q such that C = yQ ∈ F n q : y ∈ D .The generator matrix G of a code C is not unique, hence, for every invertible matrix S, the matrix SG generates the same code C.This must be considered since we state the equivalence problem in terms of generator matrices.
Definition 5.The Hamming Linear Code Equivalence (CE H ) problem is given by • input: two codes C and D represented by their k × n generator matrices G and G , respectively; • output: YES if there exist a k × k invertible matrix S and an n × n monomial matrix Q such that G = SG Q, and NO otherwise.
The search version is the problem of finding such matrices given two linearly equivalent codes.
Observe that the matrix S in the above definition models a possible change of basis, while the monomial matrix Q is a permutation and a scaling of the coordinates of the code.Now we consider the rank metric.From [Mor14], linear isometries for the rank metric can be characterized as follows.
Proposition 6.If f : F n×m q → F n×m q is a linear isometry in the rank metric, then there exist an n × n invertible matrix A and an m × m invertible matrix B such that where the latter case can occur only if n = m.
Usually, an isometry can be denoted with a pair of matrices (A, B).
In the literature, for example [CDG20; RST22], the linear equivalence problem for matrix codes is defined taking into account only the first case given in Proposition 6, even when we have n = m.In terms of the computational effort to solve the problem, this is not an issue, since considering both cases requires at most twice the time of considering only the first one, and hence, just a polynomial overhead that we can ignore.For simplicity, we continue the approach from [CDG20; RST22] in the following definition.
Definition 7. The rank Linear Code Equivalence (CE rk ) problem is given by • input: two n × m matrix codes C and D of dimension s represented by their bases; • output: YES if there exist matrices A in GL(n) and B in GL(m) such that, for every M in D, we have that AM B is in C, and NO otherwise.
The search version is the problem of finding such matrices given two linearly equivalent codes.
In the literature, this problem is also called Matrix Code Equivalence (MCE).Given a matrix code C, an automorphism of C is a linear isometry f such that f (C) = C.We say that C has trivial automorphisms if the only automorphisms of C are of the form M → (λI n ) M (µI m ) for some non-zero λ, µ in F q .
The equivalence problem between sum-rank codes was introduced in 2020 by Martínez-Peñas [Mar20].Before stating the problem, we characterize linear sumrank isometries.This result is given in [CGL+22] and a slightly less general statement can be found in [Ner22, Proposition 4.26].
q be a linear isometry in the sum-rank metric.Then there exists a permutation σ in S d such that n i = n σ(i) and m i = m σ(i) for every i, and there exist ψ i : F ni×mi q → F ni×mi q isometries in the rank metric such that We are ready to state the linear equivalence problem for sum-rank codes.As in the case of CE rk , we choose to not include the case of transposition of matrices.
Remark.Observe that, even if for CE rk the inclusion of the transposition of matrices has only a polynomial blow-up, this is not the case for CE sr .In fact, from [Ner22] we can see that the transposition can be seen as the action of F d 2 .This implies that there is an overhead of O(2 d ) between considering or not the transposition of matrices, for example, see [CDG20, Remark 2] for the rank case.• output: YES if there exist matrices A 1 , . . ., A d , B 1 , . . ., B d , where A i is in GL(n i ) and B i is in GL(m i ), and a permutation σ in S d such that and NO otherwise.
The search version is the problem of finding such matrices given two linearly equivalent codes.
This formulation embraces both the previous linear equivalence problems for Hamming and rank metric as special cases.Due to this, we can formulate the next result.
Proposition 10.Both CE H and CE rk polynomially reduce to CE sr .
A natural question is about the converse, whether problems in the Hamming or the sum-rank metric reduce to CE rk .It has been show independently in [CDG20] and [GQ23] that CE H can be reduced to CE rk , using two different approaches.In [GQ23, Section 5], the reduction uses 3-tensors via an "individualization" argument to force a matrix to be monomial.In [CDG20], given a linear code of dimension k in F n q , the reduction defines a matrix code in F k×(k+n) q . This approach will be generalized in the setting of d-tensors in the following section, and it will give us some reductions between tensors problem in dimensions higher than 3.

Monomial Isomorphism Problems
In this section, we will examine the relationship between tensor isomorphism problems when a matrix acting on a specific space is required to be monomial instead of using the action from the entire group GL(n 1 ) × • • • × GL(n d ).Specifically, there exists a j such that the action on the j-th space is given by Mon(n j ).For simplicity, we will refer to this special space as the last one throughout the remainder of the article and in the problems statements.Since Mon(n d ) is a subgroup of GL(n d ), the action of the group GL(n The search version is the problem of finding such matrices, given two monomially isomorphic d-tensors. We recall that, if the action of the monomial matrix is not on the last vector space, we can permute the spaces to obtain the problem above.Observe that the problem 2-TI * is exactly CE H and the proof that CE H reduces to CE rk from [CDG20] can be viewed as a reduction from 2-TI * to 3-TI.In the following, we generalize this approach to reduce d-TI * to (2d − 1)-TI.
Let V 1 , . . ., V d be vector spaces over F q of dimension n 1 , . . ., n d , respectively.Now let {v nj } be a basis for the space V j .We recall that W 1 ⊕ W 2 is the direct sum of vector spaces W 1 and W 2 and its elements are of the form (w 1 , w 2 ).The action of an element of GL(dim(W 1 ) + dim(W 2 )) is block-by-block: The reduction we use is the following map, going from a space of d-tensors to a space of (2d − 1)-tensors, Ψ : (2) Example 1 (Running example).As an exmaple, consider d = 3 and a tensors in Given the tensor In the following, we show that two tensors T 1 and T 2 are monomially isomorphic if and only if Ψ(T 1 ) and Ψ(T 2 ) are isomorphic.
Proof.Suppose that T 1 and T 2 are in d i=1 V i as defined above.Now, since T 1 and T 2 are monomially isomorphic, there exist d − 1 invertible matrices A 1 , . . ., A d−1 and a monomial matrix Q such that Let Q be the product of a permutation matrix P corresponding to the permutation σ in S n d and a diagonal matrix D = diag(α 1 , . . ., α n d ).More explicitly (3) Our claim to obtain the thesis is that where for every i = 1, . . ., d − 2

Example 2 (Running example). Consider the tensor T 1 from Example 1 under the action of matrices
We obtain the monomially isomorphic tensor T 2 = (A, B, C) T 1 = e 1 ⊗ e 2 ⊗ e 3 + e 2 ⊗ e 1 ⊗ e 2 + e 1 ⊗ e 1 ⊗ e 1 and it can be seen that Ψ(T 1 ) is isomorphic to Ψ(T 2 ) via the matrices (A, B, Ã, B, C), where as in the proof of Proposition 12. Now we show the converse.
Proof.Since Ψ(T 1 ) and Ψ(T 2 ) are isomorphic, there exist invertible matrices A 1 , . . ., We want to exhibit d − 1 invertible matrices A 1 , . . ., A d−1 and a monomial matrix In particular, we will show that A i = A for every i = 1, . . ., d − 1.First, we claim that Q is a monomial matrix.Consider (I n1 , . . ., I n d−1 , I n1+n d , . . ., I n d−1 +n d , Q) Ψ(T 1 ) and use Qv (d) (9) Now consider Eq. (9) as a 2-tensor in With this new view, we obtain having rank at most the number of non-zero elements of Qk,• , the k-th row of the matrix Q, but at least 1 since Q is invertible.Now consider the action of (A 1 , . . ., A d−1 , Ã1 , . . ., Ãd−1 ) on this tensor: the rank remains the same.If we repeat this process for Ψ(T 2 ), we obtain the following rank-1 tensor in From the equality of the ranks, Qk,• must have exactly a non-zero element for each k, and hence, Q is a monomial matrix of the form P D, where D = diag(α 1 , . . ., α n d ) is a diagonal matrix and P is a permutation matrix corresponding to the permutation σ in S n d .

(18)
Since (A, B, Ã, B, C) Ψ(T 1 ) = Ψ(T 2 ), we have that the rank of Eq. ( 17) is equal to the rank of Eq. ( 18), hence the row (c 2,1 , c 2,2 , c 2,3 ) has exactly one non-zero element Using the same argument, projecting on different elements of the basis of F 3 2 , we show that every row of C has one non-zero entry.This shows that C is monomial and we denote with σ be the permutation associated to C. Now we deal with the last part of the proof, showing that T 1 and T 2 are monomial isomorphic.Consider again Eq. ( 18).We can project to elements of the basis of ( For example, when we project to (e 1 , 0) ⊗ (e 2 , 0), we have e 2 ⊗ e 1 .Similarly, projecting to (0, e 2 ) ⊗ (0, e 2 ) produces again e 2 ⊗ e 1 .Other projections to (0, e i ) ⊗ (0, e j ) with i = j, or to mixed elements like (e i , 0) ⊗ (0, e j ) give us the zero tensor.In particular, the non-zero projections are multiples of e 2 ⊗ e 1 .We denote the vector space generated by all these projections with V 2 .This space must be equal to the span of all the same projections (up to σ) of (A, B, Ã, B, C) Ψ(T 1 ).As an example, we first project to e σ −1 (2) of F 3 2 , and then to (e 1 , 0) ⊗ (e 2 , 0).We obtain a multiple of the 2-tensor i,j T 1 (i, j, 2)Ae i ⊗ Be j .
The vector space generated by these projections is exactly V 2 since (A, B, Ã, B, C) Ψ(T 1 ) is equal Ψ(T 2 ).In other words, Hence, there exists a non-zero scalar λ 2 (in this case equal to 1) such that e 1 ⊗ e 2 = i,j T 1 (i, j, 2)Ae i ⊗ Be j .
We repeat the process with other elements of the basis of F 3 2 , both for Ψ(T 2 ) and for (A, B, Ã, B, C) Ψ(T 1 ).Then we tensorise the projections of Ψ(T 2 ) with e k and the ones of (A, B, Ã, B, C) Ψ(T 1 ) with e σ −1 (k) .Taking the sum on k gives us Therefore, T 1 and T 2 are monomially equivalent.
The combination of the two results above gives us the main result of this section.
Proof.Given an instance (T 1 , T 2 ) of d-TI * , we can build an instance (Ψ(T 1 ), Ψ(T 2 )) of (2d − 1)-TI.If we call an oracle for (2d − 1)-TI on the latter pair of tensors, then we can decide the original monomial isomorphism: Proposition 12 shows that Ψ(T 1 ) and Ψ(T 2 ) are isomorphic if T 1 and T 2 are monomially isomorphic.On the other hand, Proposition 13 shows that if Ψ(T 1 ) and Ψ(T 2 ) are isomorphic, then T 1 and T 2 are monomially isomorphic.Since the map Ψ is polynomially computable, this is a correct and polynomial-time reduction.
Let us analyze the sizes of the reduction Ψ.It takes a d tensor of size n 1 ×. ..×n d and returns a (2d−1)-tensor of size n 1 ×. ..×n d−1 ×(n 1 +n d )×. ..×(n d−1 +n d )×n d .We will use this reduction to link Code Equivalence problems in the following section, but this result could be of independent interest and shows how powerful is the TI class [GQ21].In particular, Theorem 14 proves that for every d, d-TI * is in the class TI.Moreover, a trivial reduction can be found from d-TI to (d + 1)-TI * (send T to T ⊗ 1), hence for d ≥ 4 we have that d-TI * is TI-complete.

Relations between Code Equivalence Problems
In this section, we show how to reduce the code equivalence problem for sumrank codes to the one in the rank metric.A reduction is given in [RST22], but it assumes that the automorphism group of the obtained rank code is trivial in the sense of Subsection 2.3.We recall the technique from [RST22], and we observe how this kind of reduction (sending a tuple of elements of F m q to a block-diagonal matrix) does not work without the trivial automorphisms assumptions.
Let C be a sum-rank code with basis {C 1 , . . ., C k }, where is a tuple of matrices.We denote with Φ the map from the set of sum-rank codes to the set of matrix codes used in [RST22] where W i is the ( i n i ) × ( i n i ) block diagonal matrix with the elements of C i on the diagonal.We recall that if the automorphisms group of the image of Φ is not trivial, then, given an isometry in the rank metric, we cannot retrieve an isometry in the sum-rank setting since the two codes are not equivalent.
respectively.It can be seen that C and D are not equivalent since there is not any sum-rank isometry between them: the permutation must be the identity since n 1 = n 2 and do not exist invertible matrices (A, B) in GL(3) × GL(2) such that AC 1 B is in the space generated by D 1 (just look at their ranks).However, if we consider Φ(C) and Φ(D), we obtain the two one-dimensional matrix codes generated by , respectively.We can see that Φ(C) and Φ(D) are equivalent via the isometry given by permutation matrices P σ and P τ , where σ = (2 4) is in S 5 and τ = (2 3) is in S 4 .In fact, P σ C P τ = D .This happens since the automorphisms groups of Φ(C) and Φ(D) are not trivial.For example, for Φ(C) it contains the isometry (P (4 5) , P (3 4) ), where (4 5) and (3 4) are permutations in S 5 and S 4 , respectively.
The 3-TI problem is equivalent to the Code Equivalence in the rank metric CE rk since the former can be stated in terms of matrix spaces, and the admissible maps between these spaces are exactly the isometries used for CE rk (see [GQ23]).A sketch of the reduction is the following.To a matrix code C generated by C 1 , . . ., C k we associate the 3-tensor in the space A ⊗ B ⊗ C In particular, A and B represent the spaces of rows and columns, respectively, while C is the space representing the dimension of the code (or the elements in the basis).Hence, a matrix can be represented as a 2-tensor in A⊗B, and the action (A, B) M is the matrix multiplication AM B t .The action regarding C is the map sending a k-uple of matrices into another k-uple.Therefore, given two matrix codes C and D, with bases C 1 , . . ., C k and D 1 , . . ., D k , equivalent via (A, B) and such that the invertible matrix M sends the basis AC 1 B, . . ., AC k B to D 1 , . . ., D k , the tensors T C and T D are isomorphic via (A, B t , M ).The vice versa is obtained similarly and we highlight that there is no overhead in the sizes of tensors and matrix spaces obtained in both directions.
Hence, we can resume the above observation in the following result.
Theorem 15.The problem CE rk is TI-complete.
By the TI-hardness of CE rk and since it can be reduced to CE sr , we get that CE sr is TI-hard.If we want to show its TI-completeness, we need to prove that it is in TI, presenting a reduction from a TI-complete problem, for instance 4-TI * .
Lemma 16.The problem CE sr is polynomially reducible to 4-TI * .
Proof.We model a sum-rank code as a 4-tensor.Given a sum-rank code C with parameters d, n 1 , . . ., n d , m 1 , . . ., m d and basis {C 1 , . . ., C k }, let N be the maximum among n 1 , . . ., n d and M be the maximum among m 1 , . . ., m d .For each i from 1 to d, we can embed an n i × m i matrix into an N × M one, filling it with zeros.Hence, there are d embeddings g i such that In the rest of the proof, we consider sum-rank codes embedded via the functions g i , this means that we work with codes having parameters d, n i = N, m i = M for every i = 1, . . ., d.Let SR(d, N, M ) be the set of sum-rank codes of parameters d, n i = N, m i = M and let A, B, C, D be vector spaces of dimension N, M, k, d with bases {a i } i , {b i } i , {c i } i and {d i } i , respectively.Here, A and B denotes the row and column spaces of the matrices, C denotes the dimension of the code, while D models the factors of the sum-rank code.Hence, the code generated by {C 1 , . . ., C k } can be seen as the 4-tensor i1,...,i4 The projection to a factor F nj ×mj q is a matrix code, which can be seen as the 3-tensor where the action of (A, B, M ) is intended as the left-right multiplication for A and B t , while M is a change of basis.Let δ i,j be the Kronecker's delta and define the map  , where L ij is an N × N matrix for every i and j.Analogously, R and S have the same structure, with blocks of dimension M × M and k × k, respectively.Now, for simplicity, we will focus on the action of L on Φ(C), but the same argument can be used for R and S. As in the proof of Proposition 13, we assume that the matrix Q is the identity matrix, otherwise we need take care of the permutation σ in the indexes and the scalars of D. We write proj d k ((L, R, S, Q) Φ(C))  +(e 3 , 0) ⊗ (e 1 , 0) ⊗ (e 1 , 0) ⊗ e 1 +(e 1 , 0) ⊗ (e 1 , 0) ⊗ (e 2 , 0) ⊗ e 1 C (1) 2 +(0, e 2 ) ⊗ (0, e 2 ) ⊗ (0, e 1 ) ⊗ e 2 C (2) 1 +(0, e 2 ) ⊗ (0, e 1 ) ⊗ (0, e 2 ) ⊗ e 2 .C (2) 2 Using the same strategy adopted in the proof of Theorem 14, and since the map Φ is polynomial-time computable, the above result implies that CE rk reduces to 4-TI * .This fact, combined with Theorem 2 and Theorem 15 leads to the following corollary.
Corollary 17.The problem CE sr is TI-complete.In particular, it is polynomially reducible to CE rk .
A "proof" of the above result can be seen in Figure 1, showing the path of the reduction from CE sr to CE rk .

Figure 1 :
Figure 1: Reduction between problems and TI-completeness."A → B" indicates that A reduces to B. Dashed arrows denote trivial reductions.
Recall that, as linear space, a sum-rank code C of parameters d, n 1 , . . ., n d , m 1 , . . ., m d and dimension k admits a basis of the form {C 1 , . . ., C k } where C i = C (1) i , . . ., C (d) i is a tuple of matrices.In particular, C (j) i is in F nj ×mj q for each i and j.Definition 9.The sum-rank Linear Code Equivalence (CE sr ) problem is given by • input: two sum-rank codes C and D, of parameters d, n 1 , . . ., n d , m 1 , . . ., m d and dimension k represented by their bases {C i } and {D i }, respectively; on d-tensors is well-defined.When there exists an element g sending the d-tensor T 1 into T 2 , we say that they are monomially isomorphic.Definition 11.The Monomial d-Tensor Isomorphism (d-TI * ) problem is given by • input: two d-tensors T 1 and T 2 in d i=1 F ni q ; • output: YES if there exists an element g of GL(n 1 )×• • •×GL(n d−1 )×Mon(n d ) such that T 2 = g T 1 and NO otherwise.

Example 4 .
Consider the field F 2 and the one-dimensional sum-rank codes C and D with parameters d = 2, n 1 = 3, n 2 = 2, m 1 = m 2 = 2 generated by