How to find a permutation matrix to turn a general hermitian matrix into a block diagonal one?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Huiyuan ZHENG
el 24 de Abr. de 2022
Comentada: Huiyuan ZHENG
el 30 de Jun. de 2022
If I have a hermitian matrix which satisfies H' = H, say H
H = [1, 0, -1i;
0, 1, 0;
1i, 0, 1],
is there a function to find a permutation matrix P so that
P'HP = [1, 0, 0;
0, 1, -1i;
0, 1i, 1]
a block diagonal one.
0 comentarios
Respuesta aceptada
Christine Tobler
el 18 de Mayo de 2022
First, we should keep in mind that the task is really to find a representation of A with as small blocks on the diagonal as possible. After all, we can always treat a matrix as block diagonal with one big block that's just the whole matrix.
One way you can think about this is to treat the matrix as an undirected graph: if A(i, j) is non-zero, there is an edge connecting node i and node j. We can then get the connected components of this graph (two nodes are in the same component only if there is a path connecting them). The nodes in each connected components represent the rows / columns of one diagonal block:
H = [1, 0, -1i;
0, 1, 0;
1i, 0, 1];
g = graph(H ~= 0);
plot(g)
nodeToComponent = conncomp(g) % nodeToComponent(i) gives component number of node i
Why is there this mapping? If we try to split up a connected component into smaller blocks, this isn't possible because there is always an edge connecting a node in proposed new component A with another node in proposed new component B. In terms of diagonal blocks, that would mean that H(i, j) ~=0 for i in proposed diagonal block A and j in proposed diagonal block B - so this couldn't be seen as a diagonal block.
You can get a permutation vector from
[nodeToComponentSorted, p] = sort(nodeToComponent)
H(p, p)
Más respuestas (1)
Bruno Luong
el 24 de Abr. de 2022
A = [1, 0, 1;
0, 1, 0;
1, 0, 1],
p=symrcm(A)
A(p,p)
3 comentarios
Bruno Luong
el 25 de Abr. de 2022
Editada: Bruno Luong
el 25 de Abr. de 2022
Your question is still not clear.
H is already block diagonal: a single block.
What is you criteria ? When I apply symrcm on you new small example of H, to me it is still fine:
H = [1, 0, -1i;
0, 1, 0;
1i, 0, 1];
p=symrcm(H);
Hp=H(p,p)
Hp-Hp' % still Hermitian?
% The below result shows that Hp have 2 Blocks: (2x2) and (1x1)
real(Hp)
imag(Hp)
Ver también
Categorías
Más información sobre Sparse Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!