Search for a tool
Matrix Direct Sum

Tool to calculate the direct sums of matrices (formal computation). The matrix direct sum calculates the sum of N matrices that can be of different sizes.

Results

Matrix Direct Sum -

Tag(s) : Matrix

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Matrix Direct Sum' tool for free! Thank you!

Matrix Direct Sum

Direct Sum of 2 Matrices


Loading...
(if this message do not disappear, try to refresh this page)

Loading...
(if this message do not disappear, try to refresh this page)

Answers to Questions (FAQ)

How to add 2 matrices with direct sum?

Given $ M_1=[a_{ij}] $ a matrix of $ m $ lines and $ n $ columns and $ M_2=[b_{ij}] $ a matrix of $ p $ lines and $ q $ columns (2x2, 2x3, 3x2, 3x3, etc).

The direct sum of these 2 matrices is noted with the character (circled plus sign) $ M_1 \oplus M_2 $ and is a matrix of $ m+p $ lines and $ n+q $ columns.

$$ A \oplus B = \begin{bmatrix} [a_{ij}] & [0] \\ [0] & [b_{ij}] \end{bmatrix} $$

Example: $$ \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix} \oplus \begin{bmatrix} 7 & 8 \\ 9 & 10 \end{bmatrix} = \begin{bmatrix} 1 & 2 & 3 & 0 & 0 \\ 4 & 5 & 6 & 0 & 0 \\ 0 & 0 & 0 & 7 & 8 \\ 0 & 0 & 0 & 9 & 10 \end{bmatrix} $$

Practically, the matrix addition by direct sum does not require any calculation, it only consist in copying the matrices diagonally, into a larger one, and fill with zeros.

The direct sum operation must be distinguished from the conventional operation of matrix addition, although it may take different size matrices, the result is not at all identical.

How to add N matrices with direct sum?

The direct addition is generalizable to N matrices, but the order matter.

$$ A \oplus B \oplus C = ( A \oplus B ) \oplus C \neq A \oplus ( B \oplus C ) $$

Source code

dCode retains ownership of the "Matrix Direct Sum" source code. Any algorithm for the "Matrix Direct Sum" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Matrix Direct Sum" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Matrix Direct Sum" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Matrix Direct Sum" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/matrix-direct-sum
In a scientific article or book, the recommended bibliographic citation is: Matrix Direct Sum on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/matrix-direct-sum

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Matrix Direct Sum' tool for free! Thank you!


https://www.dcode.fr/matrix-direct-sum
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback