How to generate a random complex unitary matrix whose columns each sum up to 1

52 ビュー (過去 30 日間)
Hello everyone,
basically the problem is exactly what is stated in the title. I want to create an unitary (2D) matrix of random complex numbers, such that the elements of each column of this matrix sum up to exactly 1. Is there any way to do this? As long as it's still reasonable, computation speed and/or memory usage are not that important.
Thank you to everyone trying to help!

採用された回答

David Goodmanson
David Goodmanson 2020 年 11 月 22 日
編集済み: David Goodmanson 2020 年 12 月 4 日
MODIFIED to replace previous random function
Hi Michael,
here is one way. It's based on the idea that if the unitary matrix U is nxn, and onz = [1 1 1 1 1 1... ] (length n), then the sum-of-each-column condition is
[1 1 1 1 1 1... ]*U = [1 1 1 1 1 1... ]
so
n = 5;
onz = ones(1,n);
onzc = onz'; % column vector
na = null(onzc');
% construct an (n-1)x(n-1) unitary matrix by employing random numbers
% uniformly distributed on {-1, 1} x {-i, i}
h = 2*(rand(n-1,n-1) + i*rand(n-1,n-1)) -(1+i);
% method 1
[u, ~] = qr(h);
% method 2 (slower)
% [u, ~] = eig(h+h');
% construct the result
U = na*u*na' + (1/n)*onzc*onzc';
% checks, all of these should be small
U'*U -eye(size(U))
U*U' -eye(size(U))
onz*U - onz
onz*U' - onz % U' works too
  17 件のコメント
Bruno Luong
Bruno Luong 2020 年 12 月 5 日
Yes I was wrong on the plateau value of qr since I though the RAND/RANDN do not have the effect, so I run my RandUnitary code and the only thing that add is phase shuffle.
Indeed the drop of plateau value is due to RAND as we both observe now. I knew RAND is not a good input at least for QR.
I'm still stumped that EIG can be somewhat pass few uniformity tests when using with RAND. I admit that I still don't fully understand it.
David Goodmanson
David Goodmanson 2020 年 12 月 5 日
nor do I.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by