# Introduction

In Chapter [Linear Codes over Finite Rings](../LinearCodesOverFiniteRings/index-linear-codes-over-finite-rings.md#chap-coderng) basic functions for working with codes over a finite ring are described. Because of the large amount of machinery developed specifically for ${\mathbb{Z}}_4$-codes, this chapter will be devoted to this special case. The functionality available for ${\mathbb{Z}}_4$-codes consists of the machinery described in chapter [Linear Codes over Finite Rings](../LinearCodesOverFiniteRings/index-linear-codes-over-finite-rings.md#chap-coderng) together with the contents of this chapter.

This chapter includes constructions for some families of codes over ${\mathbb{Z}}_4$ (see sections [Families of Codes over ${\mathbb{Z}}_4$](constructions.md#sec-constfamilies) and [New Codes from Old](constructions.md#sec-plotkin)), efficient functions for computing the rank and dimension of the kernel of any code over ${\mathbb{Z}}_4$ (Section [Structures Associated with the Gray Map](z4-invar.md#sec-rankkernel)), as well as general functions for computing coset representatives for a subcode in a code over ${\mathbb{Z}}_4$ (Section [Coset Representatives](z4-invar.md#sec-cosetrep)). In addition, there are functions for computing the permutation automorphism group for Hadamard and extended perfect codes over ${\mathbb{Z}}_4$, and their cardinal (Section [Automorphism Groups](aut_group.md#sec-aut)). Finally, various algorithms for decoding codes over ${\mathbb{Z}}_4$ are also provided (Section [Decoding](decoding.md#sec-decoding)).

Error correcting codes over ${\mathbb{Z}}_4$ are often referred to as *quaternary* codes. Important concepts when discussing quaternary codes are *Lee weight* and the *Gray map*, which maps linear codes over ${\mathbb{Z}}_4$ to (possibly non-linear) codes over ${\mathbb{Z}}_2$. Many good non-linear binary codes can be defined as the images of simple linear quaternary codes. A code over ${\mathbb{Z}}_4$ is a subgroup of ${\mathbb{Z}}_4^n$, so it is isomorphic to an abelian structure ${\mathbb{Z}}_2^\gamma \times {\mathbb{Z}}_4^\delta$ and we will say that it is of type $2^\gamma4^\delta$, or simply that it has $2^{\gamma+2\delta}$ codewords. As general references on the available functions in Magma for codes over ${\mathbb{Z}}_4$, the reader is referred to [[Hammons *et al.*, 1994](../../references.md#cite-sole), [Wan, 1997](../../references.md#cite-wan-z4)].

For general references on the material in this chapter, the reader is referred to the bibliography included at the end of this chapter.

The machinery described in this chapter largely corresponds to Version 2.0 of the package *Codes over* ${\mathbb{Z}}_4$*: A Magma Package* which has been developed by Roland D. Barrolleta, Jaume Pernas, Jaume Pujol and Mercè Villanueva of the Combinatoric, Coding and Security Group (CCSG) at the Universitat Autònoma de Barcelona.
