Ask Your Question

Dima's profile - activity

2019-10-14 06:02:53 -0500 received badge  Nice Answer (source)
2019-10-13 06:11:40 -0500 answered a question Building Sage 8.9 from source fails

To use system's readline on on Ubuntu 16.04, one needs to install libncurses5-dev and libreadline-dev (16.04 has a bug: the former is not a dependency of the latter, even though by right it should be)

As far as building Sage's readline goes, unfortunately we have not figured out yet what exactly goes wrong with building Sage's readline on 16.04. As a workaround, in the file build/pkgs/readline/patches/0002-ltinfo.patch replace the line



+   SHLIB_LIBS='-ltinfo -lncurses'

This shoud give a working readline built by Sage (hopefully)

2019-10-11 12:16:43 -0500 commented answer Building Sage 8.9 from source fails

this is a symptome of underlinking in readline. In its infinite wisdom readline's devs refuse to fix this old bug; it needs to be linked with libtinfo or other suchlike library, and it keeps resufacings in various forms...

2019-09-13 04:14:58 -0500 answered a question SageAppliance not more maintained after 8.1?

OVA is more awkward than the Cygwin build, so that's why it stopped. You might want to try Sage 8.8

Or if you comfortable with VirtualBox (or other VM) on Windows, you may just build Sage there from source.

2019-01-29 12:41:20 -0500 answered a question possible to solve this optimizationproblem with LMI?

Yes, semidefinite optimisation is available in Sage, check out

2018-12-17 23:09:09 -0500 commented answer ImportError: No module named 'sage'

put that one like into a file, and source it every time you want to start anaconda. (Better, make a script that sources this line and starts Anaconda for you).

2018-05-02 17:34:08 -0500 received badge  Nice Answer (source)
2018-03-22 11:19:56 -0500 commented question save/load session in standalone python

In ipython there are special tools for this (I guess they are used in e.g. Jupyter notebook environment to save the state), see e.g.

2018-03-07 06:16:38 -0500 received badge  Nice Answer (source)
2018-03-05 20:40:52 -0500 answered a question Error with is_prime

Thanks. This is the fix (the whole id_label business was a leftover from an old buggy implementation of the modular decomposition, now replaced with this one. Will be fixed in the upcoming release.

diff --git a/src/sage/graphs/ b/src/sage/graphs/ index 617881e4a7..57504aaecd 100644
--- a/src/sage/graphs/
+++ b/src/sage/graphs/
@@ -7180,9 +7180,7 @@ class Graph(GenericGraph):

         D = modular_decomposition(self)

-        id_label = dict(enumerate(self.vertices()))
-        relabel = lambda x : (x.node_type, [relabel(_) for _ in x.children]) if x.node_type !=NodeType.NORMAL else id_label[x.children[0]]
+        relabel = lambda x : (x.node_type, [relabel(_) for _ in x.children]) if x.node_type != NodeType.NORMAL else x.children[0]

          return relabel(D)
2017-11-13 06:08:53 -0500 received badge  Civic Duty (source)
2017-10-05 05:17:08 -0500 commented question Build Error when Uploading Notebooks in Sage

thanks, see for this problem.

2017-08-09 12:20:16 -0500 received badge  Nice Answer (source)
2017-07-18 04:30:22 -0500 commented answer Submatrix of a given matrix by deleting some rows and columns(For my case 2 rows and columns).

Well, but this is a straightforward Python loop to write. In the loop, create two lists, say, ro, co, using range(), remove i-th (resp. j-th) elements from it, call A[ro,co].det()/A[ro,ro].det() to compute the corr. determinant ratio, store it in B.

2017-07-18 02:45:35 -0500 commented question How to obtain the resistance distance matrix of a graph?

I imagine that scipy does not convert the pseudo-inverse exactly. Anyhow, please specify the example of a graph on which you see the problem.

2017-07-18 02:18:34 -0500 commented answer Restricted usability of Singular after upgrade

there is a little 'V' field under the answer score counter on the right, which one ticks to accept the answer. I just did it here.

2017-07-18 02:15:30 -0500 answered a question Submatrix of a given matrix by deleting some rows and columns(For my case 2 rows and columns).

You can create lists of rows and columns and use them to cut out a submatrix. E.g.

 sage: M=matrix([[1,2,3,4],[3,4,5,6],[6,7,8,9]])
 sage: M[[0,2],[0,2]]
 [1 3]
 [6 8]
2017-02-11 12:27:00 -0500 commented answer highest dimension polyhedron

no, not really. See for bounds and examples. E.g. in dimension 13 you might have more than 17000000 facets.

2017-02-09 14:27:16 -0500 answered a question highest dimension polyhedron

this depends on the input quite a bit. Namely, the following factors play a big role:

  • how many facets your polytope $P$ has
  • how big in abs. value the coordinates of your points are (assuming they are all integers)
  • how degenerate $P$ is; i.e. the maximal number of neighbours of a vertex of $P$ --- the more degenerate it is, the slower the facet enumeration)
2017-02-09 14:05:41 -0500 commented answer Restricted usability of Singular after upgrade

Why would you think this is Singular problem? Univariate polynomials are not handled by Singular in Sage, they are handled by either Flint, or NTL, or Givaro (the latter for finite fields only). We need more info to track your issue down. E.g. could you at least tell us the output of type(f) for your polynomial f?

2016-07-28 03:08:22 -0500 commented question second degree irreducible polynomial over extension field

I presume the question is about how to build a quadratic extension of GF(8) explicitly.

2016-07-28 02:08:54 -0500 answered a question Faster function for working with cosets

Here is an example of how to get a list of coset representatives:

sage: g=libgap.AlternatingGroup(5)
sage: h=g.Stabilizer(1)
sage: [x.Representative() for x in g.RightCosets(h)]
[(), (1,5,4), (1,4,5), (1,2,5), (1,3,5)]

Please feel free to ask for more details.

2016-07-26 10:43:19 -0500 commented answer Semimonomial transformation group

I am not 100% sure that you want to start with the permutation group - it might be a proper quotient of the "real" group, and then you need to do something else.

2016-07-26 10:42:10 -0500 answered a question Semimonomial transformation group
 sage: g=libgap.Group(map(lambda s: libgap.PermList(s.get_perm()), Gautgens))

will give you the underlying permutation group. It has 1 orbit in its natural action (on 8 points):

 sage: g.Orbits()
 [ [ 1, 2, 5, 3, 6, 4, 7, 8 ] ]

You can convert it into a matrix group acting on GF(4)^8.

 sage: mg=libgap.Group(map(lambda s: libgap.PermutationMat(s,8,libgap.GF(4)), g.GeneratorsOfGroup()))

Now you can compute orbits on vectors (see e.g. code in graphs/generators/ for details); however, you might want to make sure that GAP's GF(4) is created in a compatible way.

2016-07-20 04:09:29 -0500 received badge  Good Answer (source)
2016-04-04 13:23:39 -0500 commented question osx installation

sounds like you've changed the default OS configuration, as on OSX the system python is still python2, and this means that you won't see any missing brackets in print, normally speaking. What is that extra hack that you have on? Homebrew? Anaconda? Something else?

2015-11-03 08:56:21 -0500 commented answer After upgrade to 6.9 we obtain SIGILL ...

I take this as you have an upgraded Mac, right? And which version of OSX? (IMHO it's a non-standard config anyway, and you'd be best off building from source.)

2015-05-12 11:10:03 -0500 answered a question public.pem File Not Created in OSX Lion
2015-04-16 01:58:08 -0500 received badge  Nice Answer (source)
2015-04-13 05:48:54 -0500 answered a question Matrix dot multiplication slowness and BLAS versions

numpy in Sage uses Atlas for matrix operations; if you use a binary Sage installation then Atlas might be not optimised for your hardware. To get good Atlas performance, the best is to build Sage from source.

2015-02-10 03:23:06 -0500 answered a question System of 3 equations in 3 variables with symbolic coefficients

I very much doubt that there are closed form solutions for such a system. It looks like this would imply that univariate polynomial equations of arbitrary degrees have a closed form solution, which is well-known not to be the case.

2015-02-06 11:31:52 -0500 answered a question Build command for LaTeX project

as a last resort, open the terminal, run latex or pdflatex there...

2015-02-05 03:25:27 -0500 commented question Browser needed

I guess no, that's good as it is.

2015-02-04 14:11:50 -0500 commented answer Multi-user environment

yes, Control-C is good. One can also run 'sage -n' --- this immediately opens the notebook.`

2015-02-04 07:23:22 -0500 commented answer Multi-user environment

in case you might like to know where the notebook files are: they are in ~/.sage/ for the account Sage (nb) is executed from.Thus each user in this configuration will have completely own set of notebooks.

2015-02-03 03:41:43 -0500 commented answer Multi-user environment

a regular Linux user's notebook() will be run in his/her Linux account. They will be admin for this notebook server, by default (unless they specify another user in notebook() call, or log in via the browser to another, suitably created, nb account).

2015-02-03 03:33:11 -0500 commented answer Multi-user environment

In the latter case you don't even need Sage nb users to have Linux accounts on the server, but watch out for security settings in this case...

2015-02-03 03:31:14 -0500 commented answer Multi-user environment

There are two things you can do - either let each user on the machine to run Sage separately, just by running /usr/tmp/sage/sage-6.4.1/sage, or you run a "public" Sage nb server. In the latter setup accounts on the (Linux) server have nothing to do with accounts on the Sage nb server.

2015-02-01 12:59:55 -0500 commented question Multi-user environment

have you installed it systemwide, or in your own account?

2015-02-01 03:10:56 -0500 answered a question How do I register so I can use the Sage Notebooks

You don't have to "register" for this. You just have to set up a password. Try starting notebook from Sage prompt as follows


This should allow you to choose a new password for the admin user (admin is the user id for the sage notebook that already exists).

2015-01-23 15:36:35 -0500 commented answer Cannot install Cremona database

as you see, "Use 100%" means "no room left"... I'd let it be 30-50GB instead of 6.8GB. Regarding the resizing, there is plenty of info on the net, e.g.

2015-01-22 02:59:21 -0500 commented answer Cannot install Cremona database

to see how much space you have in VM, please run, in VM's terminal, the command
df -h

2015-01-19 15:42:49 -0500 commented question Is there a bug with using chromatic_number together with Gurobi?

to reproduce this, it would be good to know precisely on what G it hangs, and also your Gurobi and Sage versions...

2015-01-02 07:26:36 -0500 commented question Jmol applet in Sage 6.3 cannot load

how about the latest stable version of Sage, 6.4.1?

2014-12-23 08:48:11 -0500 answered a question PYCURL ERROR 7 trying to install pdflatex

Sorry, but this is certainly not Sage-specific problem, rather it is a CentOS-specific weirdness If you google this error, you'll see plenty of discussions about it; apparently it's about ip6.

2014-12-15 10:56:03 -0500 received badge  Nice Answer (source)
2014-12-13 19:41:43 -0500 commented answer no method available for opening http localhost 8000 (second part)

probably - although perhaps the VM Sage image has it differently. One can see the port number if you start sage in terminal and do 'notebook()' at sage prompt. It will tell you which URL to open in browser.