# Transpose of a matrix (transpose)

Transpose of a matrix: its rows become its columns.

## How to write it

### transpose(matrix)

**matrix**

A matrix, written as a list of rows. Takes a matrix, written as a list of rows.

## Examples

- $\displaystyle \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}^{\top} = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}$

  `transpose([[1, 2, 3], [4, 5, 6]])`

  In the solver, `transpose([[1, 2, 3], [4, 5, 6]])` gives `[[1, 4], [2, 5], [3, 6]]`.

  [Open in the solver](https://hilberon.com/?q=transpose%28%5B%5B1%2C%202%2C%203%5D%2C%20%5B4%2C%205%2C%206%5D%5D%29)

## Related functions

- [upper_triangularize](https://hilberon.com/library/upper_triangularize)

  A matrix with the entries below the diagonal set to zero.
- [trace](https://hilberon.com/library/trace)

  Trace of a square matrix: the sum of its diagonal.
- [adjugate](https://hilberon.com/library/adjugate)

  Adjugate of a square matrix: the transpose of its cofactors.
- [tensor_product](https://hilberon.com/library/tensor_product)

  Tensor product of two lists or matrices.
- [characteristic_polynomial](https://hilberon.com/library/characteristic_polynomial)

  Characteristic polynomial of a square matrix in a variable.
- [smith_decomposition](https://hilberon.com/library/smith_decomposition)

  Smith normal form of an integer matrix, with the two matrices that reach it.

---
Source: https://hilberon.com/library/transpose
