Ask Your Question

Jesus Martinez Garcia's profile - activity

2023-11-09 10:59:32 +0200 received badge  Famous Question (source)
2023-02-25 01:41:33 +0200 commented question Computing singular locus

@achrzesz Yeah, I think that is what I want, assuming that "J" displays as an ideal. I don't have Sage in this computer

2023-02-24 18:15:35 +0200 commented question Computing singular locus

@achrzesz Thanks for your message. Is there a way to define in https://doc.sagemath.org/html/en/reference/schemes/sage/

2023-02-24 18:14:40 +0200 commented question Computing singular locus

@achrzesz Thanks for your message. Is there a way to define in https://doc.sagemath.org/html/en/reference/schemes/sage/s

2023-02-24 18:14:08 +0200 commented question Computing singular locus

@achrzesz Thanks for your message. Is there a way to define in https://doc.sagemath.org/html/en/reference/schemes/sage/s

2023-02-24 18:13:34 +0200 commented question Computing singular locus

@Emmanuel Charpentier Thanks for your question. I mean the first option. I have edited accordingly. My apologies..

2023-02-24 18:13:27 +0200 commented question Computing singular locus

@EmmanuelCharpentier Thanks for your question. I mean the first option. I have edited accordingly. My apologies..

2023-02-24 18:13:18 +0200 commented question Computing singular locus

@Emmanuel-Charpentier Thanks for your question. I mean the first option. I have edited accordingly. My apologies..

2023-02-24 18:12:27 +0200 commented question Computing singular locus

@achrzesz Thanks for your message. Is there a way to define in https://doc.sagemath.org/html/en/reference/schemes/sage/s

2023-02-24 18:08:13 +0200 commented question Computing singular locus

@emmanuel Thanks for your question. I mean the first option. I have edited accordingly. My apologies..

2023-02-24 18:07:16 +0200 edited question Computing singular locus

Computing singular locus I have a bunch of homogeneous polynomials in 5 variables with specific arbitrary (symbolic) non

2023-02-24 18:06:47 +0200 edited question Computing singular locus

Computing singular locus I have a bunch of homogeneous polynomials in 5 variables with specific arbitrary (symbolic) non

2023-02-24 18:06:29 +0200 edited question Computing singular locus

Computing singular locus I have a bunch of homogeneous polynomials in 5 variables with specific arbitrary (symbolic) non

2023-02-24 14:43:02 +0200 asked a question Computing singular locus

Computing singular locus I have a bunch of homogeneous polynomials in 5 variables with specific arbitrary (symbolic) non

2021-08-02 13:23:13 +0200 received badge  Notable Question (source)
2021-06-29 22:50:34 +0200 commented question Representing subsets of a set as arrays of bits for quick comparison

Mmmm, not sure what happened, so I have asked to delete this question.

2021-06-29 17:50:29 +0200 asked a question Representing subsets of a set as arrays of bits for quick comparison

Representing subsets of a set as arrays of bits for quick comparison I am writing a program which, among many tasks, nee

2021-06-29 17:48:36 +0200 asked a question Turning integers into booleans for rapid comparison of subsets

Turning integers into booleans for rapid comparison of subsets I am writing a program which, among many tasks, needs to

2021-02-23 09:35:26 +0200 received badge  Popular Question (source)
2020-08-31 11:29:55 +0200 received badge  Popular Question (source)
2020-08-01 17:37:42 +0200 received badge  Famous Question (source)
2020-07-31 03:08:36 +0200 received badge  Famous Question (source)
2020-06-19 14:46:20 +0200 received badge  Famous Question (source)
2020-05-01 20:58:38 +0200 received badge  Notable Question (source)
2020-04-17 03:44:43 +0200 received badge  Notable Question (source)
2020-01-22 17:44:58 +0200 received badge  Popular Question (source)
2020-01-15 14:00:13 +0200 received badge  Nice Question (source)
2020-01-10 12:20:04 +0200 received badge  Popular Question (source)
2020-01-02 00:09:44 +0200 received badge  Popular Question (source)
2020-01-02 00:09:44 +0200 received badge  Notable Question (source)
2019-06-26 07:39:11 +0200 commented answer wrapping vector class

@john-palmieri it is all clear now. Thank you for your patience.

2019-06-25 23:25:30 +0200 commented answer wrapping vector class

@John_Palmieri Actually, (disregard original comment, there was mistake), it doesn't work. I do MWE:

from sage.structure.element import Vector
class test(Vector):
  def __init__(self,value):
      Vector.__init__(self, value)
xi2=test([2,2,1])

Get error:

  File "test.sage.py", line 23, in <module>
    xi2=test([_sage_const_2 ,_sage_const_2 ,_sage_const_1 ])
  File "<string>", line 4, in __init__
  File "sage/structure/element.pyx", line 388, in sage.structure.element.Element.__init__ (build/cythonized/sage/structure/element.c:4248)
TypeError: Cannot convert list to sage.structure.parent.Parent
2019-06-25 23:13:21 +0200 commented answer subclass from a sage vector
2019-06-25 23:09:11 +0200 received badge  Commentator
2019-06-25 23:09:11 +0200 commented answer wrapping vector class

@John_Palmieri I guess I want rational vectors (to keep it safe). Should I use from sage.structure.element import Vector_rational_dense?

2019-06-25 23:05:32 +0200 commented answer wrapping vector class

@John_Palmieri Thank you thank you, you can't believe how long I've been struggling with this. How did you know where to import it from? And when I do w=OneParamSubgroup([1,2]), if it is just the empty wrapper calling Vector.__init__, will it have the same effect as doing vecctor([1,2])?

2019-06-25 23:03:59 +0200 marked best answer wrapping vector class

I am trying to wrap the vector class to add some extra cases, but I am having trouble doing so. This is the code I have:

def lower_triangular_entries(dim,x,y):
    return upper_triangular_entries(dim,y,x)

def upper_triangular_entries(dim,x,y):
    if y<=x:
        return 1
    else:
        return 0

class OneParamSubgroup(vector):
    #TO DO: define scalar multiplication
    def __init__(self, data, type_A=False):
        if type_A:
            BasisChange=matrix(ZZ, len(data)-1, len(data)-1,
                                lambda x,y: lower_triangular(len(data)-1,x,y))
            v=vector(data[0:len(data)-1])
            v=tuple(BasisChange*v)
        #data given in terms of basis T
        else:
            v=data
        vector.__init__(self, v)
    def __repr__(self):
        return self

However, I get the following error when running on terminal

Traceback (most recent call last):
  File "test.sage.py", line 7, in <module>
    load("GIT/Group.sage")
  File "sage/structure/sage_object.pyx", line 1057, in sage.structure.sage_object.load (build/cythonized/sage/structure/sage_object.c:12915)
  File "/opt/sagemath-8.1/local/lib/python2.7/site-packages/sage/repl/load.py", line 247, in load
    exec(preparse_file(open(fpath).read()) + "\n", globals)
  File "<string>", line 3, in <module>
ImportError: cannot import name vector

and the following on the Notebook

TypeError                                 Traceback (most recent call last)
<ipython-input-1-ec2394617192> in <module>()
      8         return Integer(0)
      9 
---> 10 class OneParamSubgroup(vector):
     11     #TO DO: define scalar multiplication
     12     def __init__(self, data, type_A=False):

TypeError: Error when calling the metaclass bases
    cannot create 'builtin_function_or_method' instances

Any idea of what I am doing wrong?

2019-06-25 22:15:51 +0200 commented question Is it possible to subclass a sage class?

Hi, @done_with_fish did you manage to do this? I have no trouble doing it with Python classes, but struggle with Sage classes, see here: https://ask.sagemath.org/question/469...