Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

How to rearrange matrix entries from another matrix entries [closed]

asked 1 year ago

Akhilesh gravatar image

updated 1 year ago

Suppose i have m×m matrix D which is known, i have to re arrange entries of D to a new m×m matrix M such that M_{i,j}=D_{j-i%m, -i%m}. How to do it in SageMath?

Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by Akhilesh
close date 2023-12-14 06:23:18.215781

1 Answer

Sort by » oldest newest most voted
0

answered 1 year ago

rburing gravatar image
sage: D = matrix(QQ, 2, [[1, 2], [3, 4]]); D
[1 2]
[3 4]
sage: m = D.nrows()
sage: M = matrix(QQ, m, lambda i, j: D[(j-i)%m, (-i)%m]); M
[1 3]
[4 2]
Preview: (hide)
link

Comments

It worked. Thanks for the help

Akhilesh gravatar imageAkhilesh ( 1 year ago )

Question Tools

1 follower

Stats

Asked: 1 year ago

Seen: 374 times

Last updated: Dec 11 '23