[sage-devel] Re: cached_function: cache a(n) only when n is *not* a prime power

2014-05-15 Thread Javier López Peña
You can make a caching function that returns a decorator depending on your condition, that you subsequently apply to your function: def conditional_caching(condition): def decorator(f): cache = {} def cached_f(n): if n in cache: return cache[n]

Re: [sage-devel] Re: cached_function: a filter to only cache some inputs ?

2014-05-15 Thread Javier López Peña
If an method is *extremely* performance critical, one might want to give it its own custom cache to avoid as much overhead as possible. I don't think the utility cached_function and cached_method can be expected to have shining performance for all types of functions and inputs. Also, if one

[sage-devel] Re: Error: environment variable $HOME is not set.

2014-04-26 Thread F. Javier Marquez
did you ever resolve this? i am facing the same problem. thx jm On Tuesday, January 28, 2014 5:41:57 AM UTC-8, Jeremy McFarland wrote: Hello, I am very impressed with sage, and would love to use it on my Ubuntu server. I attempted to install sagecell, but that was a huge mess and I gave

Re: [sage-devel] Re: Python as build-time dependency

2014-01-12 Thread Javier López Peña
On Sunday, January 12, 2014 2:20:03 AM UTC, William wrote: Thanks for reminding people of conda. One issue is that Sage's build system is far more than just for installing Python package -- it's much, much more (e.g., Gap, Singular, etc.). conda started off as a python package manager,

Re: [sage-devel] Re: Python as build-time dependency

2014-01-11 Thread Javier López Peña
On Saturday, January 11, 2014 4:37:56 PM UTC, William wrote: Andrew's main argument is that there is strong interesting in writing a nontrivial new build system that solves our unique set of problems with Sage (since no existing build system does). I am not qualified to discuss the

[sage-devel] Re: R

2013-11-22 Thread Javier López Peña
On Thursday, November 21, 2013 1:50:07 PM UTC, Volker Braun wrote: ... but there is very little that we currently can do to replace R functionality. Having said that, there is a serious lack of statistics in Sage. In my personal experience the pandas package [1] is capable of doing most

Re: [sage-devel] Matplotlib and sage's python

2013-05-22 Thread Javier López Peña
On Wednesday, May 22, 2013 7:30:07 AM UTC+1, Snark wrote: Is there a non-default and easy way to get a working matplotlib-on-bare-python? Depending on your operating system getting matplotlib working over system python can be quite a tricky task, IIRC on Mac OSX 10.6 you must install some

[sage-devel] Re: A problem with exceptions in cached functions

2013-03-20 Thread Javier López Peña
On Wednesday, March 20, 2013 5:09:40 AM UTC, Nils Bruin wrote: On Mar 19, 9:10 pm, Robert Bradshaw rober...@math.washington.edu wrote: Sounds good. What if we called this foo.uncached(args) instead (which is more verbose but much clearer, and tab completion shouldn't make that too

[sage-devel] Tab completion in sage 5.7

2013-02-26 Thread Javier López Peña
With latest stable sage 5.7 (running under Mac OS 10.6.8) I have observed a new behavior with tab-completion. Trying to launch the notebook, tab completion keeps showing me two choices, one of them a magic one: sage: note %notebook notebook Is this a new intended behavior? I would only

[sage-devel] Re: Spanish speaking reviewer needed

2013-02-19 Thread Javier López Peña
I'll give it a look Cheers, J On Tuesday, February 19, 2013 12:40:16 AM UTC, Keshav Kini wrote: Hi, If there are any Spanish speaking Sage devs who have a little time, could you please review this Spanish translation of the sagenb UI? https://github.com/sagemath/sagenb/pull/133

Re: [sage-devel] Re: Wrapping gap.IsConjugate

2013-02-05 Thread Javier López Peña
On Friday, February 1, 2013 1:03:55 PM UTC, jori.ma...@uta.fi wrote: Should Sage aim to efficient code whenever something is added, or should we just put in something that works and lock user interface, i.e. command or function name, order of arguments etc? I don't think we have to chose.

Re: [sage-devel] Re: Wrapping gap.IsConjugate

2013-02-01 Thread Javier López Peña
On Friday, February 1, 2013 11:41:40 AM UTC, jori.ma...@uta.fi wrote: If I understand correctly, after conjugacy_class(self, g) is done it needs only say conjugacy_class(self, g1)==conjugacy_class(self, g2) to check if two groups are conjugates. (But still, for convenience there should be

[sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Javier López Peña
for fallback methods and a more specific one containing GAP-specific algorithms. My patches don't merge anymore, but I will try to rebase them over the weekend. Thanks for working on this! Javier PS: Due to a new work situation I haven't been following recent developments very closely. Is libGAP

[sage-devel] Re: Attribute errors with polynomials

2013-01-04 Thread Javier López Peña
Hi Nathan, What do you mean by calling absolute value or norm of a polynomial? Why should these methods even be defined? Cheers, J On Friday, January 4, 2013 1:50:14 PM UTC, Nathann Cohen wrote: Hell everybody !!! Of course I do not know if what I do has any meaning, but I still

Re: [sage-devel] Re: Proposed Project

2012-07-25 Thread Javier López Peña
You think you have it bad? Look at who the other Javier López Peña is: http://en.wikipedia.org/wiki/Francisco_Javier_L%C3%B3pez_Pe%C3%B1a when this guy hit the news I received hate mail on a daily basis for almost a year :-/ On Wednesday, July 25, 2012 9:31:29 AM UTC+1, John Cremona wrote

[sage-devel] Re: An example in Stein's Three lectures...

2012-07-25 Thread Javier López Peña
There is a (sort of new) fast probabilistic algorithm for computing Galois groups, due to Nikolai Durov: - N. V. Durov, Computation of the Galois group of a polynomial with rational coefficients. I. (Russian) Zap. Nauchn. Sem. S.-Peterburg. Otdel. Mat. Inst. Steklov. (POMI)

Re: [sage-devel] Re: Matrix groups from GAP

2012-07-19 Thread Javier López Peña
I understand that from some point of view mixing groups and their representations is a bad idea, but many groups are naturally defined as transformation groups and using a matrix presentation is just as natural as describing them by permutations, or even more so. Not to mention the huge size

Re: [sage-devel] Re: Matrix groups from GAP

2012-07-19 Thread Javier López Peña
On Thursday, July 19, 2012 9:52:26 AM UTC+1, Dima Pasechnik wrote: let me nitpick first by saying that in group theory presentation means presentation by generators and relations whereas you mean a (linear) representation. Fine, maybe I should have use realization or imploementation

Re: [sage-devel] sagemath-monolithic PPA on launchpad

2012-07-13 Thread Javier López Peña
On Friday, July 13, 2012 1:53:00 PM UTC+1, Jan Groenewald wrote: Can you build using make -k instead of make? This will make the build continue after errors (but it will still respect dependencies). No idea how. Our rules file say to run: 0

Re: [sage-devel] sagemath-monolithic PPA on launchpad

2012-07-13 Thread Javier López Peña
On Friday, July 13, 2012 2:00:36 PM UTC+1, Javier López Peña wrote: Maybe I am saying something stupid here, but cannot you just change the first line to this? #!/usr/bin/make -f -k Sorry, that should be #!/usr/bin/make -k -f -- -- To post to this group, send an email to sage-devel

Re: [sage-devel] Re: Code duplication and aliases in methods

2012-07-09 Thread Javier López Peña
On Monday, July 9, 2012 2:59:33 AM UTC+1, Birk Eisermann wrote: (I have searched and found that there has been discussion on how much networkx will be adapted in sage - and it seems that there is some issue with the license... right? I also read the sage-devel thread graph theory: refactor

[sage-devel] Re: import / export of graphs (modifications in graph theory)

2012-07-09 Thread Javier López Peña
Why cannot we have our cake and eat it too? Isn't there a way to have the import/export classes in a separate file that gets imported inside an import/export alias in the graph class so that G.export is actually GraphExporter(G, whatever) and tab completion works? Partially related, ticket

[sage-devel] Re: Please test sage-5.1.rc1

2012-07-07 Thread Javier López Peña
Compiled and long tests pass in OS-X Snow Leopard 10.6.8 J On Friday, July 6, 2012 8:05:28 AM UTC+1, Jeroen Demeyer wrote: Because many of the Sage testing machines (redhawk and all of Skynet) are down, version sage-5.1.rc1 has been tested much less than usual. So, please build

Re: [sage-devel] Re: GL( N,GF(p) ).random_element() is slow

2012-07-04 Thread Javier López Peña
bigger, the random permutation method appears to be about 2x slower than the whole random matrix method. Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options

[sage-devel] Easy review needed for #12806

2012-07-04 Thread Javier López Peña
Hi guys, ticket 12806, upgrading 2 year old networkx 1.2 to version 1.6, needs an extra review. The technical part was already positively reviewed by Keshav Kini, but Jeroen pointed out a docbuild failure due to a tex error. I patched the problem, and now need a new review. The patch consists

Re: [sage-devel] Re: GL( N,GF(p) ).random_element() is slow

2012-07-03 Thread Javier López Peña
I know little of random methods, but do we really need to make things so complicated? As the OP suggests, we might as well just generate matrices uniformly at random and discard if not invertible. The set of invertible matrices is Zariski open, so the probability of hitting a non-invertible

Re: [sage-devel] Re: GL( N,GF(p) ).random_element() is slow

2012-07-03 Thread Javier López Peña
, there is no need to compute the determinants, knowing if the rank is full or not is enough. So my point is: even if not *very* fast, still seems faster than what we have now, and it is very easy to implement while we think of a better solution. Javier -- To post to this group, send an email

Re: [sage-devel] Re: GL( N,GF(p) ).random_element() is slow

2012-07-03 Thread Javier López Peña
of another one, as the chance of hitting the offending row is 1/n and the rank gets recomputed every time. Unless there is a faster way of computing the rank taking advantage of previously used computations, that is. Javier -- To post to this group, send an email to sage-devel@googlegroups.com

[sage-devel] Re: Optional BeautifulSoup spkg

2012-06-26 Thread Javier López Peña
in the spke vs easy_install thing, but if having it as an optional spkg makes someone's life easier, my vote is just go for it. Cheers, Javier On Friday, June 22, 2012 2:32:55 AM UTC+1, kcrisman wrote: I don't remember if we need votes for optional spkgs. I think we do. Anyway, here is one

[sage-devel] Re: On the NetworkX upgrade: vote required

2012-06-14 Thread Javier López Peña
On Thursday, June 14, 2012 3:39:23 PM UTC+1, Javier López Peña wrote: Yes, that is the case. The (weighted) clustering coefficient algorithm (with weighted *edges*) computes some auxiliary *vertex* weights. The old method used to return all of it, the new one just returns the clustering

[sage-devel] Weird looking representation of quotients of radicals

2012-03-08 Thread Javier López Peña
)) with disastrous consequences. Is there any design choice involved here that I can override to get something like sqrt(2)/2 instead? Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr

[sage-devel] Re: Dealing with different signs in doctest output?

2012-02-07 Thread javier
, not to the examples section. Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http

[sage-devel] Re: Saving GAP objects across sessions

2012-02-07 Thread javier
? In your example, why would one want to save the tuple (5790338948, 24) rather than (24, 12)? Cheers, Javier On 7 feb, 01:53, Dima Pasechnik dimp...@gmail.com wrote: A workaround is to use GAP facilities to encode a pc group using a pair of integers. Cutting from the GAP manual on CodePcgs gap G

[sage-devel] Saving GAP objects across sessions

2012-02-06 Thread javier
Traceback (most recent call last) /Users/javier/code/ipython console in module() /Applications/sage/local/lib/python2.7/site-packages/IPython/ Prompts.pyc in __call__(self, arg) 550 551 # and now call a possibly user-defined print mechanism -- 552 manipulated_val

[sage-devel] Re: is_singular method for matrices

2012-01-31 Thread javier
over any other ring or field ValueError: self must be a square matrix so I changed the error message over QQ and the doctests using it to be consistent with all the other rings. Cheers, Javier [1]: http://trac.sagemath.org/sage_trac/ticket/12370 -- To post to this group, send an email to sage

[sage-devel] is_singular method for matrices

2012-01-25 Thread javier
, or is this done by some design reason? Cheers Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL

[sage-devel] Re: is_singular method for matrices

2012-01-25 Thread javier
, then. Cheers Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org

[sage-devel] Re: Android app

2012-01-24 Thread javier
Hi Volker, thanks for your work on the droid app! In an HTC Desire with Cyanogenmod 7 (Android 2.3 Gingerbread) I keep getting Web page not available messages whenever I hit the run button. Cheers, Javier On Jan 24, 6:17 am, Volker Braun vbraun.n...@gmail.com wrote: I see from the market

[sage-devel] Re: Android app

2012-01-24 Thread javier
Hi Jason, On Jan 24, 1:07 pm, Jason Grout jason-s...@creativetrax.com wrote: Can you reach aleph.sagemath.org with your web browser on that phone? Yes, it loads in my phone browser, though it takes almost an entire minute to load. Computations there work too. Cheers, Javier -- To post

[sage-devel] Issues with notebook and plotting

2012-01-06 Thread javier
using plot3d the mesh = True and dots = True options have no effect whatsoever. These are reproducible in my local installation, in sagenb.org and in test.sagenb.org Cheers Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email

[sage-devel] Re: Representation of finite field elements

2011-12-12 Thread javier
Hi Johan, do you have the typeset box checked in your notebook? If so, then things are displayed using the latex method instead of the repr one. Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel

[sage-devel] Re: Problem calling a base-class cached method from an overridden derived class cached method

2011-12-12 Thread javier
suggestion in my patch! Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http

[sage-devel] Re: Conjugacy classes code

2011-12-08 Thread javier
, since my patch doesn't modify group.pyx Are you applying the right patches, or the two year old bit-rotten version? Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com

[sage-devel] Re: Conjugacy classes code

2011-12-08 Thread javier
They were listed on the comments. I have upgraded the ticket description to make it clearer. Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit

[sage-devel] Re: Conjugacy classes code

2011-12-07 Thread javier
ticket. Cheers, Javier On Dec 7, 12:46 pm, Florent Hivert florent.hiv...@lri.fr wrote:       Hi Simon, On 7 Dez., 10:16, Simon King simon.k...@uni-jena.de wrote: But in both cases, it is also assumed that you are using coercion. Hence, when the test self==None raises an error

[sage-devel] Re: Problem calling a base-class cached method from an overridden derived class cached method

2011-12-06 Thread javier
to a hand-knitted cache, as probably the overhead of a hand-made definition is less than redoing the whole computation :-/ Thanks for your help! Cheers Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel

[sage-devel] Re: Problem calling a base-class cached method from an overridden derived class cached method

2011-12-06 Thread javier
this solves my problem. Thanks again Simon! Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL

[sage-devel] Conjugacy classes code

2011-12-06 Thread javier
** 1 items had failures: 1 of 15 in __main__.example_0 ***Test Failed*** 1 failures. For whitespace errors, see the file /Users/javier/.sage//tmp/ conjugacy_classes_23354.py [5.2 s

[sage-devel] Re: Conjugacy classes code

2011-12-06 Thread javier
Hi David, On Dec 6, 6:29 pm, David Joyner wdjoy...@gmail.com wrote: Where is it? Is it in one of the patches posted to the trac ticket? Yes, it is in trac_7886_conjugacy_classes.patch Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from

[sage-devel] Re: Conjugacy classes code

2011-12-06 Thread javier
it in the patch trac_7886_conjugacy_classes_module.patch Sorry! Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com

[sage-devel] Re: Conjugacy classes code

2011-12-06 Thread javier
the test to include parent checking (although the example above suggest that it shouldn't be necessary). Any idea on what is causing the Testsuit to fail, even if the doctests pass? Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from

[sage-devel] Problem calling a base-class cached method from an overridden derived class cached method

2011-12-05 Thread javier
tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (396, 0)) --- TypeError Traceback (most recent call last) /Users/javier

[sage-devel] Re: Problem calling a base-class cached method from an overridden derived class cached method

2011-12-05 Thread javier
, 0)) --- TypeError Traceback (most recent call last) /Users/javier/ipython console in module() /Users/javier/ipython console in Afoo(self) /Applications/sage/local/lib/python2.6/site-packages

[sage-devel] Re: Using sagetex for large blocks of code

2011-10-26 Thread javier
with sagecommandline but now I realize it is only the sage prompt that gets colorized, so I will probably make my own environment based on minted for code listing. Cheers, Javier On Oct 26, 6:48 am, Dan Drake dr...@kaist.edu wrote: By the way, why aren't you using the sageblock environment

[sage-devel] Re: Using sagetex for large blocks of code

2011-10-26 Thread javier
to install pygments in a place where my latex can find it). If you think than any of this code or any variation would make an useful addition to sagetex, feel free to rip it off! Cheers, Javier On Oct 26, 1:21 pm, Dan Drake dr...@kaist.edu wrote: On Wed, 26 Oct 2011 at 02:03AM -0700, javier wrote

[sage-devel] Using sagetex for large blocks of code

2011-10-25 Thread javier
): ^ SyntaxError: unexpected EOF while parsing Any ideas? Cheers, Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com

[sage-devel] Re: Where to import the C3 Method Resolution Order from?

2011-10-09 Thread javier
'sage.structure.parent.Parent', type 'sage.structure.category_object.CategoryObject', type 'sage.structure.sage_object.SageObject', type 'object'] Cheers, Javier On 9 oct, 13:02, Simon King simon.k...@uni-jena.de wrote: Hi!  When creating a new-style class with several base classes, Python uses a method resolution

[sage-devel] Re: Fractal Newton basins = Need Cython help!

2011-09-23 Thread javier
the loops if abs(varia-root) 0.67 it is a very little time but adds up quickly over the iterations. Or if you want to be finer, define the 2./3 as a constant outside of the loops (with whichever precision you need) and then use the defined constant inside. Cheers Javier -- To post

[sage-devel] Re: Geogebra 4 coming (uses JavaScript version of the Reduce CAS).

2011-08-13 Thread javier
There is also an interesting LGPL project based on HTML5: http://graph.tk/about/ having the choice of interact with sage plots in this way would be really cool. Cheers J On 13 ago, 16:45, Leonardo Parada leonardoparadavalen...@gmail.com wrote: Have you seen these examples?

[sage-devel] Re: Abelian group invariants

2011-06-17 Thread javier
they could easily be refactored inside 9773. Cheers Javier [1] http://en.wikipedia.org/wiki/Structure_theorem_for_finitely_generated_modules_over_a_principal_ideal_domain -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email

[sage-devel] Re: Solving a gcd equation for polynomials

2011-05-29 Thread javier
I have been looking at the paper and at first glance don't see any reason that would prevent the stabilization algorithm from working over any Euclidean domain, as there you have division with remainder, gcd, xgcd, all ideals are principal, sum of ideals is generated by the gcd and so on. The only

[sage-devel] Re: Anyone with an AMD Opteron?

2011-04-16 Thread javier
] -- All tests passed! Total time for all tests: 25.8 seconds Cheers Javier On 16 abr, 21:26, Dr. David Kirkby david.kir...@onetel.net wrote: Is there anyone here with an AMD Opteron? I've got a couple of doctests failures on a 2.2 GHz Opteron machine with 1 GB RAM and 3 GB swap. The failures

[sage-devel] Re: Absolute value of a matrix...

2011-04-07 Thread javier
If one thinks of absolute value as in the metric sense of norm then indeed the determinant makes no sense. Some valid norms for a matrix would be: * The maximum of the absolute values of its entries (supremum norm) * The root of the sum of the squares of all entries (2-norm) * The maximum of the

[sage-devel] Re: all groups of order 60

2010-11-23 Thread javier
. Cheers Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org

[sage-devel] Re: Has the number of doctests fallen ?

2010-10-25 Thread javier
IIRC in the latest Cython release there was a bugfix that reduced the access time for all cython non-cdef classes [1]. Given the amount of time that is spent on function calls I wouldn't be surprised if that change propagated to a general speedup in the doctests. Cheers J [1]

[sage-devel] Re: Dodgson condensation

2010-08-04 Thread javier
Hi Harald, I think the operations in the case with zeroes are not random, but a cyclic permutation of the rows, which allows to reuse most of the previously computed minors. I haven't read a complete description of the algorithm, but if cyclic permutations are always enough in the case with

[sage-devel] Re: Exterior algebras.

2010-03-23 Thread javier
Somebody wrote [1] a Reduce (cf. [2]) interface some time ago. If it works properly one could try to load Bergmann [3] from it. That would give access to plenty of Groebner basis, Hilbert series, Hochschild cohomology and many other ring theoretical methods for big families of noncommutative

[sage-devel] Weird multiplication error with group algebra elements

2010-02-22 Thread javier
Hi all, I am getting some weird errors doing computations with groups algebras. Here is an example: I create an element of the group algebra: sage: G = SymmetricGroup(3) sage: A = GroupAlgebra(G, QQ) sage: c = sum(1/x.order()*A(x) for x in G) sage: c () + 1/2*(2,3) + 1/2*(1,2) + 1/3*(1,2,3) +

[sage-devel] Re: Weird multiplication error with group algebra elements

2010-02-22 Thread javier
Ooops! Too many group algebras lying around. Just ignore my previous post. Sorry for the noise. Cheers J -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this

[sage-devel] Re: QQbar and group algebras

2010-02-18 Thread javier
Hi Dima, On Feb 18, 6:26 am, Dima Pasechnik dimp...@gmail.com wrote: I am curious to know, how you are doing this. IMHO for this you need to know each irreducible representation explicitly --- but then you can just stack up the right number of copies of each irreducible. Or you rather mean

[sage-devel] QQbar and group algebras

2010-02-17 Thread javier
Hi all, I am trying to use sage to compute the Artin-Wedderburn decomposition of a group algebra. Since I need exact expressions I am working over QQbar rather than over CC. When trying to compute the idempotents I get an error resulting from an attempt to coerce a rational number into QQbar. A

[sage-devel] Re: QQbar and group algebras

2010-02-17 Thread javier
On Feb 17, 2:57 pm, javier vengor...@gmail.com wrote: Observe that in this situation the numbers I am trying to coerce into K are rational: Apparently I was assuming too much. The result of the evaluation of the character belongs to some cyclotomic field, so apparently the problem

[sage-devel] Re: QQbar and group algebras

2010-02-17 Thread javier
Hi Nicolas, What do you mean by exact? I am using CyclotomicFields on a regular basis for similar things, and this works well. And I would expect it to be faster than QQbar. You are right, I guess I could just use CyclotomicField(n) where n is the order of the group and everything should work

[sage-devel] Re: QQbar and group algebras

2010-02-17 Thread javier
Hi all, thanks for the tip-off in CombinatorialFreeModule, I have been trying to use this, but cannot find any sensible way to make it work. sage: G = SymmetricGroup(3) sage: B = sorted(list(G)) sage: n = len(B) sage: K = CyclotomicField(n) sage: A = GroupAlgebra(G,K) sage: V =

[sage-devel] Re: GR package

2010-02-05 Thread javier
Some people in my dept. use Cadabra, a CAS developed with field-theory in mind (i.e. lots of tensors): http://cadabra.phi-sci.com/index.html I have no experience with it so cannot advise on its usability. However, it's written in C++ and released under GPL2, so ideally could be wrapped up in

[sage-devel] How should @parallel be used?

2010-02-04 Thread javier
Hi all, gotta do some computations involving a really big matrix, and need to save each row in a different file (matrix is too big to fit in memory). SInce every row can be computed independently I have tried to parallelize the computation. First, this is my original computation of the matrix

[sage-devel] Re: #8044: Categories for finite/permutation/symmetric groups

2010-01-29 Thread javier
Hi Nicolas, On Jan 27, 10:28 pm, Nicolas M. Thiery nicolas.thi...@u-psud.fr wrote:     * Puts all permutation groups and some other finite groups in the       corresponding categories. There remains to handle finite matrix       groups and Galois groups in sage/rings/number_field/.     * As

[sage-devel] Re: comparison of elements of number fields

2010-01-28 Thread javier
Hi all On Jan 28, 11:04 am, Alex Ghitza aghi...@gmail.com wrote: [snip] which some might frown at.  So another possibility would be this: given x and y, first compare the norms of x and y; if the norms are equal, compare str(x) and str(y).  I think this would make as much mathematical sense

[sage-devel] Re: Vote! factorization of some special numbers

2010-01-13 Thread javier
Big speed improvements on calculations involving small finite fields, like finding primitive elements? Possibility for automatic coercion for finite fields? And the cost is just 0.5MB of harmless plain text that doesn't even need to be compiled!? Give it a +1! Cheers J On Dec 18 2009, 11:16 pm,

[sage-devel] Re: 2 variable polynomial factorization over finite fields

2010-01-12 Thread javier
There are indeed well known (sort of) fast algorithms for factorization of multivariable polynomials over finite fields: http://portal.acm.org/citation.cfm?id=808748 http://www.jstor.org/stable/2008063?seq=1 In the second paper there is a particular (probabilistic) algorithm for bivariate

[sage-devel] Re: 2 variable polynomial factorization over finite fields

2010-01-12 Thread javier
are looking for. Alternatively, since it seems that van Hoeijs algorithm reduces to a knapsack problem, so maybe it could be easily built upon the brand new fast graphs methods that we got? Cheers J On Jan 12, 2:08 pm, YannLC yannlaiglecha...@gmail.com wrote: On Jan 12, 2:46 pm, javier vengor

[sage-devel] Re: GAP to sage conversions

2010-01-11 Thread javier
Dima, On Jan 11, 3:04 pm, Dima Pasechnik dimp...@gmail.com wrote: no, from GAP's point of view, Z(2^4)^5 is an element of GF(4). And thus b is such an element, too... then from the gap-to-sage point of view nothing else can be done. A coercion between finite fields is needed before this method

[sage-devel] Re: GAP to sage conversions

2010-01-11 Thread javier
Hi William, On Jan 12, 12:24 am, William Stein wst...@gmail.com wrote: Dumb question.  There is code in Sage already to convert from GAP's GF(p) (or GF(q)) to Sage's: you are completely right. Since at the beginning I tried to do something like sage: a = gap(Z(7)) sage: a.sage() and that

[sage-devel] Re: GAP to sage conversions

2010-01-11 Thread javier
On Jan 12, 12:47 am, William Stein wst...@gmail.com wrote: Isn't the case of non-prime fields also already in Sage?  It was in my example. The __call__ function for a non-prime field yes, was already defined. What wasn't was the conversion of a gap non-prime field into a sage prime field.

[sage-devel] Re: Implementation of conjugacy classes

2010-01-10 Thread javier
This is now Ticket #7890: http://trac.sagemath.org/sage_trac/ticket/7890 Thanks for volunteering to work on this, Dmitri! It would be awesome to be able to access all that gap functions from sage. Skimming a bit at the conversion code, it looks like the function sage is called on the gap string

[sage-devel] Re: Implementation of conjugacy classes

2010-01-10 Thread javier
Hi Simon, On Jan 10, 11:33 am, Simon King simon.k...@nuigalway.ie wrote: Well, that's a default method, i.e., if nothing else is implemented than a conversion by strings is attempted, because there is some hope that the result makes sense. So, a proper way would be to override the default

[sage-devel] Re: Implementation of conjugacy classes

2010-01-10 Thread javier
Hi all, have been hacking around a bit and finally got to this: the class GapElement doesn't have a _sage_ method, when sage() is called, it defers to the ExpectElement method, which is not aware of the fact that we have a GAP object to start with. OTOH, I observed there is a _matrix_ method

[sage-devel] Re: Implementation of conjugacy classes

2010-01-10 Thread javier
should be called. Any further work along these lines will be most welcome! Cheers J On Jan 10, 2:37 pm, Dima Pasechnik dimp...@gmail.com wrote: Javier, [...] So, it wasn't that hard (for matrices) after all. Good! I don't know whether/ how this can be applied to the E(9) thing unless

[sage-devel] GAP to sage conversions

2010-01-10 Thread javier
Hi Dmitri, On Jan 10, 5:48 pm, Dima Pasechnik dimp...@gmail.com wrote: This is not good enough. It could be that the [1,1]-element lies in a proper subring. One should either test each matrix entry and take the biggest ring, or ask GAP to do it for you. Say, if A is a GAP matrix you can do

[sage-devel] Re: GAP to sage conversions

2010-01-10 Thread javier
Traceback (most recent call last) /Users/javier/ipython console in module() /Applications/sage/local/lib/python2.6/site-packages/sage/rings/ finite_field_givaro.so in sage.rings.finite_field_givaro.FiniteField_givaro.__call__ (sage/rings/ finite_field_givaro.cpp:4466

[sage-devel] Re: Conjugacy classes: Sage vs GAP

2010-01-09 Thread javier
Hi there, I am trying to get my code moved to the source files, but am finding some problems (it is my first time!). What I did was: - cloning sage to my own branch (called sage-groups), - Added a new file $SAGE_ROOT/devel/sage-groups/sage/groups/ group_conjugacy_class.py with my class code -

[sage-devel] Implementation of conjugacy classes

2010-01-09 Thread javier
method, is it better to return a python set or a sage Set? Cheers J On Jan 9, 1:23 pm, javier vengor...@gmail.com wrote: Hi there, I am trying to get my code moved to the source files, but am finding some problems  (it is my first time!). What I did was: - cloning sage to my own branch (called

[sage-devel] Re: Conjugacy classes: Sage vs GAP

2010-01-09 Thread javier
) sage: gg = g._gap_() sage: ggg = gg.sage() --- NotImplementedError Traceback (most recent call last) /Users/javier/ipython console in module() /Applications/sage/local/lib/python2.6/site-packages/sage

[sage-devel] Re: Implementation of conjugacy classes

2010-01-09 Thread javier
Nguyen nguyenmi...@gmail.com wrote: Hi, On Sun, Jan 10, 2010 at 2:06 AM, javier vengor...@gmail.com wrote: Sorted it out, I had forgotten to import one file. Sorry for the noise. Class patches nicely now; I am just having some test failures due to different orderings of some output sets

[sage-devel] Re: Conjugacy classes: Sage vs GAP

2010-01-08 Thread javier
Hi all, I have been working on this and after a while decided that my original approach wasn't the most appropriate and started rewriting everything for scratch. After thinking about this problem making conjugacy_class a method that returns a list (or set) didn't feel right. GAP has many methods

[sage-devel] Re: Can we avoid using 'ctypes' in python?

2010-01-05 Thread javier
According to [1], sys.maxint will be removed in Py3K, so it might be safer to replace it with sys.maxsize to save us a problem in the future. [1] http://docs.python.org/3.1/whatsnew/3.0.html#integers Cheers J On Jan 4, 9:30 pm, Dr. David Kirkby david.kir...@onetel.net wrote: javier wrote

[sage-devel] Re: Easy question in Python/Sage...

2009-12-10 Thread javier
A into a Set (or set) will kill any duplicate elements that A might have, so one has to be careful with it. Cheers Javier On Dec 10, 9:02 am, Nathann Cohen nathann.co...@gmail.com wrote: Hello !!! I just tried it, and I'm actually quite surprised def diffA(a,b):     return [v for v in a if v

[sage-devel] Re: Conjugacy classes: Sage vs GAP

2009-12-03 Thread javier
) for x in G]) maybe with some added checks to deal with abelian groups (trivial conjugacy classes) and not using the naive method on infinite groups. In which file should the code be included? $SAGE_ROOT/devel/sage/sage/generic.py or somewhere else? Cheers Javier -- To post to this group, send

[sage-devel] Re: Set reorders elements

2009-11-08 Thread javier
about this. Cheers Javier --~--~-~--~~~---~--~~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com

[sage-devel] Unladen Swallow Relesae2009Q3

2009-10-29 Thread javier
anything like that, but don't know whether this is due to my particular desktop (1 processor, two cores, 32bit). Cheers Javier --~--~-~--~~~---~--~~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email

  1   2   >