I have a code to create a random unitary matrix. However is it possible to get an unitary matrix in which the absolute value of each element is one ?
clear all
close all
%define a random matrix
R=randn(512,512)+1i*randn(512,512);
[U V]=svd(R); %performing SVD
% T=exp(1i*rand(512,512));
T=U; %required unitary matrix
For all $z \in \mathbb C - \{0\}$:
$|\frac{z}{|z|}| = 1$
Divide each entry by its modulus.