Ask Your Question
0

random matrix with determinant +- 1

asked 2018-01-31 22:15:26 -0600

Daniel L gravatar image

I want to generate a random 4x4 matrix with integer entries and determinant either 1 or -1. I know that you can use

random_matrix(ZZ,4,4, algorithm = 'unimodular')

to generate matrices with determinant 1 (so in the special linear group). However, I'm actually more interested in the matrices with determinant -1.

Is there a 'Sage' way to do this? Or are there other functions/routines out there I should look at?

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-01-31 22:25:57 -0600

dan_fulea gravatar image

Exchanging the first two columns of a random unimodular matrix...

edit flag offensive delete link more

Comments

Right, that should work!...I'll let you know...

Daniel L gravatar imageDaniel L ( 2018-01-31 23:27:00 -0600 )edit

This works. Nice simple solution. Thanks Dan.

Daniel L gravatar imageDaniel L ( 2018-02-01 09:25:51 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-01-31 22:15:26 -0600

Seen: 171 times

Last updated: Jan 31