Matrix product error accumulated during iteration
1 次查看(过去 30 天)
显示 更早的评论
I have a problem when multiplying unitary matrix many times. Initially, a unitary(or symmetric in the following example) matrix is constructed as U. Then I multiply the matrix in an iteractive way and check the unitarity of the results by comparing U*U' with identity. They are close in the first few steps but deviate gradually. Any suggestions to reduce the error and always keep U unitary?
The following is the code.
clear all
M = rand(10);
M=0.5*(M+M');
U = expm(-1i*M);
for t_i = 1:100
U = U*U;
norm = trace(U*U'-eye(10))
end
2 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!