# Boolean Predicates

For the following operators, $C$ and $D$ are codes defined as a subset (or subspace) of the $R$-space $V$.

## `u in C: ModTupRngElt, Code -> BoolElt`

Return `true` if and only if the vector $u$ of $V$ belongs to the code $C$.

## `u notin C: ModTupRngElt, Code -> BoolElt`

Return `true` if and only if the vector $u$ of $V$ does not belong to the code $C$.

## `C subset D: Code, Code -> BoolElt`

Return `true` if and only if the code $C$ is a subcode of the code $D$.

## `C notsubset D: Code, Code -> BoolElt`

Return `true` if and only if the code $C$ is not a subcode of the code $D$.

## `C eq D: Code, Code -> BoolElt`

Return `true` if and only if the codes $C$ and $D$ are equal.

## `C ne D: Code, Code -> BoolElt`

Return `true` if and only if the codes $C$ and $D$ are not equal.

## `IsCyclic(C): Code -> BoolElt`

Return `true` if and only if the linear code $C$ is a cyclic code.

## `IsSelfDual(C): Code -> BoolElt`

Return `true` if and only if the linear code $C$ is self-dual (or self-orthogonal) (i.e., $C$ equals the dual of $C$).

## `IsSelfOrthogonal(C): Code -> BoolElt`

Return `true` if and only if the linear code $C$ is self-orthogonal; that is, return whether $C$ is contained in the dual of $C$.

## `IsProjective(C): Code -> BoolElt`

Returns `true` if and only if the (non-quantum) code $C$ is projective.

## `IsZero(u): ModTupRngElt -> BoolElt`

Return `true` if and only if the codeword $u$ is the zero vector.

## `Example: Self Dual Z4 (ex-659440)`

We consider an [8, 7] linear code $K_8$ over $Z_4$ and examine some of its properties.

```magma
> Z4 := IntegerRing(4);
> K8 := LinearCode< Z4, 8 |
>     [1,1,1,1,1,1,1,1],
>     [0,2,0,0,0,0,0,2],
>     [0,0,2,0,0,0,0,2],
>     [0,0,0,2,0,0,0,2],
>     [0,0,0,0,2,0,0,2],
>     [0,0,0,0,0,2,0,2],
>     [0,0,0,0,0,0,2,2]>;
> K8;
[8, 7, 2] Linear Code over IntegerRing(4)
Generator matrix:
[1 1 1 1 1 1 1 1]
[0 2 0 0 0 0 0 2]
[0 0 2 0 0 0 0 2]
[0 0 0 2 0 0 0 2]
[0 0 0 0 2 0 0 2]
[0 0 0 0 0 2 0 2]
[0 0 0 0 0 0 2 2]
> IsCyclic(K8);
true
> IsSelfDual(K8);
true
> K8 eq Dual(K8);
true

```
