Ask Your Question

bd's profile - activity

2019-06-09 11:29:37 +0100 asked a question Directory problems

Hi everybody. I would like to create some kind of structure(packages) in sage. Let's say I have the following directory structure:

  • Main_Dir which contains:
    • subdirectories [Dir_A, Dir_B, ...,Test ]
      • Dir_A contains some sage files/classes
        • file1.sage, file2.sage. In file1.sage I have load('file2.sage')
      • My Test directory is the place where I would like to test all the functions I have created. It contains some test files
        • test1.sage, test2.sage, ...., assemble_all.sage.
          • In test1.sage I have the line load('../Dir_A/file1.sage').

And here I got the following error: raise IOError('did not find file %r to load or attach' % filename) IOError: did not find file './file2.sage' to load or attach

I hope somebody has an answer to this kind of problems.

2019-06-09 11:28:44 +0100 asked a question Create new sage project

Hi everybody. I would like to create some kind of structure(packages) in sage. Let's say I have the following directory structure:

  • Main_Dir which contains:
    • subdirectories [Dir_A, Dir_B, ...,Test ]
      • Dir_A contains some sage files/classes
        • file1.sage, file2.sage. In file1.sage I have load('file2.sage')
      • My Test directory is the place where I would like to test all the functions I have created. It contains some test files
        • test1.sage, test2.sage, ...., assemble_all.sage.
          • In test1.sage I have the line load('../Dir_A/file1.sage').

And here I got the following error: raise IOError('did not find file %r to load or attach' % filename) IOError: did not find file './file2.sage' to load or attach

I hope somebody has an answer to this kind of problems.

2018-02-18 15:15:17 +0100 asked a question Pullback of ideals

Hi. I have the the following question and I hope that somebody of you has a good idea for the implementation and an explanation of the error.

Offset:

  • A number field K (in general non Galois)

  • L the Galois closure of K

  • phi: K --> L an arbitrary embedding of K into L

  • I a fractional ideal in K and IL = phi(I)

Question: How to compute the pullback of IL for (general) fractional ideals of K?

My approach:

  • Let V, W be two QQ vector spaces and f: V --> W a linear map (morphism). Let further V' and W' be subspaces of V and W.

  • The aim is to identify the subspace V' = f^(-1)(W') as the preimage of W' under f.

  • Let p: V x W' --> W be a linear map definied by (v,w')|--> f(v) - w' with

    ker(p):={(v,w')in V x W'| f(v)-w' = 0_W} = {(v,w'): f(v) = w'}.

Such vectors v are the vectors in the preimage of W'.

def inverseImage(IL, K, phi):
    ZK = K.maximal_order()
    dK = K.degree()
    BZK = ZK.basis()
    M = Matrix(QQ, [ list(phi(b)) for b in BZK ])
    BJ = IL.basis()
    N = Matrix(QQ, [ list(b) for b in BJ ])
    vs = M.stack(N).integer_kernel().basis()

    BI = [ sum([ v[i]*BZK[i] for i in [0..(dK - 1)] ]) for v in vs ]
    IK = ZK.fractional_ideal([num_IL/denom_IL, BI])
    return IK

EXAMPLE 1:

sage: K = NumberField(x^6 - 2*x^5 - 6*x^3 + 151*x^2 + 76*x + 861, 'a')
sage: L.<b> = K.galois_closure()
sage: phi = K.embeddings(L)[1]
sage: I = K.fractional_ideal([129, x - 54])
sage: I_ = inverseImage(IL, K, phi)
sage: I_ == I
TRUE

EXAMPLE 2 (and the first problem, loosing the denominator)

sage: I = K.fractional_ideal([2/3]) 
sage: I
Fractional ideal (2/3)
sage: I_ =  inverseImage(phi(I), K, phi)
sage: I_
Fractional ideal (2)
sage: I == I_
FALSE

My improvement approach:

...
num_IL = IL.numerator().gens()[0]
denom_IL = IL.denominator().gens()[0]
IK = ZK.fractional_ideal([num_IL/denom_IL, BI])
return IK

Now EXAMPLE 2 returns the corresponding fractional ideal I_ BUT with an incorrect ideal I_ in EXAMPLE 1. Thanks for helping!

2017-12-06 22:37:56 +0100 received badge  Student (source)
2017-12-05 19:58:40 +0100 received badge  Scholar (source)
2017-12-05 19:54:39 +0100 received badge  Editor
2017-12-05 19:53:37 +0100 answered a question Morphism between Klein four group and additive abelian group or order 4

Thank you for the fast answer. C is the always the class group of a quartic/sextic CM filed and G is the corresponding abstract group "printed by sage". Yes, I assume that I have to construct the inverse image too.

2017-12-05 11:03:14 +0100 asked a question Morphism between Klein four group and additive abelian group or order 4

Hi. Let's say I have an ideal class C with structure G := C2 x C2. I want now to construct a morphism phi: G --> C, s.t. phi(g1) = c1 and phi(g2) = c2.