Ask Your Question

Jesus Martinez Garcia's profile - activity

2024-10-10 17:22:35 +0100 edited question Labelling vertices in a displayed polytope

Labelling vertices in a displayed polytope I am working with the following code: def make_polytope(v,d): n = len(v)

2024-10-10 17:22:15 +0100 asked a question Labelling vertices in a displayed polytope

Labelling vertices in a displayed polytope I am working with the following code: def make_polytope(v,d): n = len(v)

2024-07-20 22:47:05 +0100 received badge  Popular Question (source)
2024-07-02 10:45:25 +0100 commented answer Trouble with subs

Sorry I was not clear. I am removing the 'accepted' answer in the hope that someone comes with a solution but I really a

2024-07-02 10:44:58 +0100 commented answer Trouble with subs

Ohhh I see. Thank you. I think the issue is that I am (should be?) working on a graded ring where negatively graded part

2024-07-01 16:37:11 +0100 commented answer Trouble with subs

Actually, it doesn't work as intended. In input: R.<L, E, t, c> = PolynomialRing(QQ) D=(1-c)*(L+3*E) Dt=D-t*E Dt

2024-06-28 19:01:24 +0100 commented answer Trouble with subs

This is what I import: from sage.symbolic.integration.integral import definite_integral from sage.symbolic.assumptions

2024-06-28 19:00:38 +0100 commented answer Trouble with subs

I tried this but it fails: AttributeError: 'Add' object has no attribute '_sympy_'

2024-06-28 09:47:12 +0100 marked best answer Trouble with subs

I have this code:

var("L E t c")
D=(1-c)*(L+3*E)
Dt=D-t*E
Dt_E=Dt*E;
Dt_E=Dt_E.expand()
print(Dt_E.subs(E*L==1/2, E*E==-1/6, L*L==-1/2, E*L*c==c*1/2))

I get:

-E*L*c + 1/2*c + 1/6*t

I get the same if I drop the last equality. What do I have to do for ELc to be replaced by c/2?

2024-06-28 09:47:08 +0100 commented answer Trouble with subs

Thank you. That's quite clever. May I ask if these rings are commutative by default?

2024-06-27 15:20:59 +0100 commented question Trouble with subs

I answer myself. If I add - in front of the ELC substitution, it works. I suppose this happens because for some reason s

2024-06-27 15:11:03 +0100 asked a question Trouble with subs

Trouble with subs I have this code: var("L E t c") D=(1-c)*(L+3*E) Dt=D-t*E Dt_E=Dt*E; Dt_E=Dt_E.expand() print(Dt_E.su

2023-11-09 10:59:32 +0100 received badge  Famous Question (source)
2023-02-25 01:41:33 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 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 +0100 received badge  Notable Question (source)
2021-06-29 22:50:34 +0100 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 +0100 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 +0100 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 +0100 received badge  Popular Question (source)
2020-08-31 11:29:55 +0100 received badge  Popular Question (source)
2020-08-01 17:37:42 +0100 received badge  Famous Question (source)
2020-07-31 03:08:36 +0100 received badge  Famous Question (source)
2020-06-19 14:46:20 +0100 received badge  Famous Question (source)
2020-05-01 20:58:38 +0100 received badge  Notable Question (source)
2020-04-17 03:44:43 +0100 received badge  Notable Question (source)
2020-01-22 17:44:58 +0100 received badge  Popular Question (source)
2020-01-15 14:00:13 +0100 received badge  Nice Question (source)
2020-01-10 12:20:04 +0100 received badge  Popular Question (source)
2020-01-02 00:09:44 +0100 received badge  Notable Question (source)
2020-01-02 00:09:44 +0100 received badge  Popular Question (source)
2019-06-26 07:39:11 +0100 commented answer wrapping vector class

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

2019-06-26 02:01:00 +0100 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?