---
title: "Predicates of Orders"
canonical: "https://docs.magma-maths.org/v2.30-1/Algebras/QuaternionAlgebras/order-pred.html"
source: "https://docs.magma-maths.org/v2.30-1/Algebras/QuaternionAlgebras/order-pred.md"
part: "Algebras"
chapter: "Quaternion Algebras"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Algebras", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/index-algebras.md"}
  - {"title": "Quaternion Algebras", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/QuaternionAlgebras/index-quaternion-algebras.md"}
prev: {"title": "Attributes of Orders", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/QuaternionAlgebras/order-attributes.md"}
next: {"title": "Operations with Orders", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/QuaternionAlgebras/order-ops.md"}
intrinsics:
  - {"name": "IsMaximal", "signature": "IsMaximal(O): AlgAssVOrd -> BoolElt"}
  - {"name": "IspMaximal", "signature": "IspMaximal(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt"}
  - {"name": "IspMaximal", "signature": "IspMaximal(O, p): AlgQuatOrd, RngElt -> BoolElt"}
  - {"name": "IsEichler", "signature": "IsEichler(O): AlgAssVOrd -> BoolElt, AlgAssVOrd, AlgAssVOrd"}
  - {"name": "IsEichler", "signature": "IsEichler(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt, AlgAssVOrd, AlgAssVOrd"}
  - {"name": "IsEichler", "signature": "IsEichler(O, p): AlgQuatOrd, RngElt -> BoolElt, AlgQuatOrd, AlgQuatOrd"}
  - {"name": "EichlerInvariant", "signature": "EichlerInvariant(O, p): AlgAssVOrd, RngOrdIdl -> RngIntElt"}
  - {"name": "EichlerInvariant", "signature": "EichlerInvariant(O, p): AlgQuatOrd, RngElt -> RngIntElt"}
  - {"name": "IsHereditary", "signature": "IsHereditary(O): AlgAssVOrd -> BoolElt"}
  - {"name": "IsHereditary", "signature": "IsHereditary(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt"}
  - {"name": "IsHereditary", "signature": "IsHereditary(O, p): AlgQuatOrd, RngElt -> BoolElt"}
  - {"name": "IsGorenstein", "signature": "IsGorenstein(O): AlgAssVOrd -> BoolElt, ."}
  - {"name": "IsGorenstein", "signature": "IsGorenstein(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt, RngIntElt"}
  - {"name": "IsGorenstein", "signature": "IsGorenstein(O, p): AlgQuatOrd, RngElt -> BoolElt, RngIntElt"}
  - {"name": "IsBass", "signature": "IsBass(O): AlgAssVOrd -> BoolElt"}
  - {"name": "IsBass", "signature": "IsBass(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt"}
  - {"name": "IsBass", "signature": "IsBass(O, p): AlgQuatOrd, RngElt -> BoolElt"}
  - {"name": "IsSameType", "signature": "IsSameType(O1, O2): AlgAssVOrd, AlgAssVOrd -> BoolElt"}
---

# Predicates of Orders

Let $O$ be a quaternion order with base ring ${\mathbb{Z}}$, ${\mathbb{F}}_q[X]$ with $q$ odd, or a number ring. Then Magma can test the following predicates.

<a id="function-ismaximal-algassvord"></a>
## `IsMaximal(O): AlgAssVOrd -> BoolElt`

Returns `true` if and only if the order $O$ is maximal.

<a id="function-ispmaximal-algassvord-rngordidl"></a>
## `IspMaximal(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt`

<a id="function-ispmaximal-algquatord-rngelt"></a>
## `IspMaximal(O, p): AlgQuatOrd, RngElt -> BoolElt`

Returns `true` if and only if the order $O$ is maximal at the prime or prime ideal $p$.

<a id="function-iseichler-algassvord"></a>
## `IsEichler(O): AlgAssVOrd -> BoolElt, AlgAssVOrd, AlgAssVOrd`

```magma
MaximalOrders: BoolElt                    Default: false
```

Returns `true` if and only if the order $O$ is *Eichler*, that is an intersection of two (not necessarily distinct) maximal orders. The function calls the `EichlerInvariant` intrinsic explained below.

If the optional argument `MaximalOrders` is set to `true`, the algorithm also returns two maximal orders such that $O$ is their intersection.

<a id="function-iseichler-algassvord-rngordidl"></a>
## `IsEichler(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt, AlgAssVOrd, AlgAssVOrd`

<a id="function-iseichler-algquatord-rngelt"></a>
## `IsEichler(O, p): AlgQuatOrd, RngElt -> BoolElt, AlgQuatOrd, AlgQuatOrd`

```magma
MaximalOrders: BoolElt                    Default: false
```

Returns `true` if and only if the completion of the order $O$ at the prime (ideal) $p$ is *Eichler*.

If the optional argument `MaximalOrders` is set to `true`, the algorithm also returns two $p$-maximal orders such that $O$ is their intersection.

<a id="function-eichlerinvariant-algassvord-rngordidl"></a>
## `EichlerInvariant(O, p): AlgAssVOrd, RngOrdIdl -> RngIntElt`

<a id="function-eichlerinvariant-algquatord-rngelt"></a>
## `EichlerInvariant(O, p): AlgQuatOrd, RngElt -> RngIntElt`

Returns the local Eichler invariant of $O$ at some prime (ideal) $p$ which divides the discriminant of $O$. Let $R$ be the base ring of $O$ and let $J$ be the Jacobson radical of the $R/p$-algebra $O/pO$. If $J$ has dimension $3$ then the Eichler invariant is defined to be $0$. Otherwise the quotient of $O/pO$ by $J$ is either isomorphic to a direct sum of two copies of $R/p$ or a quadratic field extension of $R/p$. In the first case the Eichler invariant is $1$, in the latter it is $-1$.

<a id="function-ishereditary-algassvord"></a>
## `IsHereditary(O): AlgAssVOrd -> BoolElt`

Returns `true` if and only if the order $O$ is a hereditary order in a quaternion algebra $A$. That is, every lattice in $A$ of full rank such that $O$ is contained in its left order is a projective left $O$-module. The hereditary orders are precisely those with squarefree discriminant.

<a id="function-ishereditary-algassvord-rngordidl"></a>
## `IsHereditary(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt`

<a id="function-ishereditary-algquatord-rngelt"></a>
## `IsHereditary(O, p): AlgQuatOrd, RngElt -> BoolElt`

Returns `true` if and only if the completion of the order $O$ at the prime (ideal) $p$ is *hereditary*.

<a id="function-isgorenstein-algassvord"></a>
## `IsGorenstein(O): AlgAssVOrd -> BoolElt, .`

Returns `true` if and only if the order $O$ is a Gorenstein order. That is, the dual of $O$ with respect to the trace bilinear form is a projective $O$-module. The second return value is the Brandt invariant of $O$ as in the [`GorensteinClosure`](https://docs.magma-maths.org/v2.30-1/Algebras/QuaternionAlgebras/order-creation.md#function-algquat-gorensteinclosure) intrinsic.

<a id="function-isgorenstein-algassvord-rngordidl"></a>
## `IsGorenstein(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt, RngIntElt`

<a id="function-isgorenstein-algquatord-rngelt"></a>
## `IsGorenstein(O, p): AlgQuatOrd, RngElt -> BoolElt, RngIntElt`

Returns `true` if and only if the completion of the order $O$ at the prime (ideal) $p$ is *Gorenstein*. The second return value is the valuation of the Brandt invariant of $O$ at $p$.

<a id="function-isbass-algassvord"></a>
## `IsBass(O): AlgAssVOrd -> BoolElt`

Returns `true` if and only if the order $O$ is a Bass order, i.e. every order which contains $O$ is Gorenstein.

<a id="function-isbass-algassvord-rngordidl"></a>
## `IsBass(O, p): AlgAssVOrd, RngOrdIdl -> BoolElt`

<a id="function-isbass-algquatord-rngelt"></a>
## `IsBass(O, p): AlgQuatOrd, RngElt -> BoolElt`

Returns `true` if and only if the completion of the order $O$ at the prime (ideal) $p$ is *Bass*.

<a id="function-issametype-algassvord-algassvord"></a>
## `IsSameType(O1, O2): AlgAssVOrd, AlgAssVOrd -> BoolElt`

Returns `true` if and only if the two quaternion orders $O1$ and $O2$ are of the same *type* which means that they are locally isomorphic. The orders must be over the ring of integers or a number ring.
