Ask Your Question

Dima's profile - activity

2022-12-07 00:20:50 +0200 answered a question plotting ill-conditionned function

I guess plot tries to smoothen the graph, doing an interpolation, or a spline, something that needs a numerical derivati

2022-09-30 10:02:12 +0200 received badge  Nice Answer (source)
2022-09-28 18:15:58 +0200 commented answer Determinants over cyclotomic fields are broken?

I posted a branch which apparently fixes the problem, but I don't really know why.

2022-09-28 15:23:57 +0200 edited answer Determinants over cyclotomic fields are broken?

That's a bug, indeed. I opened https://trac.sagemath.org/ticket/34597 for matrices over cyclotomics a multi-modal algor

2022-09-28 14:39:43 +0200 answered a question Determinants over cyclotomic fields are broken?

That's a bug, indeed. I opened https://trac.sagemath.org/ticket/34597

2022-04-25 13:17:39 +0200 answered a question Error in the sage online cell related to GAP

nothing to do with sagecell, it can be reproduced in Sage: gap.eval('LoadPackage("qpa");Q:=Quiver(3,[[1,2,"a"],[2,3,"b

2022-01-18 22:53:22 +0200 received badge  Nice Answer (source)
2021-03-24 12:35:38 +0200 commented question How to load .sobj files into Jupyter Notebook

Does this work in terminal? (i.e. at sage: prompt)

2021-02-17 13:36:15 +0200 commented answer Sagemath 9.2 Product function Bug

this is an oldish bug, same happens with almost 3 years old https://github.com/pynac/pynac/releas...

2020-06-09 13:38:43 +0200 commented question Toric Ideal of Point Configuration Yielding Whole Ring?
2020-06-09 12:54:24 +0200 commented question Toric Ideal of Point Configuration Yielding Whole Ring?

with the notation of the answer by @rburing, you probably need

sage: IA._naive_ideal(IA.ring()).groebner_basis()
[z0*z1*z6 - z5, z1*z3 - 1, z3^2 - z0*z5, z0*z4 - z3, z3*z4 - z5, z4^2 - z1*z6, z1*z5 - z4, z3*z5 - z0*z6, z4*z5 - z6, z5^2 - z3*z6, z2 - 1]

the difference with the Macaulay2 answer is probably due to a different monomial order used. (In Sage computation it's the default order used).

Unfortunately our Macaulay2 insterface is brokek atm: https://doc.sagemath.org/html/en/refe...

2020-06-09 12:33:47 +0200 commented answer Toric Ideal of Point Configuration Yielding Whole Ring?

That 'neglex' order (a local order, not a proper Groebner basis order) looks out of place there. Without it, the saturations of the naive ideal with x_i are already done, so the answer shoud be the same as the naive ideal.

2020-01-17 01:16:10 +0200 received badge  Nice Answer (source)
2020-01-14 17:52:50 +0200 commented answer Orbits on group actions acting on sets

I've edited the answer to indicate this.

2020-01-14 17:52:23 +0200 edited answer Orbits on group actions acting on sets

In a way, everything which is possible in GAP is also possible in Sage, as Sage starts up a GAP subprocess and communicates with it. So you need not have Sage bindings for every GAP function. E.g. you can do

sage: g=SymmetricGroup(7)  
sage: gap("Orbits("+str(g._gap_())+","+str(tuples([1..7],2))+",OnTuples)")
[ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ], [ 4, 4 ], [ 5, 5 ], [ 6, 6 ], [ 7, 7 ] ], 
[ [ 1, 2 ], [ 2, 3 ], [ 2, 1 ], [ 3, 4 ], [ 1, 3 ], [ 3, 2 ], [ 4, 5 ], 
  [ 2, 4 ], [ 4, 3 ], [ 3, 1 ], [ 5, 6 ], [ 3, 5 ], [ 1, 4 ], [ 5, 4 ], 
  [ 4, 2 ], [ 6, 7 ], [ 4, 6 ], [ 2, 5 ], [ 6, 5 ], [ 5, 3 ], [ 4, 1 ], 
  [ 7, 1 ], [ 5, 7 ], [ 3, 6 ], [ 1, 5 ], [ 7, 6 ], [ 6, 4 ], [ 5, 2 ], 
  [ 7, 2 ], [ 6, 1 ], [ 4, 7 ], [ 2, 6 ], [ 1, 7 ], [ 7, 5 ], [ 6, 3 ], 
  [ 5, 1 ], [ 6, 2 ], [ 3, 7 ], [ 1, 6 ], [ 2, 7 ], [ 7, 4 ], [ 7, 3 ] ] ]

Nowadays (Sage version 8.6 or newer) one can do

sage: g=libgap.SymmetricGroup(7)
sage: g.Orbits(tuples([1..7],2),libgap.OnTuples)
[ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ], [ 4, 4 ], [ 5, 5 ], [ 6, 6 ], [ 7, 7 ] ], [ [ 1, 2 ], [ 2, 3 ], [ 2, 1 ], [ 3, 4 ], [ 1, 3 ], [ 3, 2 ], [ 4, 5 ], [ 2, 4 ], [ 4, 3 ], [ 3, 1 ], [ 5, 6 ], [ 3, 5 ], [ 1, 4 ], [ 5, 4 ], [ 4, 2 ], [ 6, 7 ], [ 4, 6 ], [ 2, 5 ], [ 6, 5 ], [ 5, 3 ], [ 4, 1 ], [ 7, 1 ], [ 5, 7 ], [ 3, 6 ], [ 1, 5 ], [ 7, 6 ], [ 6, 4 ], [ 5, 2 ], [ 7, 2 ], [ 6, 1 ], [ 4, 7 ], [ 2, 6 ], [ 1, 7 ], [ 7, 5 ], [ 6, 3 ], [ 5, 1 ], [ 6, 2 ], [ 3, 7 ], [ 1, 6 ], [ 2, 7 ], [ 7, 4 ], [ 7, 3 ] ] ]
2020-01-14 12:02:49 +0200 answered a question error with mpmath.findroot on 8.9

Reported on https://github.com/fredrik-johansson/...

indeed it seems to be a Python3 issue.

2019-10-14 13:02:53 +0200 received badge  Nice Answer (source)
2019-10-13 13:11:40 +0200 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='$(TERMCAP_LIB)'

with

+   SHLIB_LIBS='-ltinfo -lncurses'

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

2019-10-11 19:16:43 +0200 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 11:14:58 +0200 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 http://www.mirrorservice.org/sites/ww...

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

2019-01-29 19:41:20 +0200 answered a question possible to solve this optimizationproblem with LMI?

Yes, semidefinite optimisation is available in Sage, check out

http://doc.sagemath.org/html/en/refer...

2018-12-18 06:09:09 +0200 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-03 00:34:08 +0200 received badge  Nice Answer (source)
2018-03-22 17:19:56 +0200 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. https://stackoverflow.com/questions/2...

2018-03-07 13:16:38 +0200 received badge  Nice Answer (source)
2018-03-06 03:40:52 +0200 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/graph.py b/src/sage/graphs/graph.py index 617881e4a7..57504aaecd 100644
--- a/src/sage/graphs/graph.py
+++ b/src/sage/graphs/graph.py
@@ -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 13:08:53 +0200 received badge  Civic Duty (source)
2017-10-05 12:17:08 +0200 commented question Build Error when Uploading Notebooks in Sage

thanks, see https://github.com/sagemath/sagenb/is... for this problem.

2017-08-09 19:20:16 +0200 received badge  Nice Answer (source)
2017-07-18 11:30:22 +0200 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 09:45:35 +0200 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 09:18:34 +0200 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 09:15:30 +0200 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 19:27:00 +0200 commented answer highest dimension polyhedron

no, not really. See https://arxiv.org/pdf/math/9909177.pdf for bounds and examples. E.g. in dimension 13 you might have more than 17000000 facets.

2017-02-09 21:27:16 +0200 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 21:05:41 +0200 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 10:08:22 +0200 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 09:08:54 +0200 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 17:43:19 +0200 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 17:42:10 +0200 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/classical_geometries.py for details); however, you might want to make sure that GAP's GF(4) is created in a compatible way.

2016-07-20 11:09:29 +0200 received badge  Good Answer (source)
2016-04-04 20:23:39 +0200 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 15:56:21 +0200 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 18:10:03 +0200 answered a question public.pem File Not Created in OSX Lion
2015-04-16 08:58:08 +0200 received badge  Nice Answer (source)
2015-04-13 12:48:54 +0200 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 10:23:06 +0200 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 18:31:52 +0200 answered a question Build command for LaTeX project

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