Ask Your Question

GaryMak's profile - activity

2018-10-22 22:45:55 -0600 received badge  Nice Question (source)
2018-06-25 04:42:18 -0600 received badge  Self-Learner (source)
2018-06-25 04:42:18 -0600 received badge  Teacher (source)
2018-05-11 00:39:33 -0600 received badge  Popular Question (source)
2018-04-12 18:10:27 -0600 received badge  Famous Question (source)
2017-08-21 09:57:13 -0600 received badge  Popular Question (source)
2017-06-29 13:04:13 -0600 received badge  Popular Question (source)
2017-04-29 10:31:09 -0600 received badge  Popular Question (source)
2016-11-20 03:02:08 -0600 received badge  Notable Question (source)
2016-09-12 10:14:38 -0600 received badge  Famous Question (source)
2016-07-16 18:13:29 -0600 received badge  Notable Question (source)
2016-07-08 10:05:51 -0600 received badge  Famous Question (source)
2016-02-02 20:59:22 -0600 received badge  Popular Question (source)
2015-12-30 21:16:12 -0600 received badge  Famous Question (source)
2015-07-31 10:56:19 -0600 received badge  Popular Question (source)
2015-06-07 15:03:00 -0600 received badge  Notable Question (source)
2015-05-31 21:34:30 -0600 received badge  Notable Question (source)
2015-05-31 21:34:30 -0600 received badge  Popular Question (source)
2015-05-12 14:42:55 -0600 received badge  Famous Question (source)
2015-01-13 11:04:25 -0600 received badge  Taxonomist
2014-12-15 08:02:55 -0600 received badge  Notable Question (source)
2014-10-27 16:30:09 -0600 received badge  Famous Question (source)
2014-06-29 05:02:53 -0600 received badge  Popular Question (source)
2014-06-29 05:02:53 -0600 received badge  Famous Question (source)
2014-06-29 05:02:53 -0600 received badge  Notable Question (source)
2014-06-28 20:15:36 -0600 marked best answer Accuracy versus precision of algebraic number calculations

Hi everyone - another very basic question from me ...

I am doing some calculations of absolute norms of determinants of matrices whose entries come from cyclotomic fields. The (rational) numbers which are output are sensible but occasionally have massive prime numbers as factors which I was not expecting. My question is whether I can rely upon such numbers when they are output by SAGE's calculations inside a specified number field, or whether somewhere along the way some imprecision may have been introduced which results in a "distorted" prime number being a factor of the output.

Another stylized way of asking the same thing: is it possible that the answer to some question involving a small prime p might actually contain a factor of p^100, but nevertheless because of accumulated rounding errors etc I have ended up with p^100-2 which happens to be prime? Or does SAGE "know" only to output perfect answers involving algebraic number fields, even when the heights involved are that big?

Many thanks

2014-06-28 20:15:33 -0600 marked best answer Generating a Jacobian matrix for a set of multivariate polynomials

Hi I can see that this is implemented for schemes but I do not want it in such vast generality - I have a (long) list of variables vee=var('a b c d ... ') and a long list of explicit polynomials f1(vee), f2(vee), ... in those variables. What please is the neatest way in which to construct the Jacobian matrix of first derivatives in such a way that I obtain the symbolic matrix (and can calculate a symbolic determinant say), and also am able to evaluate it at a particular set of values for the variables? Thanks for any ideas.

2014-06-28 20:15:31 -0600 marked best answer Selecting matrices with only certain entries

Hi all -

a slightly more general but less ambitious version of my previous (as yet unanswered) question: http://ask.sagemath.org/question/2114...

I set up a matrix space M (for simplicity say over a finite field F) and I have a (finite) subset S of F. I need to do a search through the elements of M which satisfy certain algebraic constraints; however I only wish to study matrices whose entries ALL lie in S.

How please do I restrict to such matrices?

Many thanks in advance

2014-06-28 20:15:30 -0600 marked best answer Explicit finite field extensions

Hi I would like to know how I may explicitly create a finite field as an extension of another field which is not the prime field. For example if I have GF(25) as my base field and I would like to create GF(5^6) using a polynomial with coefficients in GF(25) etc. The problem is that if I just create the 2 fields separately, I cannot coerce elements from the big field into the little one unless it is a prime field, and it seems that the galois_group() stuff only works for number field extensions. Sorry if I've missed the obvious. thanks a lot

2014-06-28 20:15:28 -0600 marked best answer How do I "tidy up" error terms in a matrix?

Hi - I have some calculation results in the form of a complex Gram matrix which are all supposed to be integers (or "obvious" algebraic numbers which I know about). However inevitably in the course of creating them as inner products, some "error" terms arise which are of a size of the order of 10^-16 (real and/or complex). Is there an easy way to "clean up" my matrix with some sort of threshold, so that things which differ from a user-specified list of algebraic numbers by less than a tiny amount like 10^-15, are assumed to be the relevant algebraic number? At the moment I'm having to do it by a bunch of hideous if-statement contortions but I'm sure there's a better way! Many thanks in advance for any help.

2014-06-28 20:15:00 -0600 marked best answer How to recognise DiGraph equivalence

Hi - I am trying to check that a "manual" calculation I did on posets is correct.

my starting point is a Matlab-generated upper-triangular 60x60 adjacency matrix M representing a DiGraph G or P=Poset(G); I have generated a minimal (ie covering relations only) 60x60 adjacency matrix from it in two ways. First by letting SAGE reduce it using PP=P.cover_relations(), and the other by reducing M "manually" in Matlab, then exporting that matrix Q to SAGE and using the same function on it to get it into the same format. I would like to show PP=Q in some sense.

I tried to check equality (==) between the graph objects, and the posets, and the graphs/posets obtained by re-setting the output of the cover_relations function to be a DiGraph all over again, and even setting those things to be adjacency matrices ... but even though I have laboriously checked that the 2 objects ARE indeed the same (by comparing the edges one-by-one), I nevertheless cannot get SAGE to agree!!

The output of the cover_relations function seems to be the sticking point - it is a sort-of matrix but not with any consistent ordering of the edges - hence even though the sets of edges are clearly the same, the different ordering seems to throw the comparison function off.

What am I missing please?

Thanks

2014-06-28 20:14:25 -0600 marked best answer How do I save my "workspace" in the notebook?

Hi - another one of my IT-naive questions ... I have some notebook worksheets which do massive preliminary calcs before then embarking on even more massive subsequent search calcs (among the results of the first code module). Is there a way of saving the results of the first calcs so that I may call them in and run the second module on them, without having to generate them all over again every time?

Thanks a lot for any help out there ....

2014-06-28 20:14:24 -0600 marked best answer Extension/coercion of finite rings & fields

Hi ...

again harping on my theme of p-adics: here is a characteristic-p toy model of the problem I had here. Will someone please tell me how to do what this code is trying to do?!!

sage: K.<X> = GF(3^2,name='X'); # creates (residue) field which is GF(3)[X]
sage: R = IntegerModRing(3^2)[X];  # extends Z/p^2 by that same X to form quadratic extn - seemingly successfully
sage: print R(X+5); # I try to use X but it still treats it like an "alien" quantity in R ....

thanks!!

2014-06-02 05:45:12 -0600 received badge  Notable Question (source)
2014-04-22 11:07:06 -0600 received badge  Popular Question (source)
2014-01-30 06:17:21 -0600 received badge  Popular Question (source)
2013-12-10 01:55:41 -0600 received badge  Popular Question (source)
2013-09-29 01:31:34 -0600 received badge  Notable Question (source)
2013-08-02 19:58:02 -0600 received badge  Popular Question (source)
2013-07-06 09:40:02 -0600 marked best answer Generating a Jacobian matrix for a set of multivariate polynomials

Am I missing something? I feel like I'm under-interpreting your question with this answer.

sage: var('a,b,c,d')
(a, b, c, d)
sage: f1 = a*b+c^2+d
sage: f2 = b+c^2+d*8
sage: f3 = b+c^2+c*8
sage: f4 = d*b+c+c*8
sage: jacobian( [f1,f2,f3,f4], [a,b,c,d])
[      b       a     2*c       1]
[      0       1     2*c       8]
[      0       1 2*c + 8       0]
[      0       d       9       b]
2013-05-11 05:33:49 -0600 received badge  Notable Question (source)
2013-04-23 21:27:15 -0600 marked best answer Accuracy versus precision of algebraic number calculations

Fields of algebraic nature (like RationalField, NumberField, AlgebraicField, AlgebraicRealField) are assumed to be exact, hence no rounding is done there. You can check that there was no conversion done along the algorithm you used by testing you result with the method .parent(). If you get fields like Symbolic Ring, RealDoubleField, RealField, then the algorithm you used did some rounding. You can check that a given field is exact with the .is_exact() method. You could have a look at this question for a bigger list of fields.

For example, if you try

sage: (1/7)^100000

you will get an exact rational with a huge denominator, not a floating approximation.

When you speak about having a result like p^100-2 instead of p^100, maybe you want to speak about overflow problems, not rounding problems. This could happen if you don't have enough memory, but then you you should get an error, not a wrong answer. For example,

sage: b = (1/7)^10000000000
RuntimeError: Segmentation fault

Note also that relying on the result does not only depend on whether roundings and overflow may happen, but also related to the existence of bugs in Sage, if you are convinced Sage didn't give you the right result, maybe you found one, so please report it ;)