Solve equation efficiently

36 views
Skip to first unread message

chandra chowdhury

unread,
Jul 24, 2019, 11:08:20 AM7/24/19
to sage-s...@googlegroups.com
I have matrices B and C of size (m,n) over integer with m>n. 
I know there is matrix A of size (m,m) such that 
AB=C. How to find A efficiently in Sage?

Kwankyu

unread,
Jul 30, 2019, 12:56:35 AM7/30/19
to sage-support
I guess there is no special way in Sage to solve your kind of problem. Just solve for each row of A. 

John Cremona

unread,
Jul 30, 2019, 7:47:11 AM7/30/19
to SAGE support
On Tue, 30 Jul 2019 at 05:56, Kwankyu <ekwa...@gmail.com> wrote:


On Thursday, July 25, 2019 at 12:08:20 AM UTC+9, chandra chowdhury wrote:
I have matrices B and C of size (m,n) over integer with m>n. 
I know there is matrix A of size (m,m) such that 
AB=C. How to find A efficiently in Sage?

Try B.solve_left(C).  For example:

sage: B = Matrix(2,3,[1,2,3,4,5,6]); B
[1 2 3]
[4 5 6]
sage: A = Matrix(2,2,[1,1,1,2]); A
[1 1]
[1 2]
sage: C = A*B; C
[ 5  7  9]
[ 9 12 15]
sage: B.solve_left(C)
[1 1]
[1 2]
sage: B.solve_left(C) == A
True

 

I guess there is no special way in Sage to solve your kind of problem. Just solve for each row of A. 

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/021a81f6-9ba9-4066-bf30-9dd0796f97e7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages