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.Tue, 21 May 2024 21:47:43 +0200Strange result with homomorphism between Laurent polynomial ringshttps://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/I am trying to perform a certain computation in group theory. I start with a finitely presented group G, and I compute its Alexander matrix using the built-in method. This gives me a matrix over a multivariate Laurent polynomial ring with generators f4 and f5; I then apply a homomorphism "bar" which sends each of these to the generator t of a univariate Laurent polynomial ring.
F.<a,b,c,x,y> = FreeGroup()
G = F/[a*c*(c*a)^-1,a*x*(x*a)^-1,y*c*(c*y)^-1,x*y*x*(y*x*y)^-1,b*a*y*(y*b*a)^-1,(a*b*a*y)*(y*b*a*b)^-1,c*b*x*(x*c*b)^-1,b*c*b*x*(x*c*b*c)^-1]
M = G.abelian_alexander_matrix()[0]
R.<t> = LaurentPolynomialRing(QQ)
bar = M.base_ring().hom([t,t])
Mbar = matrix([[bar(x) for x in m] for m in M])
The baffling thing to me is that bar seems to be malfunctioning. For instance, the (0,0) entry of M is 1-f4, but the (0,0) entry of Mbar is t^-1 - 1. Pretty much the entirety of M/Mbar is like this: it seems like the entries in Mbar are correct only up to multiplication by some power of t, which is not uniform across Mbar. If I directly ask bar to evaluate 1-f4, it correctly returns 1-t.
Does anybody know what's going on, and how to fix it? Thanks!Tue, 21 May 2024 14:30:49 +0200https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/Comment by FrédéricC for <p>I am trying to perform a certain computation in group theory. I start with a finitely presented group G, and I compute its Alexander matrix using the built-in method. This gives me a matrix over a multivariate Laurent polynomial ring with generators f4 and f5; I then apply a homomorphism "bar" which sends each of these to the generator t of a univariate Laurent polynomial ring. </p>
<pre><code>F.<a,b,c,x,y> = FreeGroup()
G = F/[a*c*(c*a)^-1,a*x*(x*a)^-1,y*c*(c*y)^-1,x*y*x*(y*x*y)^-1,b*a*y*(y*b*a)^-1,(a*b*a*y)*(y*b*a*b)^-1,c*b*x*(x*c*b)^-1,b*c*b*x*(x*c*b*c)^-1]
M = G.abelian_alexander_matrix()[0]
R.<t> = LaurentPolynomialRing(QQ)
bar = M.base_ring().hom([t,t])
Mbar = matrix([[bar(x) for x in m] for m in M])
</code></pre>
<p>The baffling thing to me is that bar seems to be malfunctioning. For instance, the (0,0) entry of M is 1-f4, but the (0,0) entry of Mbar is t^-1 - 1. Pretty much the entirety of M/Mbar is like this: it seems like the entries in Mbar are correct only up to multiplication by some power of t, which is not uniform across Mbar. If I directly ask bar to evaluate 1-f4, it correctly returns 1-t. </p>
<p>Does anybody know what's going on, and how to fix it? Thanks!</p>
https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?comment=77568#post-id-77568and the extension works
sage: exbar=bar.extend_to_fraction_field()
sage: exbar(M[0,0])
1 - tTue, 21 May 2024 21:25:58 +0200https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?comment=77568#post-id-77568Comment by FrédéricC for <p>I am trying to perform a certain computation in group theory. I start with a finitely presented group G, and I compute its Alexander matrix using the built-in method. This gives me a matrix over a multivariate Laurent polynomial ring with generators f4 and f5; I then apply a homomorphism "bar" which sends each of these to the generator t of a univariate Laurent polynomial ring. </p>
<pre><code>F.<a,b,c,x,y> = FreeGroup()
G = F/[a*c*(c*a)^-1,a*x*(x*a)^-1,y*c*(c*y)^-1,x*y*x*(y*x*y)^-1,b*a*y*(y*b*a)^-1,(a*b*a*y)*(y*b*a*b)^-1,c*b*x*(x*c*b)^-1,b*c*b*x*(x*c*b*c)^-1]
M = G.abelian_alexander_matrix()[0]
R.<t> = LaurentPolynomialRing(QQ)
bar = M.base_ring().hom([t,t])
Mbar = matrix([[bar(x) for x in m] for m in M])
</code></pre>
<p>The baffling thing to me is that bar seems to be malfunctioning. For instance, the (0,0) entry of M is 1-f4, but the (0,0) entry of Mbar is t^-1 - 1. Pretty much the entirety of M/Mbar is like this: it seems like the entries in Mbar are correct only up to multiplication by some power of t, which is not uniform across Mbar. If I directly ask bar to evaluate 1-f4, it correctly returns 1-t. </p>
<p>Does anybody know what's going on, and how to fix it? Thanks!</p>
https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?comment=77567#post-id-77567In contrast, the following simpler case works
sage: Lab=LaurentPolynomialRing(QQ,'a,b')
sage: a,b=Lab.gens()
sage: f=1-a
sage: t=LaurentPolynomialRing(QQ,'t').gen()
sage: bar=Lab.hom([t,t])
sage: bar(a),bar(b),bar(f)
(t, t, 1 - t)Tue, 21 May 2024 21:06:23 +0200https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?comment=77567#post-id-77567Comment by FrédéricC for <p>I am trying to perform a certain computation in group theory. I start with a finitely presented group G, and I compute its Alexander matrix using the built-in method. This gives me a matrix over a multivariate Laurent polynomial ring with generators f4 and f5; I then apply a homomorphism "bar" which sends each of these to the generator t of a univariate Laurent polynomial ring. </p>
<pre><code>F.<a,b,c,x,y> = FreeGroup()
G = F/[a*c*(c*a)^-1,a*x*(x*a)^-1,y*c*(c*y)^-1,x*y*x*(y*x*y)^-1,b*a*y*(y*b*a)^-1,(a*b*a*y)*(y*b*a*b)^-1,c*b*x*(x*c*b)^-1,b*c*b*x*(x*c*b*c)^-1]
M = G.abelian_alexander_matrix()[0]
R.<t> = LaurentPolynomialRing(QQ)
bar = M.base_ring().hom([t,t])
Mbar = matrix([[bar(x) for x in m] for m in M])
</code></pre>
<p>The baffling thing to me is that bar seems to be malfunctioning. For instance, the (0,0) entry of M is 1-f4, but the (0,0) entry of Mbar is t^-1 - 1. Pretty much the entirety of M/Mbar is like this: it seems like the entries in Mbar are correct only up to multiplication by some power of t, which is not uniform across Mbar. If I directly ask bar to evaluate 1-f4, it correctly returns 1-t. </p>
<p>Does anybody know what's going on, and how to fix it? Thanks!</p>
https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?comment=77561#post-id-77561Using
M.apply_map(lambda cf:cf(t,t))
seems to work.Tue, 21 May 2024 15:04:27 +0200https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?comment=77561#post-id-77561Answer by FrédéricC for <p>I am trying to perform a certain computation in group theory. I start with a finitely presented group G, and I compute its Alexander matrix using the built-in method. This gives me a matrix over a multivariate Laurent polynomial ring with generators f4 and f5; I then apply a homomorphism "bar" which sends each of these to the generator t of a univariate Laurent polynomial ring. </p>
<pre><code>F.<a,b,c,x,y> = FreeGroup()
G = F/[a*c*(c*a)^-1,a*x*(x*a)^-1,y*c*(c*y)^-1,x*y*x*(y*x*y)^-1,b*a*y*(y*b*a)^-1,(a*b*a*y)*(y*b*a*b)^-1,c*b*x*(x*c*b)^-1,b*c*b*x*(x*c*b*c)^-1]
M = G.abelian_alexander_matrix()[0]
R.<t> = LaurentPolynomialRing(QQ)
bar = M.base_ring().hom([t,t])
Mbar = matrix([[bar(x) for x in m] for m in M])
</code></pre>
<p>The baffling thing to me is that bar seems to be malfunctioning. For instance, the (0,0) entry of M is 1-f4, but the (0,0) entry of Mbar is t^-1 - 1. Pretty much the entirety of M/Mbar is like this: it seems like the entries in Mbar are correct only up to multiplication by some power of t, which is not uniform across Mbar. If I directly ask bar to evaluate 1-f4, it correctly returns 1-t. </p>
<p>Does anybody know what's going on, and how to fix it? Thanks!</p>
https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?answer=77569#post-id-77569Not an answer, but a somewhat minimal example. Looks like a bug indeed. Would you please open an issue on sage's github ?
sage: F.<a,c> = FreeGroup()
....: G = F/[a*c*(c*a)^-1]
....: m = G.abelian_alexander_matrix()[0][0,0];m
....: R.<t> = LaurentPolynomialRing(QQ)
-f2 + 1
sage: bar=m.parent().hom([t,t])
sage: bar(m)
t^-1 - 1Tue, 21 May 2024 21:47:43 +0200https://ask.sagemath.org/question/77559/strange-result-with-homomorphism-between-laurent-polynomial-rings/?answer=77569#post-id-77569