Ask Your Question

bksadie's profile - activity

2022-11-17 01:06:47 +0200 received badge  Popular Question (source)
2020-08-25 17:17:09 +0200 asked a question Modifying packages/libraries source code

I was looking at the source of one of the libraries (libbraiding) that Sage uses and was interested in making a few small changes and testing the result.

I have no experience with compiling/packaging such code; I was wondering whether it is easy to download the source of the Sage package, make a couple of minor changes to it and then force Sage to install/compile it? If yes, can someone please point me in the right direction?

2020-08-14 12:45:26 +0200 received badge  Popular Question (source)
2020-07-26 02:53:29 +0200 received badge  Supporter (source)
2020-07-26 02:53:23 +0200 commented answer Memory problem: splitting large conjugacy class into parts

Thank you that actually worked for the particular problem that I described (apparently there's a fast algorithm for computing elements of a certain length), but the more general problem remains...

2020-07-26 02:50:50 +0200 commented answer Differentiating function with fluctuating number of variables

Thanks so much; I'm struggling with the last step. If I set

v_1 = 1
v_2 = 2
v_3 = 3

Then how do I turn

[diff(f, vi) for vi in v]

into a list of numbers?

2020-07-12 22:23:14 +0200 received badge  Nice Question (source)
2020-07-09 23:01:05 +0200 received badge  Associate Editor (source)
2020-07-09 22:34:03 +0200 asked a question Memory problem: splitting large conjugacy class into parts

I'm trying to do a calculation on certain conjugacy classes in a large (Weyl) group, let's say:

W = WeylGroup(["E",8])
w = W.an_element()
for v in W.conjugacy_class(w):
  if v.length() < 12:
    if v.reduced_word()[0] == 1:
      print v.reduced_word()

A typical conjugacy class of such W has a size in the millions. When I run this on my computer, then after about 100000 iterations it stops and prints

Error, reached the pre-set memory limit
(change it with the -o command line option)

(I'm not sure where to enter this -o command, but it wouldn't suffice anyway.)

I don't know exactly how these conjugacy classes are implemented (via GAP I think), but I was hoping that I could simply resume the calculation by using islice or e.g.

for v in W.conjugacy_class(w)[100000:200000]:
  if v.length() < 12:
    if v.reduced_word()[0] == 1:
      print v.reduced_word()

However this doesn't seem to work - I'm guessing that it's first trying to create the entire list W.conjugacy_class(w)[100000:200000] (after crunching through the first 100000), in a less efficient way than before, taking up more memory than before.

Is there a way around this? Perhaps this can somehow be set up as a queue (in GAP!?) so that it takes up little memory?

2020-07-09 22:21:15 +0200 received badge  Scholar (source)
2020-06-20 14:29:44 +0200 received badge  Student (source)
2020-06-19 17:18:47 +0200 commented question Differentiating function with fluctuating number of variables

Oops, I've changed the question - thank you very much.

2020-06-19 15:07:39 +0200 received badge  Editor (source)
2020-06-19 14:46:57 +0200 asked a question Differentiating function with fluctuating number of variables

(Edit: I've changed the question somewhat - upon editing the code the problem seems to lie elsewhere.)

Let's say I have a vector space V of dimension n (which is variable) and a matrix M (also depending on n and other input), and I want to understand the derivative of the function v -> ||M*v|| at some vector v in V, and then evaluate it at tangent vectors.

As far as I can tell, the easiest way to do this is to use a symbolic vector v, then calculate ||M*v||, then take diff(), and then I can plug in a tangent vector.

So I would write something like

v = list(var('v_%d' % i) for i in range(1,n+1))
def f(*arg):
    L = []
    for var in arg:
        L.append(var)
    return (M*vector(L)).norm()

(which is clearly bad and going nowhere) but attempting something like this, diff(f) throws an error:

unable to convert <function f at 0x7f2b046c5b90> to a symbolic expression

Trying

f(*v) = (M*vector(v)).norm()

doesn't work either.