Ask Your Question

StrongPiccolo's profile - activity

2020-01-10 17:24:13 -0500 received badge  Editor (source)
2020-01-10 17:23:08 -0500 answered a question Running Sage in Bash

As shown by @slcoleman and @John Palmieri, the easiest way to invoke Sage via Bash is through /path/to/sage, followed by the file to be run. This can be made simpler through an alias added to ~/.bashrc or the PATH. I'll also add a small Bash script I wrote that runs a Sage file on multiple threads:

for j in {1..10}; do   echo Launching thread....;   ../sage ./ & done 2>/dev/null
2020-01-08 11:37:32 -0500 asked a question Running Sage in Bash

I would like to execute a Sage file from my bash, similar to how I can run 'python Documents/' and have Python execute the file. Is this possible? If so, how? I'm attempting to circumvent the interpreter and automate execution.

2020-01-03 11:46:23 -0500 commented answer Sage @fork Parallel Decorator Breaking Interface to Singular

Thank you! I'm unsure of implementation, I'm using a master function that calls other functions which contain calls to Singular. I would like to spawn multiple processes of the master function with @fork. Do I need to create individual singular interfaces for each function, even if the function itself is not parallelized, just the function calling it? I can't seem to space out my code, but hopefully you can decipher the blob.


def master(polynomial, goal): s1 = Singular() singular.current_ring = currentRing polynomial = currentPolynomial global hits reduktion = reduction(polynomial) if testForICIS(polynomial, reduktion) == True:`

2020-01-03 09:42:49 -0500 commented question Sage @fork Parallel Decorator Breaking Interface to Singular

Thanks for the comment! I'm not totally sure what you mean by create a new singular interface, in my code I've just been using singular.<command>. I can post my code if that would be illuminating. I assumed that each call to Singular via Sage was a new instance of the interface, but maybe that is a misinterpretation.

2020-01-02 09:05:40 -0500 asked a question Sage @fork Parallel Decorator Breaking Interface to Singular

Exception raised by child process with pid=1704:

Traceback (most recent call last):
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/parallel/", line 177, in __call__
self._subprocess(f, dir, *v0)
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/parallel/", line 302, in _subprocess
value = f(*args, **kwds)
File "<ipython-input-9-532b53e3019b>", line 167, in master
reduktion = reduction(polynomial)
File "<ipython-input-9-532b53e3019b>", line 94, in reduction
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/interfaces/", line 1098, in set_ring
self.eval("setring %s; short=0", allow_semicolon=True)
File "/opt/sagemath-8.8/local/lib/python2.7/site-packages/sage/interfaces/", line 658, in eval
raise SingularError('Singular error:\n%s'%s)
SingularError: Singular error:
? sage1317 is no name of a ring/qring
? error occurred in or before STDIN line 11: `setring sage1317; short=0;`

I've been implementing parallelism on a program built in Sage MATH using its interface to Singular. I am attempting to use Sage's @fork parallel decorator, which seems to cause issues with Singular (this error does not occur if the decorator is not present). I'm very new to parallelism and am unsure what the issue here could be. Thanks for any and all help! :D

2019-02-28 04:53:17 -0500 received badge  Nice Question (source)
2019-02-27 16:28:32 -0500 commented answer Calculating Milnor Numbers of Polynomials Using Singular via Sage

You're right, I was wrongly interpreting the error. Thanks!

2019-02-27 16:28:00 -0500 received badge  Scholar (source)
2019-02-27 12:13:57 -0500 received badge  Supporter (source)
2019-02-27 11:50:36 -0500 received badge  Student (source)
2019-02-27 11:03:39 -0500 asked a question Calculating Milnor Numbers of Polynomials Using Singular via Sage

I'm using Singular via Sage Math to calculate the Milnor numbers of a large number of polynomials. For most polynomials, doing polynomial.milnor() works fine, however I am getting a -1 when I have a variable raised to a power times another variable. I have manually calculated the first Milnor number, and it should be 8. For instance:

Works fine:

sage: ring = singular.ring(0,'(x,y,z)','ds')
sage: polynomial = singular('-x2+x3-y3+xy3-z5+xz5')
sage: _=singular.lib('sing.lib')
sage: polynomial.milnor()

Returns error:

sage: polynomial2 = singular('y2-x3-z2x2')
sage: polynomial2.milnor()

I am following these documentation pages:

  • Interface to Singular (Sage Interpreter Interfaces)
  • D.6.15.10 milnor (Singular Documentation)

I can't publish links due to low karma, sorry!

By the second page, the -1 would imply that the function is an isolated complete intersection singularity. This function does not have an ICIS to my knowledge, and I have tested several other functions which I can provide. I think that singular is interpreting the polynomial as y2-x3-z^(2x2), instead of the wanted y2-x3-(z2)(x2), but I am new to Sage and unsure of how to fix this (I attempted parentheses and it threw back an error).