# Type for square matrix

**URL:** <https://discourse.julialang.org/t/type-for-square-matrix/12027>\
**Category:** Numerics\
**Tags:** proposal\
**Created:** [June 28, 2018, 8:58am UTC](https://discourse.julialang.org/t/type-for-square-matrix/12027 "2018-06-28T08:58:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 28, 2018, 8:58am UTC](https://discourse.julialang.org/t/type-for-square-matrix/12027/1 "2018-06-28T08:58:55Z")

</div>

I am wondering if it would make sense to have an abstract type for `<: AbstractMatrix` types which are _by construction_ square, eg

```julia
abstract type SquareMatrix{T} <: AbstractMatrix{T} end

```

Subtypes would be `Diagonal`, various `*Triangular`, `Symmetric` and `Hermitian`, etc.

Not being a subtype would of course not imply that something is _not_ square, just that it cannot be determined from the type alone.

(_opening discussion before making an issue_)

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreasnoack/32/27_2.png) [@andreasnoack](https://discourse.julialang.org/u/andreasnoack)\
**Post date:** [June 28, 2018, 9:08am UTC](https://discourse.julialang.org/t/type-for-square-matrix/12027/2 "2018-06-28T09:08:42Z")

</div>

Possibly. Which methods would use this type?
