mercredi 31 mai 2017

non-Squar random unitary matrix

I want to generate non-Squar random unitary matrix ,and I use following function (randU) , this is a matlab code and I need to do it in python

function U = randU(n);

X = (randn(n) + i*randn(n))/sqrt(2);

[Q,R] = qr(X);

R = diag(diag(R)./abs(diag(R)));

U = Q*R;




Aucun commentaire:

Enregistrer un commentaire