ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 02 Feb 2019 15:25:02 +0100How to get list of relative primes for a given number?https://ask.sagemath.org/question/45274/how-to-get-list-of-relative-primes-for-a-given-number/How to get list of relative primes for a given number? Is there any direct sage function?SenthilSat, 02 Feb 2019 15:25:02 +0100https://ask.sagemath.org/question/45274/Error: 'Object has no attribute 'intersection''https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/Hi, I am pretty new to SAGE and and am not understanding why my code keeps giving me the error **'RelativeOrder_with_category' object has no attribute 'intersection'**. Here is my code:
sage: P1=x^3-x^2-4*x-1
sage: P2=x^3+x^2-2*x-1
sage: K1.<p>=NumberField(P1)
sage: K2.<d>=NumberField(P2)
sage: K.<p,d>=ExtensionField(K1,P2)
sage: O_K=K.ring_of_integers()
sage: A_K1=O_K.intersection(K1)
AttributeError: 'RelativeOrder_with_category' object has no attribute 'intersection'
I have looked at a lot of examples from other questions, but I can't seem to find a solution.
northcity4Mon, 01 Oct 2018 08:51:51 +0200https://ask.sagemath.org/question/43799/Problem in Relative Homology Computation ?https://ask.sagemath.org/question/42676/problem-in-relative-homology-computation/ I am trying to understand how to compute relative homologies between cubical complexes and a given subcomplex. Consider the cubical complex of the elementary cube [0,1]x[0,1],defined via:
Square = CubicalComplex([([0,1],[0,1])])
I further refer to the edges ofthe complex as:
First Edge: [0,0] x [0,1]
Second Edge: [0,1] x [1,1]
Third Edge: [1,1] x [0,1]
Fourth Edge: [0,1] x [0,0]
Imagine labeling the edges of a square in a clockwise fashion, with the vertical leftmost one being the first edge.
When i try to compute the relative homology of Square in relation to the subcomplex generated by the First, Second and Third edges, i do:
FirstandSecondandThirdEdges = CubicalComplex([([0,0],[0,1]),([0,1],[1,1]),([1,1],[0,1])])
Then, the calculation of the homology
Square.homology(subcomplex=FirstandSecondandThirdEdges,reduced=False)
and the result is: {0: 0, 1: Z, 2: Z} (which I suspect is wrong).
In order to calculate the homology in relation to the subcomplex generated by the First ,Third and Fourth edges, i first define:
FirstandThirdandFourthEdges = CubicalComplex([([0,0],[0,1]),([0,1],[0,0]),([1,1],[0,1])])
To calculate the relative homology:
Square.homology(subcomplex=FirstandThirdandFourthEdges,reduced=False)
And the result is: {0: 0, 1: 0, 2: 0}.
I am not experienced with homology calculations, but I believe the two results should be the same, since the latter configuration is just a rotation of the first one by 180 degrees.I also believe that the right result should given by {0: 0, 1: 0, 2: 0} in both cases, which is the same as considering the relative homology of Square and a single arbitrary edge. Are these calculations correct ? Is my intuition wrong about these two relative homologies groups?
If anyone could point out some mistake, I would very much appreciate :)D7-BraneWed, 20 Jun 2018 01:22:06 +0200https://ask.sagemath.org/question/42676/Homomorphisms for relative number fieldshttps://ask.sagemath.org/question/24173/homomorphisms-for-relative-number-fields/How can I define a homomorphism from a relative number field *K* (containing *F*)
to some other field *L* if I know where to send *K.gens()*?
**Example:**
F_pol = x^2-x-1
F = NumberField(F_pol, 'lam')
K_pol = x^2 + 4
K = F.extension(K_pol, 'e')
L = QQbar
lam_im = L(F_pol.roots()[1][0])
e_im = L(K_pol.roots()[1][0])
**Wrong result:**
K.hom([e_im], QQbar, check=False)
**What we want (not working):**
K.hom([e_im, lam_im], QQbar, check=False)
**A working solution (edit):**
K.Hom(L)(e_im, F.hom([lam_im], check=False))
New question/example: What if L is not exact?
----
x = PolynomialRing(QQ,'x').gen()
F_pol = x^3 - x^2 - 2*x + 1
F.<lam> = NumberField(F_pol, 'lam')
D = 4*lam^2 + 4*lam - 4
K_pol = x^2 - D
K = F.extension(K_pol, 'e')
L = CC
lam_im = F_pol.roots(L)[2][0]
e_im = F.hom([lam_im], check=False)(D).sqrt()
K.Hom(L)(e_im, F.hom([lam_im], check=False), check=False)
This gives the error:
TypeError: images do not define a valid homomorphismjjThu, 18 Sep 2014 03:36:11 +0200https://ask.sagemath.org/question/24173/