RalfZimmermannSDU / RiemannStiefelLog

Algorithms for computing the Riemannian logarithm map on the Stiefel manifold
5 stars 1 forks source link

How to calculate Log_[[1,0,0],[0,1,0]] ([[0,1,0],[1,0,0]])? Is it a Bug? #2

Open TianyuRuan opened 2 months ago

TianyuRuan commented 2 months ago

Thank you for sharing your code!

I've run your test code in Stiefel_log_general_metric/SciPy, and everything ran smoothly without any issues.

However, I encountered an error when running the following code: U0 = np.array([[1,0,0],[0,1,0]]).T U1 = np.array([[0,1,0],[1,0,0]]).T Delta_rec, conv_hist = StEL.Stiefel_Log(U0, U1, tau, alpha);

Error: negativ eigval on real axis Error: negativ eigval on real axis

Is it a bug or something?

RalfZimmermannSDU commented 2 months ago

Dear Tianyu,

Thanks for your interest in this work. It's not a bug but a special situation for the logarithm map. In a sense, the data you created is the Stiefel counterpart to antipodal points on a sphere. The logarithm map is not mathematically well-defined in this case. The algorithm tries to compute the principal matrix logarithm of a matrix with eigenvalue -1. Again, that is not well-defined.

One could also say that the data that you created is not inside of the injectivity radius.

Best regards, Ralf

-- Ralf Zimmermann Associate Professor of Applied Mathematics Department of Mathematics and Computer Science Phone: +45 6550 4766 University of Southern Denmark Campusvej 55 DK-5230 Odense M www.sdu.dkhttps://groupware.tu-braunschweig.de/Redirect/2A3BAE80/www.sdu.dk/

From: TianyuRuan @.> Sent: 16. juli 2024 12:00 To: RalfZimmermannSDU/RiemannStiefelLog @.> Cc: Subscribed @.***> Subject: [RalfZimmermannSDU/RiemannStiefelLog] How to calculate Log_[[1,0,0],[0,1,0]] ([[0,1,0],[1,0,0]])? Is it a Bug? (Issue #2)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

Thank you for sharing your code!

I've run your test code in Stiefel_log_general_metric/SciPy, and everything ran smoothly without any issues.

However, I encountered an error when running the following code: U0 = np.array([[1,0,0],[0,1,0]]).T U1 = np.array([[0,1,0],[1,0,0]]).T Delta_rec, conv_hist = StEL.Stiefel_Log(U0, U1, tau, alpha);

Error: negativ eigval on real axis Error: negativ eigval on real axis

Is it a bug or something?

- Reply to this email directly, view it on GitHubhttps://github.com/RalfZimmermannSDU/RiemannStiefelLog/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATGM34Z4TDJ2VD7PVNUTAZLZMTVKVAVCNFSM6AAAAABK6HQXE6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTANZTGI2TSNI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

TianyuRuan commented 2 months ago

Dear Tianyu, Thanks for your interest in this work. It's not a bug but a special situation for the logarithm map. In a sense, the data you created is the Stiefel counterpart to antipodal points on a sphere. The logarithm map is not mathematically well-defined in this case. The algorithm tries to compute the principal matrix logarithm of a matrix with eigenvalue -1. Again, that is not well-defined. One could also say that the data that you created is not inside of the injectivity radius. Best regards, Ralf -- Ralf Zimmermann Associate Professor of Applied Mathematics Department of Mathematics and Computer Science Phone: +45 6550 4766 University of Southern Denmark Campusvej 55 DK-5230 Odense M www.sdu.dk<https://groupware.tu-braunschweig.de/Redirect/2A3BAE80/www.sdu.dk/> From: TianyuRuan @.> Sent: 16. juli 2024 12:00 To: RalfZimmermannSDU/RiemannStiefelLog @.> Cc: Subscribed @.> Subject: [RalfZimmermannSDU/RiemannStiefelLog] How to calculate Log_[[1,0,0],[0,1,0]] ([[0,1,0],[1,0,0]])? Is it a Bug? (Issue #2) You don't often get email from @. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification Thank you for sharing your code! I've run your test code in Stiefel_log_general_metric/SciPy, and everything ran smoothly without any issues. However, I encountered an error when running the following code: U0 = np.array([[1,0,0],[0,1,0]]).T U1 = np.array([[0,1,0],[1,0,0]]).T Delta_rec, conv_hist = StEL.Stiefel_Log(U0, U1, tau, alpha); Error: negativ eigval on real axis Error: negativ eigval on real axis Is it a bug or something? - Reply to this email directly, view it on GitHub<#2>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATGM34Z4TDJ2VD7PVNUTAZLZMTVKVAVCNFSM6AAAAABK6HQXE6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTANZTGI2TSNI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Dear Ralf,

Got it! Thank you for your helpful response!

Have a great day. Tianyu