power of a matrix calculator

Power of a Matrix Calculator

Use spaces or commas between numbers. Matrix must be square (n × n).
Supports positive, zero, and negative integers. Negative powers require an invertible matrix.

Computing matrix powers is a core operation in linear algebra, numerical methods, control theory, graph theory, and machine learning. This calculator lets you quickly evaluate An for a square matrix A and an integer exponent n.

How to use this calculator

1) Enter a square matrix

Type your matrix with one row per line (or separate rows using semicolons). Within a row, separate values with spaces or commas.

  • Valid: 1 2 3 on one line and 4 5 6 on next lines
  • Valid: 1,2;3,4
  • Invalid: rows with different column counts

2) Enter an integer exponent

You can use any integer:

  • n > 0: repeated multiplication of A
  • n = 0: identity matrix I
  • n < 0: inverse power, i.e., An = (A-1)|n|

What does “power of a matrix” mean?

If A is a square matrix, then A2 = A·A, A3 = A·A·A, and so on. Matrix multiplication is not like scalar multiplication: order matters and dimensions must match. That is why powers are only defined cleanly for square matrices.

Why matrix powers matter

Markov chains

Transition matrices raised to a power model multi-step probabilities. If P is a transition matrix, then Pk gives state-transition probabilities after k steps.

Graph theory

For an adjacency matrix G, the entry (i,j) in Gk can count the number of walks of length k from node i to node j.

Linear recurrences and dynamical systems

Many systems can be written as xt+1 = A xt. Then xt = At x0, so fast matrix exponentiation directly speeds up simulation.

How this calculator computes fast

Instead of multiplying A by itself n times in a simple loop, this tool uses exponentiation by squaring. That reduces the number of multiplications from O(n) to O(log n), which is dramatically faster for large exponents.

  • If n is even: An = (A2)n/2
  • If n is odd: An = A · An-1
  • For n < 0: compute inverse first, then raise to |n|

Common input mistakes (and fixes)

  • Non-square matrix → Ensure same number of rows and columns.
  • Mixed row lengths → Every row must have the same count of values.
  • Negative exponent on singular matrix → Matrix must be invertible for n < 0.
  • Non-integer exponent → Enter whole numbers only.

Quick example

Try this matrix:

  • A = [[1, 1], [1, 0]]
  • n = 5

You should get: A5 = [[8, 5], [5, 3]] which is tied to Fibonacci relationships.

Final thoughts

A reliable matrix exponent calculator is a practical tool for students, analysts, engineers, and data scientists. Use it to check homework, validate code, model transitions, or explore linear systems quickly and accurately.

🔗 Related Calculators