Matrix Addition Calculator
Add two matrices by summing their corresponding entries. Matrix addition is defined when both matrices have the same dimensions, producing a new matrix with the same number of rows and columns.
A
B
Learn About Matrix Addition
Definition and Element-Wise Summation
Matrix addition is the operation of combining two matrices of identical dimensions by adding their corresponding entries. If $\mathbf{A} = [a_{ij}]$ and $\mathbf{B} = [b_{ij}]$ are both $m \times n$ matrices, their sum $\mathbf{C} = \mathbf{A} + \mathbf{B}$ is an $m \times n$ matrix whose entries are defined by:
Dimension Conformance Requirement
Matrix addition is defined if and only if both matrices have exactly the same dimensions:
If $\mathbf{A}$ is $2 \times 3$ and $\mathbf{B}$ is $3 \times 2$, addition is undefined. In such cases, the calculator rejects the input and prompts the user to match dimensions.
Fundamental Algebraic Properties
Under standard addition, the set of all real $m \times n$ matrices $\mathbb{R}^{m \times n}$ forms an abelian group:
- Commutativity: $\mathbf{A} + \mathbf{B} = \mathbf{B} + \mathbf{A}$
- Associativity: $(\mathbf{A} + \mathbf{B}) + \mathbf{C} = \mathbf{A} + (\mathbf{B} + \mathbf{C})$
- Additive Identity: There exists a unique zero matrix $\mathbf{0}_{m \times n}$ such that $\mathbf{A} + \mathbf{0} = \mathbf{A}$
- Additive Inverse: For every matrix $\mathbf{A}$, there exists $-\mathbf{A} = [-a_{ij}]$ such that $\mathbf{A} + (-\mathbf{A}) = \mathbf{0}$
- Transpose Distribution: $(\mathbf{A} + \mathbf{B})^T = \mathbf{A}^T + \mathbf{B}^T$
- Trace Linearity: $\operatorname{tr}(\mathbf{A} + \mathbf{B}) = \operatorname{tr}(\mathbf{A}) + \operatorname{tr}(\mathbf{B})$ (for square matrices)
Important Caveat: Non-Additivity of Determinants
Unlike the trace and transpose, the determinant is not linear:
For example, if $\mathbf{A} = \mathbf{I}_2$ and $\mathbf{B} = -\mathbf{I}_2$, then $\det(\mathbf{A}) = 1$ and $\det(\mathbf{B}) = 1$, but $\det(\mathbf{A} + \mathbf{B}) = \det(\mathbf{0}) = 0 \ne 1 + 1$.
Worked Numerical Example
Given matrices $\mathbf{A}$ and $\mathbf{B}$ in $\mathbb{R}^{2 \times 3}$:
Perform element-wise addition:
1. Can I add a scalar number directly to a matrix?
In standard linear algebra, adding a scalar $k$ to a matrix $\mathbf{A}$ (writing $\mathbf{A} + k$) is undefined because scalars and matrices belong to different algebraic structures. However, scalar multiplication $k\mathbf{A}$ or adding a scalar multiple of the identity $\mathbf{A} + k\mathbf{I}$ (used frequently in eigenvalue shifts and regularized regression) are fully defined.
2. Can two matrices with different dimensions ever be added?
No. Classical matrix addition strictly requires matching row and column counts. While some numerical programming environments (like Python NumPy or MATLAB) support "broadcasting" to add a vector to every row of a matrix, formal mathematical linear algebra requires identical dimensions.
3. Does matrix addition preserve matrix symmetry?
Yes. If $\mathbf{A}$ and $\mathbf{B}$ are both symmetric ($\mathbf{A}^T = \mathbf{A}$ and $\mathbf{B}^T = \mathbf{B}$), their sum is also symmetric:
The sum of two upper triangular matrices is also upper triangular, and the sum of two diagonal matrices is diagonal.
1. Matrix Addition and Quantum Superposition
In quantum mechanics, physical quantum states are represented as vectors in a complex Hilbert space, and quantum observables are represented as linear operators (matrices). The element-wise addition of matrices directly models quantum superposition—the foundational principle that physical systems can simultaneously exist in linear combinations of different states until measured.
2. The Vector Space of Matrices
Because matrix addition and scalar multiplication satisfy all eight vector space axioms, the collection of all $m \times n$ matrices $\mathbb{R}^{m \times n}$ is itself an $mn$-dimensional vector space. Any matrix can be uniquely expressed as a linear combination of $mn$ standard basis matrices $\mathbf{E}_{ij}$ (matrices with a single $1$ at position $(i, j)$ and zeros elsewhere).