about Unitary matrices

53 views
Skip to first unread message

g host

unread,
Jun 12, 2025, 12:34:55 AMJun 12
to Manopt
How can I obtain a complex matrix through manifold optimization that satisfies being a unitary matrix and a symmetric matrix?

Nicolas Boumal

unread,
Jun 12, 2025, 11:14:52 AMJun 12
to Manopt
I imagine you meant Hermitian (as opposed to symmetric). If so, then the code below would do:

clear; clc;
n = 2;
problem.M = unitaryfactory(n);
sqfrobnorm = @(M) real(M(:)'*M(:));
problem.cost = @(X) sqfrobnorm(X-X');
problem = manoptAD(problem);
X0 = problem.M.rand();
X = trustregions(problem, X0);
disp(X);
disp(norm(X-X', 'fro'));
disp(norm(X*X' - eye(n), 'fro'));

If you did mean symmetric, then you can change the cost function to be:

sqfrobnorm(X-X.'); % notice the added "."

g host

unread,
Jun 12, 2025, 11:20:03 PMJun 12
to Manopt
1749784447364.png
This is my optimization problem, my objective function is a convex function, here is the code I used with manopt, which is a bit different from yours.
Matlab:
manifold = unitaryfactory(N); 
problem.M = manifold;
symmetrize = @(X) 0.5 * (X + X.');

problem.cost = @(Theta) full_objective(Theta, G_r, g0, G_d, www, ...
    a_k, b_k, B1, lambda1, lambda2, gamma_qos, sigma_0);

problem.egrad = @(Theta) egrad_function(Theta, G_r, g0, G_d, www, ...
    a_k, b_k, B1, lambda1, lambda2, gamma_qos, sigma_0);

problem.M.retr = @(Theta, U, t) symmetrize(manifold.retr(Theta, U, t));
Theta0_sym = symmetrize(manifold.rand());

[Theta, cost_opt, info] = conjugategradient(problem, Theta0_sym, options);
unitary_error = norm(Theta * Theta' - eye(N), 'fro');
symmetry_error = norm(Theta - Theta.', 'fro');

Reply all
Reply to author
Forward
0 new messages