Determinant of a unitary matrix
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bruno Luong
el 23 de Nov. de 2020
Editada: Bruno Luong
el 25 de Nov. de 2020
Is there any other (better) way to compute the determinant of the unitay matrix beside det (that calls lu factorization)?
>> [U,~]=qr(rand(5)+1i*rand(5))
U =
-0.4354 - 0.1474i -0.2285 - 0.0527i -0.0673 - 0.1461i 0.5989 + 0.0097i 0.3444 - 0.4800i
-0.0104 - 0.3044i -0.1395 - 0.1222i -0.6371 + 0.1020i -0.4880 - 0.2927i 0.3406 - 0.1294i
-0.1929 - 0.4992i -0.0791 - 0.2610i -0.2843 + 0.1059i 0.2578 + 0.0370i -0.6394 + 0.2658i
-0.5246 - 0.3650i 0.4425 + 0.2340i 0.2840 - 0.3511i -0.3396 - 0.1282i -0.0556 - 0.0476i
-0.0303 - 0.0159i -0.6434 - 0.4143i 0.4108 - 0.3052i -0.3370 - 0.0652i -0.1474 - 0.1081i
>> det(U)
ans =
-0.8370 - 0.5472i
It seems not but I could miss some obscure algebra properties.
5 comentarios
Christine Tobler
el 24 de Nov. de 2020
BTW, I'd be interested in why you need to know the determinant of this unitary matrix. If it's computed through QR, do you also need the determinant of the R factor?
Respuesta aceptada
John D'Errico
el 23 de Nov. de 2020
Editada: John D'Errico
el 23 de Nov. de 2020
Gosh. I wonder, if there were really much better ways to compute the determinant, they might have used it? ;-)
There are no special properties you can use, at least none I can think of. You could compute the product of the eigenvalues, but eig should generally be slower than lu.
[U,~]=qr(rand(5)+1i*rand(5));
det(U)
If the matrix is real, then the determinant would be 1. But for the complex case, all you can know is the magnitude of the determinant should be 1. I think that is all you get from the matrix being unitary.
abs(det(U))
timeit(@() det(U))
prod(eig(U))
timeit(@() prod(eig(U)))
And of course, you could use more foolish ways, like decomposing it as an expansion by minors. That would be an exponentially bad idea. Actually, "factorially" might be a better word, as I recall.
But I don't think you can do much better than the lu scheme.
13 comentarios
Paul
el 25 de Nov. de 2020
It's self evident that the sum of the angles is real and that exp(1i*anglething) should have norm 1. But it doesn't always have norm 1 because of numerical inaccuracies. For example:
>> anglething=-3.817809607026706e+00;
>> d=exp(1i*anglething);
>> abs(d)
ans =
9.999999999999999e-01
To force abs(d) == 1 then normalize:
>> d=d/abs(d);
>> abs(d)
ans =
1
That last operation ( /abs(d)) is what I would call "normalization," which was not included in the original formula that started this subthread. I guess we just have different ideas of what normalization means.
Más respuestas (1)
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!