ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 21 Nov 2017 17:01:56 +0100Variable matriceshttps://ask.sagemath.org/question/39687/variable-matrices/If I type
sage: M = matrix(SR, 2, var('a,b,c,d'))
sage: show(~M)
it gives me the inverse of the matrix M with entries in terms of `a`, `b`, `c`, `d`.
Now what I want is to set four variable matrices `A`, `B`, `C`, `D`, each of size 2x2,
and then I want to create the block matrix
sage: N = block_matrix([[A, B], [C, D]])
Finally I want some functions of `N` in terms of `A`, `B`, `C`, `D`.
For example, how can I get `det(N)` in terms of `A`, `B`, `C`, `D`?Tue, 21 Nov 2017 06:01:49 +0100https://ask.sagemath.org/question/39687/variable-matrices/Comment by B r u n o for <p>If I type</p>
<pre><code>sage: M = matrix(SR, 2, var('a,b,c,d'))
sage: show(~M)
</code></pre>
<p>it gives me the inverse of the matrix M with entries in terms of <code>a</code>, <code>b</code>, <code>c</code>, <code>d</code>.</p>
<p>Now what I want is to set four variable matrices <code>A</code>, <code>B</code>, <code>C</code>, <code>D</code>, each of size 2x2,
and then I want to create the block matrix</p>
<pre><code>sage: N = block_matrix([[A, B], [C, D]])
</code></pre>
<p>Finally I want some functions of <code>N</code> in terms of <code>A</code>, <code>B</code>, <code>C</code>, <code>D</code>.</p>
<p>For example, how can I get <code>det(N)</code> in terms of <code>A</code>, <code>B</code>, <code>C</code>, <code>D</code>?</p>
https://ask.sagemath.org/question/39687/variable-matrices/?comment=39700#post-id-39700You want $\det N$ in terms of $\det A$, ..., $\det D$? SageMath is unable to give you this to the best of my knowledge. Note that it is not suprising: There is no such expression in a very general case. Only if some matrix is known to be invertible, or some matrices commute, etc. See on [Wikipedia](https://en.wikipedia.org/wiki/Determinant#Block_matrices).
Now in your case of $2\times 2$ blocks, you may of course define $16$ variables $a_{11}$, ..., $a_{22}$, ..., $d_{22}$ and ask for this $16\times 16$ determinant. Then, you can try to reconstruct some expression based on the four $2\times 2$ determinants. But you'll need to have some assumptions at some point I guess.Tue, 21 Nov 2017 17:01:56 +0100https://ask.sagemath.org/question/39687/variable-matrices/?comment=39700#post-id-39700