ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 05 Apr 2020 16:31:42 +0200How to find out the difference between M.determinant(), M.det() and det(M)?https://ask.sagemath.org/question/50541/how-to-find-out-the-difference-between-mdeterminant-mdet-and-detm/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!
DorisSun, 05 Apr 2020 11:34:34 +0200https://ask.sagemath.org/question/50541/how-to-find-out-the-difference-between-mdeterminant-mdet-and-detm/Answer by rburing for <p>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</p>
<p>a) where could I search to find the difference?
b) what is the difference, if any?</p>
<p>Many thank!
Doris</p>
https://ask.sagemath.org/question/50541/how-to-find-out-the-difference-between-mdeterminant-mdet-and-detm/?answer=50544#post-id-50544Define 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](http://doc.sagemath.org/html/en/tutorial/tour_coercion.html).Sun, 05 Apr 2020 14:33:35 +0200https://ask.sagemath.org/question/50541/how-to-find-out-the-difference-between-mdeterminant-mdet-and-detm/?answer=50544#post-id-50544Comment by FrédéricC for <p>Define a matrix <code>M</code> and enter into a SageMath session:</p>
<pre><code>sage: M.det??
sage: M.determinant??
sage: det??
</code></pre>
<p>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 <code>QQ</code> and <code>GF(2)</code>. To understand the difference, read about <a href="http://doc.sagemath.org/html/en/tutorial/tour_coercion.html">parents and types in SageMath</a>.</p>
https://ask.sagemath.org/question/50541/how-to-find-out-the-difference-between-mdeterminant-mdet-and-detm/?comment=50546#post-id-50546It'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.Sun, 05 Apr 2020 16:31:42 +0200https://ask.sagemath.org/question/50541/how-to-find-out-the-difference-between-mdeterminant-mdet-and-detm/?comment=50546#post-id-50546