Ask Your Question

giliev's profile - activity

2021-02-02 22:25:41 +0100 received badge  Good Question (source)
2018-04-20 17:20:42 +0100 received badge  Famous Question (source)
2017-01-03 21:43:25 +0100 received badge  Famous Question (source)
2016-12-02 22:33:12 +0100 received badge  Notable Question (source)
2016-07-07 20:12:34 +0100 received badge  Popular Question (source)
2016-05-24 14:54:15 +0100 received badge  Popular Question (source)
2016-05-24 14:54:15 +0100 received badge  Notable Question (source)
2016-01-12 20:01:41 +0100 received badge  Nice Question (source)
2016-01-10 16:02:14 +0100 asked a question Solving system of linear equations over GF(2)

I tried solving system of equations using Matrix's solve_right(x) method. However, I want to check if the solution is unique. How can I achieve this? For a square matrix I do it by checking if A.determinant() != 0 (where A is the coefficients matrix). Is there some built in function to test uniqueness of matrix equation solution? I would like to return the solution if it is unique and show a message if there is no solution, or multiple solutions exist.

Thank you in advance!

2016-01-09 22:44:19 +0100 received badge  Scholar (source)
2016-01-09 22:44:17 +0100 commented answer Running Sage inside Python

OK, I am trying now to run it from PyCharm and to configure PyCharm to accept the Sage packets and not give me warnings. If you have any suggestion for good IDE they are very welcome :) However, this is out of the scope of this site and your answer explained me several misunderstandings. Thanks! :)

2016-01-09 20:30:39 +0100 commented answer Running Sage inside Python

My Ubuntu has Python 2.7, is that the issue? I saw somewhere that Sage uses Python 2.6. I have tried your suggestion, by writing .sage file and compiling it as sage "sage file_name.sage" and it works. But then I wanted to rename all my existing .py files into .sage files and I got issues with importing packages I have written. And if I cannot import my packages I do not see how can I separate my logic in separate files. I would like to keep writing native python code and only call Sage occasionally. I am working in PyCharm which gives me auto complete suggestions, which is of great help for writing Python code, but not Sage code.

Thank you for the suggestion!

2016-01-09 20:24:54 +0100 commented question Running Sage inside Python

I did not use the right words. By writing $PATH I wanted to show how my PATH looks like.

2016-01-09 19:55:26 +0100 commented question Running Sage inside Python

I updated the question. When I run "sudo sage" I start Sage and can run commands. I tried basic arithmetic and it works fine.

2016-01-09 19:54:01 +0100 received badge  Editor (source)
2016-01-09 19:46:54 +0100 received badge  Student (source)
2016-01-09 19:41:14 +0100 asked a question Running Sage inside Python

I was following a tutorial. I tried to run this code, but got sage is not recognized error. I am using Ubuntu (Mint). I added the sage root to my path. Now when I print $PATH in the terminal there is the sage path indeed. However, my script still does not recognize the Sage package. What may I be doing wrong? If any additional info is needed I will add it.

Here is the output of running $PATH:

bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/goran/Sage/sage-6.9-x86_64-Linux/sage

I am wondering what my header should look like (of the Python script). In the given example it is

#!/usr/bin/env sage.

I have been trying to adapt some other answers but none worked for me. What I want to achieve is calling Sage in Python code, because I have already written a couple of Python modules, and no I just need to call some Sage functions.

Thank you for the understanding!