# Solving for a Unitary Matrix

Hello everyone,

I'm trying to replicate nearly the following in Sage: https://mathematica.stackexchange.com...

The linked post is asking for $U$ such that $A = UB\overline{U}^{T}$ but I am looking for the following:

Given 2 lists of vectors say $A =${$a_1, ..., a_n$}, $B =$ {$b_1, ..., b_n$}, is there a way to easily solve for a unitary matrix, $U$, such that {$a_1, ..., a_n$} = {$Ub_1, ..., Ub_n$}.

I understand I can do the following:

U = H.solve_left(W)
U /= U.norm()
U.is_unitary()


but it doesn't seem every efficient, as there may be other solutions that I cannot see using this method. I am new to Sage and any advice would be super helpful!

Thank you

edit retag close merge delete

Are you looking for any one solution or for all solutions?

( 2024-05-05 05:38:56 +0200 )edit

I would be interested to see all possible solutions, but finding one Unitary Matrix satisfying the conditions would be enough for my purposes!

( 2024-05-05 06:07:45 +0200 )edit

Are your "lists of vectors" form orthonormal bases by any chance?

( 2024-05-05 06:43:26 +0200 )edit

Not necessarily, but from my list of vectors I guess I could extract a basis.

( 2024-05-05 06:52:47 +0200 )edit