Ask Your Question
1

How to find out the difference between M.determinant(), M.det() and det(M)?

asked 2020-04-05 11:34:34 +0100

dantetante gravatar image

I am quite new to sagemath, but an experienced mathematician ... so I tried computing determinants for a given Matrix M and found different solutions. I found that M.det() is short for M.determinant() after searching the index and going further from there. But I did not find something for the syntax det(M). Inspire of being not a programmer, I am interested in

a) where could I search to find the difference? b) what is the difference, if any?

Many thank! Doris

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2020-04-05 14:33:35 +0100

rburing gravatar image

Define a matrix M and enter into a SageMath session:

sage: M.det??
sage: M.determinant??
sage: det??

This will show the source code of the respective methods and functions. In particular, you will easily see who is an alias of who. Also try matrices with different base fields, such as QQ and GF(2). To understand the difference, read about parents and types in SageMath.

edit flag offensive delete link more

Comments

1

It's more "pythonic" to use methods of objects. The function "det" is just here to help people that are more used to other symbolic software.

FrédéricC gravatar imageFrédéricC ( 2020-04-05 16:31:42 +0100 )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

Stats

Asked: 2020-04-05 11:34:34 +0100

Seen: 1,018 times

Last updated: Apr 05 '20