Ask Your Question

Snark's profile - activity

2023-05-29 05:43:02 +0200 received badge  Famous Question (source)
2020-07-07 14:45:32 +0200 received badge  Notable Question (source)
2020-07-07 14:45:32 +0200 received badge  Popular Question (source)
2019-04-18 19:57:05 +0200 received badge  Notable Question (source)
2019-04-18 19:57:05 +0200 received badge  Popular Question (source)
2017-03-28 16:02:37 +0200 received badge  Necromancer (source)
2017-03-28 16:02:37 +0200 received badge  Teacher (source)
2015-02-16 14:59:11 +0200 received badge  Student (source)
2013-03-24 08:55:53 +0200 answered a question Rational reconstruction in ring of integers

I finally found the time to think about the matter and look for a solution. Let us say I'm interested in an element $z$ in the integer ring of a number field $\mathbb K$; then if that field is Galois and I have an approximation of all complex embeddings of $z$, I can get a hold of the precise element by multiplying my approximations as a vector-column by the Minkowski embedding of the field to the left. Just take the nearest integer in each component and this gives an expression of the exact element which corresponds to the approximations.

An example is worth thousands words:

K.<a>=NumberField(x**2-2)
K.Minkowski_embedding()**(-1)*matrix(2,1,[477.6,0.1]) # this gives almost the element
(239-169*a).complex_embeddings() # check that it's looking good

(Added later) I must add that this example shows that a single embedding/approximation won't be enough : as you see the approximation $0.1$ could be an approximation of zero or of $239-169\sqrt2$, and there's no way to tell which.

2013-01-10 07:36:35 +0200 commented answer Rational reconstruction in ring of integers

What you say is nice, but explains how to obtain numerical approximations of known elements of a number field given an embedding. The question is about the converse: given a numerical approximation, how to find out the element?

2012-12-25 15:14:36 +0200 asked a question Rational reconstruction in ring of integers

I was wondering how to do the following in sage: let's say I have a number field $F$, an embedding $i$ of that field in the complex numbers, and an algebraic integer $\alpha\in F$, for which I know $i(\alpha)$ with good numerical precision. How can I find the exact value?

2012-11-29 03:18:18 +0200 commented answer Quotienting a ring of integers

Ah, yes! That definitely helps! If you edit your answer to include that, I'll gladly accept it as a valid answer. Thanks!

2012-11-23 07:25:06 +0200 commented answer Quotienting a ring of integers

Ah, this "residue_field" method is a nice catch, I hadn't seen it -- but the problem is that for the examples I have in mind, the number field might not be quadratic, and the ideals might not be prime ; the first isn't a problem with residue_field, while the second point is a no-go. I like your answer but it doesn't solve what I want. :-(

2012-11-22 03:12:01 +0200 commented question Partial fraction decomposition over the reals or complex

I don't know how to do the computation like you ask, but I can tell you why it's not exact: you're working over CC, so you're asking for a numerical answer.

2012-11-22 01:52:30 +0200 asked a question Quotienting a ring of integers

I was trying to play within the ring of integers of a number field, when I decided to quotient by an ideal. It raised an "IndexError: the number of names must equal the number of generators" exception, which was quite unexpected ; here is an example:

K=NumberField(x**2+1,x)
O=K.ring_of_integers()
O.quo(O.ideal(3))

as you see, I'm using the same ring to define the ideal I want to quotient with, so there is mathematically no problem... so I think either I found a bug or something needs to be documented better. How does one work in a quotient of a ring of integers?

2012-06-23 11:29:01 +0200 commented answer What is unhandled Sigsegv

Yes, that is why I pointed him to finding the precise piece of problematic of data. The testfct function seems especially suspicious.

2012-06-23 11:26:02 +0200 received badge  Editor (source)
2012-06-23 08:53:44 +0200 answered a question Levels and special Hecke operators in computations

Blah, of course I missed something obvious : that lowering trick only works for character modular spaces when the character comes from below. That is not the case here.

EDIT: the new computation is with a character, coming from below.

2012-06-22 09:26:03 +0200 commented answer What is unhandled Sigsegv

Well, I wouldn't say this proves nonneg is the problem ; just that not using it makes the problem disappear : as the comments to the question said, the error message is about a crash out of python, and nonneg is python (and very simple). I propose you to modify your for i loop to add an inner try: except: print i to try to find which data point is the problem, then compute the various things appearing in your loop by hand one by one, so you find what the real problem is.

2012-06-22 02:59:42 +0200 received badge  Supporter (source)
2012-06-21 14:06:38 +0200 asked a question Levels and special Hecke operators in computations

Here is a sample computation which puzzles me:

sage: S36=ModularForms(Gamma1(36)).cuspidal_subspace(); S36
Cuspidal subspace of dimension 17 of Modular Forms space of dimension 56 for Congruence Subgroup Gamma1(36) of weight 2 over Rational Field
sage: T2=S36.T(2)
sage: T3=S36.T(3)
sage: f=S36.gens()[0]
sage: f.level()
36
sage: g=T2(f)
sage: g.level()
36
sage: g.is_old()
False
sage: g=T3(f)
sage: g.level()
36
sage: g.is_old()
False

In level 36, I was expecting T(2) and T(3) to be special Hecke operators, and hence to lower the level respectively to 18 and 12 (this is lemma 1 in Li's 1975 article in Math.Ann., where they're U_2 and U_3); but according to sage, the level is still 36, and it doesn't recognize them as coming from below.

Did I miss something obvious?

EDIT:

sage: chi=DirichletGroup(8).1
sage: E=ModularForms(chi.extend(8*49)).cuspidal_subspace()
sage: f=E.gens()[0]
sage: U7=E.T(7)
sage: g=U7(f)
sage: print ((g.level(),g.is_old()))
(392, False)
sage: g
0

This time I have been more careful, and I'm still puzzled.

2012-06-21 14:00:16 +0200 answered a question How to define an element in a space of Modular Forms and express it as a linear combination of basis elements?
  1. It is not really a sage question, so I'll pass (let's just say that it's a theta series, so there's a quadratic form hidden).
  2. You just need $\Theta(q)=a+bq+O(q^2)$, because then in terms of basis given by sage, it will be $a$ times the first plus $b$ times the second.
  3. More generally, sage gives basis in a form that makes it pretty easy to read a conjectural linear combination from the first terms of the expansion ; if you already know you got the expansion from a modular forms in the right space, that will be enough to know the equality.

EDIT: you might be interested by the method find_in_space from the modular spaces objects.