diff --git a/src/sage/algebras/askey_wilson.py b/src/sage/algebras/askey_wilson.py index 2b90a67c4eb..d8fa596187f 100644 --- a/src/sage/algebras/askey_wilson.py +++ b/src/sage/algebras/askey_wilson.py @@ -700,8 +700,8 @@ def loop_representation(self): sage: pi = AW.loop_representation() sage: A,B,C,a,b,g = [pi(gen) for gen in AW.algebra_generators()] sage: A - [ 1/q*lambda^-1 + q*lambda ((-q^2 + 1)/q)*lambda^-1 + ((q^2 - 1)/q)] - [ 0 q*lambda^-1 + 1/q*lambda] + [1/q*lambda^-1 + q*lambda ((-q^2 + 1)/q)*lambda^-1 + ((q^2 - 1)/q)] + [ 0 q*lambda^-1 + 1/q*lambda] sage: B [ q*lambda^-1 + 1/q*lambda 0] [((-q^2 + 1)/q) + ((q^2 - 1)/q)*lambda 1/q*lambda^-1 + q*lambda] diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py b/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py index a3311085ca5..022cd2bb9aa 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py @@ -937,18 +937,18 @@ def _image_on_basis(self, basis_element): sage: CHA3. = algebras.CubicHecke(3) sage: MS = chmr.CubicHeckeMatrixSpace(CHA3, original=True) sage: MS._image_on_basis(c1) - [ a 0 0 0 0 0 0 0 0 0 0 0] - [ 0 c 0 0 0 0 0 0 0 0 0 0] - [ 0 0 b 0 0 0 0 0 0 0 0 0] - [ 0 0 0 b 0 0 0 0 0 0 0 0] - [ 0 0 0 b*c c 0 0 0 0 0 0 0] - [ 0 0 0 0 0 a 0 0 0 0 0 0] - [ 0 0 0 0 0 a*b b 0 0 0 0 0] - [ 0 0 0 0 0 0 0 a 0 0 0 0] - [ 0 0 0 0 0 0 0 a*c c 0 0 0] - [ 0 0 0 0 0 0 0 0 0 c 0 0] - [ 0 0 0 0 0 0 0 0 0 b^2 + a*c b 0] - [ 0 0 0 0 0 0 0 0 0 b 1 a] + [a 0 0 0 0 0 0 0 0 0 0 0] + [0 c 0 0 0 0 0 0 0 0 0 0] + [0 0 b 0 0 0 0 0 0 0 0 0] + [0 0 0 b 0 0 0 0 0 0 0 0] + [0 0 0 b*c c 0 0 0 0 0 0 0] + [0 0 0 0 0 a 0 0 0 0 0 0] + [0 0 0 0 0 a*b b 0 0 0 0 0] + [0 0 0 0 0 0 0 a 0 0 0 0] + [0 0 0 0 0 0 0 a*c c 0 0 0] + [0 0 0 0 0 0 0 0 0 c 0 0] + [0 0 0 0 0 0 0 0 0 b^2 + a*c b 0] + [0 0 0 0 0 0 0 0 0 b 1 a] """ representation_type = self._representation_type ch_algebra = self._cubic_hecke_algebra diff --git a/src/sage/algebras/quantum_oscillator.py b/src/sage/algebras/quantum_oscillator.py index 910c27ba98a..9ad141d76d1 100644 --- a/src/sage/algebras/quantum_oscillator.py +++ b/src/sage/algebras/quantum_oscillator.py @@ -111,9 +111,9 @@ class QuantumOscillatorAlgebra(CombinatorialFreeModule): sage: quantum_det(pi121) 1 # 1 # 1 sage: pi212 = build_repr([2,1,2], [pi1, pi2]); pi212 - [ 1 # a- # 1 1 # k # a- 1 # k # k] - [ -q*a- # k # 1 a- # a+ # a- - q*k # 1 # k a- # a+ # k + k # 1 # a+] - [ q^2*k # k # 1 -q*k # a+ # a- - q*a+ # 1 # k -q*k # a+ # k + a+ # 1 # a+] + [ 1 # a- # 1 1 # k # a- 1 # k # k] + [-q*a- # k # 1 a- # a+ # a- - q*k # 1 # k a- # a+ # k + k # 1 # a+] + [q^2*k # k # 1 -q*k # a+ # a- - q*a+ # 1 # k -q*k # a+ # k + a+ # 1 # a+] sage: quantum_det(pi212) 1 # 1 # 1 diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py index 425b820a069..c6261ef7590 100644 --- a/src/sage/calculus/calculus.py +++ b/src/sage/calculus/calculus.py @@ -133,8 +133,8 @@ [x^2 + x 2*x^3] [ 2 x^2 + x] sage: e^M - [ 1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))] - [ 1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2) 1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))] + [ 1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x)) 1/2*(x*e^(2*sqrt(x)) - x)*sqrt(x)*e^(x - sqrt(x))] + [1/2*(e^(2*sqrt(x)) - 1)*e^(x - sqrt(x))/x^(3/2) 1/2*(e^(2*sqrt(x)) + 1)*e^(x - sqrt(x))] Complex exponentiation works, but may require a patched version of maxima (:issue:`32898`) for now:: diff --git a/src/sage/categories/discrete_valuation.py b/src/sage/categories/discrete_valuation.py index 9ceeb218eae..2cc57541b8e 100644 --- a/src/sage/categories/discrete_valuation.py +++ b/src/sage/categories/discrete_valuation.py @@ -288,10 +288,10 @@ def _matrix_hessenbergize(self, H): [t^3 + O(t^10) t^4 + O(t^10) t^5 + O(t^10) t^6 + O(t^10)] sage: H.hessenbergize() sage: H - [ 1 + O(t^10) t + t^3 + t^5 + O(t^10) t^2 + O(t^10) t^3 + O(t^10)] - [ t + O(t^10) t^2 + t^4 + t^6 + O(t^10) t^3 + O(t^10) t^4 + O(t^10)] - [ O(t^10) O(t^10) O(t^10) O(t^10)] - [ O(t^10) O(t^10) O(t^10) O(t^10)] + [1 + O(t^10) t + t^3 + t^5 + O(t^10) t^2 + O(t^10) t^3 + O(t^10)] + [t + O(t^10) t^2 + t^4 + t^6 + O(t^10) t^3 + O(t^10) t^4 + O(t^10)] + [ O(t^10) O(t^10) O(t^10) O(t^10)] + [ O(t^10) O(t^10) O(t^10) O(t^10)] Another example over the `p`-adics:: diff --git a/src/sage/combinat/root_system/plot.py b/src/sage/combinat/root_system/plot.py index 1ffa81daf78..c8f00b3397c 100644 --- a/src/sage/combinat/root_system/plot.py +++ b/src/sage/combinat/root_system/plot.py @@ -1557,9 +1557,9 @@ def barycentric_projection_matrix(n, angle=0): Four vectors in dimension 3:: sage: m = barycentric_projection_matrix(3); m - [ 1/3*sqrt(3)*sqrt(2) -1/3*sqrt(3)*sqrt(2) 0 0] - [ 1/3*sqrt(2) 1/3*sqrt(2) -2/3*sqrt(2) 0] - [ 1/3 1/3 1/3 -1] + [1/3*sqrt(3)*sqrt(2) -1/3*sqrt(3)*sqrt(2) 0 0] + [ 1/3*sqrt(2) 1/3*sqrt(2) -2/3*sqrt(2) 0] + [ 1/3 1/3 1/3 -1] The columns give four vectors that sum up to zero:: diff --git a/src/sage/combinat/sf/hall_littlewood.py b/src/sage/combinat/sf/hall_littlewood.py index 0c6cff05757..f44a93d054e 100644 --- a/src/sage/combinat/sf/hall_littlewood.py +++ b/src/sage/combinat/sf/hall_littlewood.py @@ -496,9 +496,9 @@ def transition_matrix(self, basis, n): [ 0 0 0 0 1] sage: HLQ = Sym.hall_littlewood().Q() sage: HLQ.transition_matrix(s,3) - [ -t + 1 t^2 - t -t^3 + t^2] - [ 0 t^2 - 2*t + 1 -t^4 + t^3 + t^2 - t] - [ 0 0 -t^6 + t^5 + t^4 - t^2 - t + 1] + [-t + 1 t^2 - t -t^3 + t^2] + [ 0 t^2 - 2*t + 1 -t^4 + t^3 + t^2 - t] + [ 0 0 -t^6 + t^5 + t^4 - t^2 - t + 1] sage: HLQp = Sym.hall_littlewood().Qp() sage: HLQp.transition_matrix(s,3) [ 1 0 0] diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py index ed7f3d15de7..22be40a4eb1 100644 --- a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py @@ -5208,14 +5208,12 @@ def multiplier_spectra(self, n, formal=False, type='point', use_algebraic_closur sage: f = DynamicalSystem_projective([x^2 + w*x*y + y^2, y^2, z^2]) sage: f.multiplier_spectra(1) # long time [ - [1.000000000000000? - 1.572302755514847?*I 0] - [1.000000000000000? - 1.572302755514847?*I 0.618033988749895? - 1.757887921270715?*I] - [1.000000000000000? + 1.572302755514847?*I 0] - [1.000000000000000? + 1.572302755514847?*I 0.618033988749895? + 1.757887921270715?*I] - [ 0 0], - [ 0 2], - [ 0 0], - [ 0 2], + [1.000000000000000? - 1.572302755514847?*I 0] [1.000000000000000? - 1.572302755514847?*I 0.618033988749895? - 1.757887921270715?*I] + [ 0 0], [ 0 2], + + [1.000000000000000? + 1.572302755514847?*I 0] [1.000000000000000? + 1.572302755514847?*I 0.618033988749895? + 1.757887921270715?*I] + [ 0 0], [ 0 2], + [0 0] [0 0] [ 2 2.236067977499790?] [0 0], [0 0], [ 0 0] ] diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py index c6ad8013a44..43d7b6602d3 100644 --- a/src/sage/functions/orthogonal_polys.py +++ b/src/sage/functions/orthogonal_polys.py @@ -2722,11 +2722,11 @@ class Func_krawtchouk(OrthogonalFunction): ....: * krawtchouk(i,m,n,p) * krawtchouk(j,m,n,p) ....: for m in range(n+1)).expand().factor() ....: for i in range(n+1)] for j in range(n+1)]) - [ 1 0 0 0 0] - [ 0 -4*(p - 1)*p 0 0 0] - [ 0 0 6*(p - 1)^2*p^2 0 0] - [ 0 0 0 -4*(p - 1)^3*p^3 0] - [ 0 0 0 0 (p - 1)^4*p^4] + [1 0 0 0 0] + [0 -4*(p - 1)*p 0 0 0] + [0 0 6*(p - 1)^2*p^2 0 0] + [0 0 0 -4*(p - 1)^3*p^3 0] + [0 0 0 0 (p - 1)^4*p^4] We verify the relationship between the Krawtchouk implementations:: diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 632d2f1f7fe..ecfd42b1218 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -26126,13 +26126,13 @@ def katz_matrix(self, alpha, nonedgesonly=False, vertices=None): sage: H = Graph([(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(1,2),(2,3),(3,4),(4,5)]) sage: H.katz_matrix(1/10) # needs sage.modules sage.rings.number_field - [ 169/2256 545/4512 25/188 605/4512 25/188 545/4512 485/4512] - [ 545/4512 7081/297792 4355/37224 229/9024 595/37224 4073/297792 109/9024] - [ 25/188 4355/37224 172/4653 45/376 125/4653 595/37224 5/376] - [ 605/4512 229/9024 45/376 337/9024 45/376 229/9024 121/9024] - [ 25/188 595/37224 125/4653 45/376 172/4653 4355/37224 5/376] - [ 545/4512 4073/297792 595/37224 229/9024 4355/37224 7081/297792 109/9024] - [ 485/4512 109/9024 5/376 121/9024 5/376 109/9024 97/9024] + [169/2256 545/4512 25/188 605/4512 25/188 545/4512 485/4512] + [545/4512 7081/297792 4355/37224 229/9024 595/37224 4073/297792 109/9024] + [ 25/188 4355/37224 172/4653 45/376 125/4653 595/37224 5/376] + [605/4512 229/9024 45/376 337/9024 45/376 229/9024 121/9024] + [ 25/188 595/37224 125/4653 45/376 172/4653 4355/37224 5/376] + [545/4512 4073/297792 595/37224 229/9024 4355/37224 7081/297792 109/9024] + [485/4512 109/9024 5/376 121/9024 5/376 109/9024 97/9024] .. SEEALSO:: diff --git a/src/sage/groups/braid.py b/src/sage/groups/braid.py index 7af2d1cdabe..3633e3932ac 100644 --- a/src/sage/groups/braid.py +++ b/src/sage/groups/braid.py @@ -2101,9 +2101,10 @@ def deformed_burau_matrix(self, variab='q'): sage: B = BraidGroup(4) sage: b = B([1, 2, -3, -2, 3, 1]) sage: db = b.deformed_burau_matrix(); db - [ ap_0*ap_5 ... bp_0*ap_1*cm_3*bp_4] - ... - [ bm_2*bm_3*cp_5 ... bm_2*am_3*bp_4] + [ ap_0*ap_5 ap_0*bp_5 bp_0*bp_1*cm_2*cp_4 + bp_0*ap_1*cm_3*ap_4 bp_0*ap_1*cm_3*bp_4] + [ cp_0*ap_5 cp_0*bp_5 0 0] + [ 0 0 cp_1*cm_3*ap_4 cp_1*cm_3*bp_4] + [bm_2*bm_3*cp_5 0 am_2*cp_4 + bm_2*am_3*ap_4 bm_2*am_3*bp_4] We check how this relates to the nondeformed Burau matrix:: diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index 0716b9003d6..c8a914ebd81 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -1644,11 +1644,11 @@ def alexander_matrix(self, im_gens=None): sage: G. = FreeGroup() sage: H = G.quotient([a*b/a/b, a*c/a/c, a*d/a/d, b*c*d/(c*d*b), b*c*d/(d*b*c)]) sage: H.alexander_matrix() - [ 1 - a*b*a^-1 a - a*b*a^-1*b^-1 0 0 0] - [ 1 - a*c*a^-1 0 a - a*c*a^-1*c^-1 0 0] - [ 1 - a*d*a^-1 0 0 a - a*d*a^-1*d^-1 0] - [ 0 1 - b*c*d*b^-1 b - b*c*d*b^-1*d^-1*c^-1 b*c - b*c*d*b^-1*d^-1 0] - [ 0 1 - b*c*d*c^-1*b^-1 b - b*c*d*c^-1 b*c - b*c*d*c^-1*b^-1*d^-1 0] + [1 - a*b*a^-1 a - a*b*a^-1*b^-1 0 0 0] + [1 - a*c*a^-1 0 a - a*c*a^-1*c^-1 0 0] + [1 - a*d*a^-1 0 0 a - a*d*a^-1*d^-1 0] + [ 0 1 - b*c*d*b^-1 b - b*c*d*b^-1*d^-1*c^-1 b*c - b*c*d*b^-1*d^-1 0] + [ 0 1 - b*c*d*c^-1*b^-1 b - b*c*d*c^-1 b*c - b*c*d*c^-1*b^-1*d^-1 0] sage: R. = LaurentPolynomialRing(ZZ) sage: H.alexander_matrix([t1,t2,t3,t4]) [ -t2 + 1 t1 - 1 0 0 0] diff --git a/src/sage/manifolds/differentiable/automorphismfield.py b/src/sage/manifolds/differentiable/automorphismfield.py index 320620a0d8b..cda4b516ef1 100644 --- a/src/sage/manifolds/differentiable/automorphismfield.py +++ b/src/sage/manifolds/differentiable/automorphismfield.py @@ -850,8 +850,8 @@ def restrict(self, subdomain, dest_map=None): Field of tangent-space automorphisms a on the Open subset V of the 2-dimensional differentiable manifold S^2 sage: a.restrict(V)[eS,:] - [ (u^4 + 10*u^2*v^2 + v^4 + 2*(u^3*v - u*v^3)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4) -(4*u^3*v - 4*u*v^3 + (u^4 - 2*u^2*v^2 + v^4)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4)] - [ 4*(u^2*v^2*arctan(1/(u^2 + v^2)) - u^3*v + u*v^3)/(u^4 + 2*u^2*v^2 + v^4) (3*u^4 - 2*u^2*v^2 + 3*v^4 - 2*(u^3*v - u*v^3)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4)] + [(u^4 + 10*u^2*v^2 + v^4 + 2*(u^3*v - u*v^3)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4) -(4*u^3*v - 4*u*v^3 + (u^4 - 2*u^2*v^2 + v^4)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4)] + [ 4*(u^2*v^2*arctan(1/(u^2 + v^2)) - u^3*v + u*v^3)/(u^4 + 2*u^2*v^2 + v^4) (3*u^4 - 2*u^2*v^2 + 3*v^4 - 2*(u^3*v - u*v^3)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4)] sage: a.restrict(W) Field of tangent-space automorphisms a on the Open subset W of the 2-dimensional differentiable manifold S^2 diff --git a/src/sage/manifolds/differentiable/pseudo_riemannian_submanifold.py b/src/sage/manifolds/differentiable/pseudo_riemannian_submanifold.py index 57dc1c99862..9495445b622 100644 --- a/src/sage/manifolds/differentiable/pseudo_riemannian_submanifold.py +++ b/src/sage/manifolds/differentiable/pseudo_riemannian_submanifold.py @@ -155,9 +155,9 @@ ambient manifold:: sage: N.ambient_extrinsic_curvature()[:] # long time - [ -(x^2 + y^2)/b^3 (b^2*x + x^3 + x*y^2)/(sqrt(b^2 + x^2 + y^2)*b^3) (y^3 + (b^2 + x^2)*y)/(sqrt(b^2 + x^2 + y^2)*b^3)] - [ sqrt(b^2 + x^2 + y^2)*x/b^3 -(b^2 + x^2)/b^3 -x*y/b^3] - [ sqrt(b^2 + x^2 + y^2)*y/b^3 -x*y/b^3 -(b^2 + y^2)/b^3] + [ -(x^2 + y^2)/b^3 (b^2*x + x^3 + x*y^2)/(sqrt(b^2 + x^2 + y^2)*b^3) (y^3 + (b^2 + x^2)*y)/(sqrt(b^2 + x^2 + y^2)*b^3)] + [sqrt(b^2 + x^2 + y^2)*x/b^3 -(b^2 + x^2)/b^3 -x*y/b^3] + [sqrt(b^2 + x^2 + y^2)*y/b^3 -x*y/b^3 -(b^2 + y^2)/b^3] The extrinsic curvature as a tensor field on the submanifold:: diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py index 5e6c5438914..614510208b2 100644 --- a/src/sage/manifolds/differentiable/tensorfield.py +++ b/src/sage/manifolds/differentiable/tensorfield.py @@ -3766,8 +3766,8 @@ def up( Tensor field of type (1,1) on the 2-dimensional differentiable manifold M sage: tu0[:] - [ ((3*x + 1)*y - 1)/(x^2*y^2 + (x + 1)*y - x - 1) 2*((2*x + 1)*y - 1)/(x^2*y^2 + (x + 1)*y - x - 1)] - [ (x*y - 3*x - 3)/(x^2*y^2 + (x + 1)*y - x - 1) 2*(x*y - 2*x - 2)/(x^2*y^2 + (x + 1)*y - x - 1)] + [((3*x + 1)*y - 1)/(x^2*y^2 + (x + 1)*y - x - 1) 2*((2*x + 1)*y - 1)/(x^2*y^2 + (x + 1)*y - x - 1)] + [ (x*y - 3*x - 3)/(x^2*y^2 + (x + 1)*y - x - 1) 2*(x*y - 2*x - 2)/(x^2*y^2 + (x + 1)*y - x - 1)] sage: tu0 == ig['^ac']*t['_cb'] # the same operation in index notation True sage: tuu0 = tu0.up(g) ; tuu0 # the two indices have been raised, starting from the first one diff --git a/src/sage/matrix/matrix0.pyx b/src/sage/matrix/matrix0.pyx index 42bdca96bfa..8ef37ee85a4 100644 --- a/src/sage/matrix/matrix0.pyx +++ b/src/sage/matrix/matrix0.pyx @@ -1942,13 +1942,13 @@ cdef class Matrix(sage.structure.element.Matrix): sage: set_random_seed(0) sage: matrix.random(RDF, 3, 5).str(unicode=True, character_art=True) - ⎛ -0.27440062056807446 0.5031965950979831 -0.001975438590219314 - ⎜ -0.05461130074681608 -0.033673314214051286 -0.9401270875197381 - ⎝ 0.19906256610645512 0.3242250183948632 0.6026443545751128 + ⎛-0.27440062056807446 0.5031965950979831 -0.001975438590219314 + ⎜-0.05461130074681608 -0.033673314214051286 -0.9401270875197381 + ⎝ 0.19906256610645512 0.3242250183948632 0.6026443545751128 - -0.9467802263760512 0.5056889961514748⎞ - -0.35104242112828943 0.5084492941557279⎟ - -0.9541798283979341 -0.8948790563276592⎠ + -0.9467802263760512 0.5056889961514748⎞ + -0.35104242112828943 0.5084492941557279⎟ + -0.9541798283979341 -0.8948790563276592⎠ The number of floating point digits to display is controlled by :obj:`matrix.options.precision <.constructor.options>` and can also be @@ -1994,7 +1994,7 @@ cdef class Matrix(sage.structure.element.Matrix): sage: K = (A - e).kernel() sage: P = K.basis_matrix() sage: P.str() - '[ 1.000000000000000? + 0.?e-17*I -2.116651487479748? + 0.0255565807096352?*I -0.2585224251020429? + 0.2886023409047535?*I -0.4847545623533090? - 1.871890760086142?*I]' + '[1.000000000000000? + 0.?e-17*I -2.116651487479748? + 0.0255565807096352?*I -0.2585224251020429? + 0.2886023409047535?*I -0.4847545623533090? - 1.871890760086142?*I]' Use single-row delimiters where appropriate:: @@ -2177,12 +2177,19 @@ cdef class Matrix(sage.structure.element.Matrix): else: bottom_count = 0 - width = max(map(len, S)) + maxwidth = max(map(len, S)) + if (maxwidth + 1)*nc - 1 <= 78: + width = [maxwidth]*nc + else: + width = [max(len(S[(r + top_count) * nc + c]) + for r in range(nr)) + for c in range(nc)] + left = [] rows = [] right = [] - hline = cl.join(hl * ((width + 1)*(b - a) - 1) + hline = cl.join(hl * (sum(width[j] + 1 for j in range(a, b)) - 1) for a,b in zip([0] + col_divs, col_divs + [nc])) # compute rows @@ -2209,7 +2216,7 @@ cdef class Matrix(sage.structure.element.Matrix): else: sep = " " entry = S[(r + top_count) * nc + c] - entry = " " * (width - len(entry)) + entry + entry = " " * (width[c] - len(entry)) + entry s = s + sep + entry else: if 0 <= r < nr: @@ -2250,11 +2257,11 @@ cdef class Matrix(sage.structure.element.Matrix): if character_art: breakpoints = [] - idx = len(tlb) + (col_div_counts[0] if nc > 0 else 0) + width + idx = len(tlb) + (col_div_counts[0] if nc > 0 else 0) + width[0] for c from 1 <= c < nc: breakpoints.append(idx) len_sep = max(col_div_counts[c], 1) - idx += len_sep + width + idx += len_sep + width[c] return CharacterArt(rows, breakpoints=breakpoints) else: return "\n".join(rows) @@ -2267,13 +2274,13 @@ cdef class Matrix(sage.structure.element.Matrix): sage: set_random_seed(0) sage: ascii_art(matrix.random(RDF, 3, 5)) # indirect doctest - [ -0.27440062056807446 0.5031965950979831 -0.001975438590219314 - [ -0.05461130074681608 -0.033673314214051286 -0.9401270875197381 - [ 0.19906256610645512 0.3242250183948632 0.6026443545751128 + [-0.27440062056807446 0.5031965950979831 -0.001975438590219314 + [-0.05461130074681608 -0.033673314214051286 -0.9401270875197381 + [ 0.19906256610645512 0.3242250183948632 0.6026443545751128 - -0.9467802263760512 0.5056889961514748] - -0.35104242112828943 0.5084492941557279] - -0.9541798283979341 -0.8948790563276592] + -0.9467802263760512 0.5056889961514748] + -0.35104242112828943 0.5084492941557279] + -0.9541798283979341 -0.8948790563276592] """ from sage.matrix.constructor import options if self._nrows <= options.max_rows() and self._ncols <= options.max_cols(): diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx index 63102fb380b..723aada97df 100644 --- a/src/sage/matrix/matrix2.pyx +++ b/src/sage/matrix/matrix2.pyx @@ -6598,14 +6598,14 @@ cdef class Matrix(Matrix1): (-1.414213562373095?, Vector space of degree 7 and dimension 2 over Algebraic Field User basis matrix: - [ 0 1 0 -1 0.4142135623730951? 1 -1] - [ 0 0 1 0 -1 0 2.414213562373095?], + [0 1 0 -1 0.4142135623730951? 1 -1] + [0 0 1 0 -1 0 2.414213562373095?], 2), (1.414213562373095?, Vector space of degree 7 and dimension 2 over Algebraic Field User basis matrix: - [ 0 1 0 -1 -2.414213562373095? 1 -1] - [ 0 0 1 0 -1 0 -0.4142135623730951?], + [0 1 0 -1 -2.414213562373095? 1 -1] + [0 0 1 0 -1 0 -0.4142135623730951?], 2)] sage: A.eigenspaces_left(format='galois', algebraic_multiplicity=True) [(3, @@ -6697,8 +6697,8 @@ cdef class Matrix(Matrix1): [3/2*x^2 + 1/2*x - 1/2*sqrt(9*x^4 - 6*x^3 + x^2 + 4*y^2) 0] [ 0 3/2*x^2 + 1/2*x + 1/2*sqrt(9*x^4 - 6*x^3 + x^2 + 4*y^2)] sage: eigenvectors = em[1]; eigenvectors - [ 1 1/2*(3*x^2 - x - sqrt(9*x^4 - 6*x^3 + x^2 + 4*y^2))/y] - [ 1 1/2*(3*x^2 - x + sqrt(9*x^4 - 6*x^3 + x^2 + 4*y^2))/y] + [1 1/2*(3*x^2 - x - sqrt(9*x^4 - 6*x^3 + x^2 + 4*y^2))/y] + [1 1/2*(3*x^2 - x + sqrt(9*x^4 - 6*x^3 + x^2 + 4*y^2))/y] A request for ``'all'`` the eigenvalues, when it is not possible, will raise an error. Using the ``'galois'`` @@ -8242,9 +8242,9 @@ cdef class Matrix(Matrix1): Echelon form not implemented over 'Univariate Polynomial Ring in x over Integer Ring'. sage: C = matrix(3,[2,x,x^2,x+1,3-x,-1,3,2,1/2]) sage: C.echelon_form() - [ 2 x x^2] - [ 0 1 15*x^2 - 3/2*x - 31/2] - [ 0 0 5/2*x^3 - 15/4*x^2 - 9/4*x + 7/2] + [2 x x^2] + [0 1 15*x^2 - 3/2*x - 31/2] + [0 0 5/2*x^3 - 15/4*x^2 - 9/4*x + 7/2] sage: C.rref() [1 0 0] [0 1 0] @@ -8459,9 +8459,9 @@ cdef class Matrix(Matrix1): [ 5 * 18 + O(5^5) 398 + O(5^5) 2483 + O(5^5)] sage: K = R.fraction_field() sage: A.change_ring(K).augment(identity_matrix(K,3)).echelon_form() - [ 1 + O(5^5) O(5^5) O(5^5) 5 * 212 + O(5^5) 3031 + O(5^5) 2201 + O(5^5)] - [ O(5^5) 1 + O(5^5) O(5^5) 1348 + O(5^5) 5 * 306 + O(5^5) 2648 + O(5^5)] - [ O(5^5) O(5^5) 1 + O(5^5) 1987 + O(5^5) 5 * 263 + O(5^5) 154 + O(5^5)] + [1 + O(5^5) O(5^5) O(5^5) 5 * 212 + O(5^5) 3031 + O(5^5) 2201 + O(5^5)] + [ O(5^5) 1 + O(5^5) O(5^5) 1348 + O(5^5) 5 * 306 + O(5^5) 2648 + O(5^5)] + [ O(5^5) O(5^5) 1 + O(5^5) 1987 + O(5^5) 5 * 263 + O(5^5) 154 + O(5^5)] Echelon form is not defined over arbitrary rings:: @@ -9027,12 +9027,12 @@ cdef class Matrix(Matrix1): True sage: B = A.change_ring(QQ) sage: B.extended_echelon_form(subdivide=True) - [ 1 0 -1 0 -19/6 -7/6 -5/3| 0 0 -89/42 -5/2 1/7] - [ 0 1 1 0 8/3 5/3 5/3| 0 0 34/21 2 -1/7] - [ 0 0 0 1 -4/3 -1/3 -1/3| 0 0 1/21 0 1/7] - [------------------------------------------------+----------------------------------] - [ 0 0 0 0 0 0 0| 1 0 9/7 0 -1/7] - [ 0 0 0 0 0 0 0| 0 1 2/7 -1 6/7] + [1 0 -1 0 -19/6 -7/6 -5/3|0 0 -89/42 -5/2 1/7] + [0 1 1 0 8/3 5/3 5/3|0 0 34/21 2 -1/7] + [0 0 0 1 -4/3 -1/3 -1/3|0 0 1/21 0 1/7] + [------------------------+--------------------] + [0 0 0 0 0 0 0|1 0 9/7 0 -1/7] + [0 0 0 0 0 0 0|0 1 2/7 -1 6/7] Subdivided, or not, the result is immutable, so make a copy if you want to make changes. :: @@ -10968,9 +10968,9 @@ cdef class Matrix(Matrix1): [-7/3*t^2 - 1/2*t - 1/15 -2*t^2 + 19/8*t -10*t^2 + 2*t + 1/2] [ 6*t^2 - 1/2 -1/7*t^2 + 9/4*t -t^2 - 4*t - 1/10] sage: A._adjugate() - [ 4/7*t^4 + 1591/56*t^3 - 961/70*t^2 - 109/80*t 55/7*t^4 + 104/7*t^3 + 6123/1540*t^2 - 959/220*t - 1/10 -82*t^4 + 101/4*t^3 + 1035/88*t^2 - 29/22*t - 1/2] - [ -187/3*t^4 + 13/6*t^3 + 57/10*t^2 - 79/60*t - 77/300 38*t^4 + t^3 - 793/110*t^2 - 28/5*t - 53/220 -6*t^4 + 44/3*t^3 + 4727/330*t^2 - 1147/330*t - 487/660] - [ 37/3*t^4 - 136/7*t^3 - 1777/840*t^2 + 83/80*t 292/7*t^4 + 107/14*t^3 - 323/28*t^2 - 29/8*t + 1/2 61/3*t^4 - 25/12*t^3 - 269/120*t^2 + 743/240*t - 1/15] + [ 4/7*t^4 + 1591/56*t^3 - 961/70*t^2 - 109/80*t 55/7*t^4 + 104/7*t^3 + 6123/1540*t^2 - 959/220*t - 1/10 -82*t^4 + 101/4*t^3 + 1035/88*t^2 - 29/22*t - 1/2] + [-187/3*t^4 + 13/6*t^3 + 57/10*t^2 - 79/60*t - 77/300 38*t^4 + t^3 - 793/110*t^2 - 28/5*t - 53/220 -6*t^4 + 44/3*t^3 + 4727/330*t^2 - 1147/330*t - 487/660] + [ 37/3*t^4 - 136/7*t^3 - 1777/840*t^2 + 83/80*t 292/7*t^4 + 107/14*t^3 - 323/28*t^2 - 29/8*t + 1/2 61/3*t^4 - 25/12*t^3 - 269/120*t^2 + 743/240*t - 1/15] Finally, an example over a general ring ``S`` that is not an integral domain:: @@ -11095,17 +11095,17 @@ cdef class Matrix(Matrix1): ....: [-1, 1, -6, -6, 5]]) sage: Q, R = A.QR() sage: Q - [ -0.4588314677411235? -0.1260506983326509? 0.3812120831224489? -0.394573711338418? -0.6874400625964?] - [ -0.4588314677411235? 0.4726901187474409? -0.05198346588033394? 0.7172941251646595? -0.2209628772631?] - [ 0.2294157338705618? 0.6617661662464172? 0.6619227988762521? -0.1808720937375480? 0.1964114464561?] - [ 0.6882472016116853? 0.1890760474989764? -0.2044682991293135? 0.0966302966543065? -0.6628886317894?] - [ -0.2294157338705618? 0.5357154679137663? -0.609939332995919? -0.536422031427112? 0.0245514308070?] + [-0.4588314677411235? -0.1260506983326509? 0.3812120831224489? -0.394573711338418? -0.6874400625964?] + [-0.4588314677411235? 0.4726901187474409? -0.05198346588033394? 0.7172941251646595? -0.2209628772631?] + [ 0.2294157338705618? 0.6617661662464172? 0.6619227988762521? -0.1808720937375480? 0.1964114464561?] + [ 0.6882472016116853? 0.1890760474989764? -0.2044682991293135? 0.0966302966543065? -0.6628886317894?] + [-0.2294157338705618? 0.5357154679137663? -0.609939332995919? -0.536422031427112? 0.0245514308070?] sage: R - [ 4.358898943540674? -0.4588314677411235? 13.07669683062202? 6.194224814505168? 2.982404540317303?] - [ 0 1.670171752907625? 0.5987408170800917? -1.292019657909672? 6.207996892883057?] - [ 0 0 5.444401659866974? 5.468660610611130? -0.6827161852283857?] - [ 0 0 0 1.027626039419836? -3.619300149686620?] - [ 0 0 0 0 0.024551430807012?] + [4.358898943540674? -0.4588314677411235? 13.07669683062202? 6.194224814505168? 2.982404540317303?] + [ 0 1.670171752907625? 0.5987408170800917? -1.292019657909672? 6.207996892883057?] + [ 0 0 5.444401659866974? 5.468660610611130? -0.6827161852283857?] + [ 0 0 0 1.027626039419836? -3.619300149686620?] + [ 0 0 0 0 0.024551430807012?] sage: Q.conjugate_transpose()*Q [1.000000000000000? 0.?e-18 0.?e-17 0.?e-16 0.?e-13] [ 0.?e-18 1.000000000000000? 0.?e-17 0.?e-16 0.?e-13] @@ -11126,15 +11126,15 @@ cdef class Matrix(Matrix1): ....: [I + 2, 0, I + 12, -1]]) sage: Q, R = A.QR() sage: Q - [ -0.7302967433402215? 0.2070566455055649? + 0.5383472783144687?*I 0.2463049809998642? - 0.0764456358723292?*I 0.2381617683194332? - 0.1036596032779695?*I] - [ 0.0912870929175277? -0.2070566455055649? - 0.3778783780476559?*I 0.3786559533863033? - 0.1952221495524667?*I 0.701244450214469? - 0.3643711650986595?*I] - [ 0.6390096504226938? + 0.0912870929175277?*I 0.1708217325420910? + 0.6677576817554466?*I -0.03411475806452072? + 0.04090198741767143?*I 0.3140171085506764? - 0.0825191718705412?*I] - [ 0.1825741858350554? + 0.0912870929175277?*I -0.03623491296347385? + 0.0724698259269477?*I 0.8632284069415110? + 0.06322839976356195?*I -0.4499694867611521? - 0.0116119181208918?*I] + [ -0.7302967433402215? 0.2070566455055649? + 0.5383472783144687?*I 0.2463049809998642? - 0.0764456358723292?*I 0.2381617683194332? - 0.1036596032779695?*I] + [ 0.0912870929175277? -0.2070566455055649? - 0.3778783780476559?*I 0.3786559533863033? - 0.1952221495524667?*I 0.701244450214469? - 0.3643711650986595?*I] + [0.6390096504226938? + 0.0912870929175277?*I 0.1708217325420910? + 0.6677576817554466?*I -0.03411475806452072? + 0.04090198741767143?*I 0.3140171085506764? - 0.0825191718705412?*I] + [0.1825741858350554? + 0.0912870929175277?*I -0.03623491296347385? + 0.0724698259269477?*I 0.8632284069415110? + 0.06322839976356195?*I -0.4499694867611521? - 0.0116119181208918?*I] sage: R - [ 10.95445115010333? 0.?e-18 - 1.917028951268082?*I 5.385938482134133? - 2.190890230020665?*I -0.2738612787525831? - 2.190890230020665?*I] - [ 0 4.829596256417300? + 0.?e-18*I -0.869637911123373? - 5.864879483945125?*I 0.993871898426712? - 0.3054085521207082?*I] - [ 0 0 12.00160760935814? + 0.?e-16*I -0.2709533402297273? + 0.4420629644486323?*I] - [ 0 0 0 1.942963944258992? + 0.?e-16*I] + [10.95445115010333? 0.?e-18 - 1.917028951268082?*I 5.385938482134133? - 2.190890230020665?*I -0.2738612787525831? - 2.190890230020665?*I] + [ 0 4.829596256417300? + 0.?e-18*I -0.869637911123373? - 5.864879483945125?*I 0.993871898426712? - 0.3054085521207082?*I] + [ 0 0 12.00160760935814? + 0.?e-16*I -0.2709533402297273? + 0.4420629644486323?*I] + [ 0 0 0 1.942963944258992? + 0.?e-16*I] sage: Q.conjugate_transpose()*Q [1.000000000000000? + 0.?e-19*I 0.?e-18 + 0.?e-17*I 0.?e-17 + 0.?e-17*I 0.?e-16 + 0.?e-16*I] [ 0.?e-18 + 0.?e-17*I 1.000000000000000? + 0.?e-17*I 0.?e-17 + 0.?e-17*I 0.?e-16 + 0.?e-16*I] @@ -11155,10 +11155,10 @@ cdef class Matrix(Matrix1): ....: [-5, 1, -1]]) sage: Q, R = A.QR() sage: Q - [ 0.3592106040535498? -0.5693261797050169? 0.7239227659930268? 0.1509015305256380?] - [ -0.1796053020267749? 0.1445907757980996? 0 0.9730546968377341?] - [ -0.1796053020267749? 0.7048800320157352? 0.672213996993525? -0.1378927778941174?] - [ -0.8980265101338745? -0.3976246334447737? 0.1551263069985058? -0.10667177157846818?] + [ 0.3592106040535498? -0.5693261797050169? 0.7239227659930268? 0.1509015305256380?] + [-0.1796053020267749? 0.1445907757980996? 0 0.9730546968377341?] + [-0.1796053020267749? 0.7048800320157352? 0.672213996993525? -0.1378927778941174?] + [-0.8980265101338745? -0.3976246334447737? 0.1551263069985058? -0.10667177157846818?] sage: R [ 5.567764362830022? -2.694079530401624? 2.694079530401624?] [ 0 3.569584777515583? -3.569584777515583?] @@ -11193,12 +11193,12 @@ cdef class Matrix(Matrix1): ....: [-4*I - 4, I - 5, -7*I, -I - 4]]) sage: Q, R = A.QR(full=False) sage: Q - [ -0.4160251471689219? - 0.4160251471689219?*I 0.5370861555295747? + 0.1790287185098583?*I] - [ -0.1386750490563073? - 0.1386750490563073?*I -0.7519206177414046? - 0.2506402059138015?*I] - [ -0.5547001962252291? - 0.5547001962252291?*I -0.2148344622118299? - 0.07161148740394329?*I] + [-0.4160251471689219? - 0.4160251471689219?*I 0.5370861555295747? + 0.1790287185098583?*I] + [-0.1386750490563073? - 0.1386750490563073?*I -0.7519206177414046? - 0.2506402059138015?*I] + [-0.5547001962252291? - 0.5547001962252291?*I -0.2148344622118299? - 0.07161148740394329?*I] sage: R - [ 7.211102550927979? 3.328201177351375? - 5.269651864139676?*I 7.904477796209515? + 8.45917799243475?*I 4.021576422632911? - 2.634825932069838?*I] - [ 0 1.074172311059150? -1.611258466588724? - 9.13046464400277?*I 1.611258466588724? + 0.5370861555295747?*I] + [7.211102550927979? 3.328201177351375? - 5.269651864139676?*I 7.904477796209515? + 8.45917799243475?*I 4.021576422632911? - 2.634825932069838?*I] + [ 0 1.074172311059150? -1.611258466588724? - 9.13046464400277?*I 1.611258466588724? + 0.5370861555295747?*I] sage: Q.conjugate_transpose()*Q [1 0] [0 1] @@ -11406,9 +11406,9 @@ cdef class Matrix(Matrix1): [ 2*a 1/11*a + 80/33 196/1163*a - 1234/1163] [ 1 25/33*a - 16/11 855/1163*a - 1717/1163] sage: R - [ 1 8/33*a + 5/11 8/33*a + 16/11 2/11*a + 1/33] - [ 0 1 1 -107/1163*a - 78/1163] - [ 0 0 0 1] + [1 8/33*a + 5/11 8/33*a + 16/11 2/11*a + 1/33] + [0 1 1 -107/1163*a - 78/1163] + [0 0 0 1] sage: Q*R == A True sage: Q.transpose().conjugate()*Q @@ -11760,17 +11760,17 @@ cdef class Matrix(Matrix1): [ 155/139*z^3 - 161/139*z^2 + 31/139*z + 13/139 -175/139*z^3 + 180/139*z^2 - 125/139*z - 142/139 230/139*z^3 + 124/139*z^2 + 6/139*z + 19/139 -14/139*z^3 + 92/139*z^2 - 6/139*z - 95/139] [-10359/19841*z^3 - 36739/39682*z^2 + 24961/39682*z - 11879/39682 -28209/39682*z^3 - 3671/19841*z^2 + 51549/39682*z - 38613/39682 -42769/39682*z^3 - 615/39682*z^2 - 1252/19841*z - 14392/19841 4895/19841*z^3 + 57885/39682*z^2 - 46094/19841*z + 65747/39682] sage: M - [ 1 0 0] - [ 14/139*z^3 + 47/139*z^2 + 145/139*z + 95/139 1 0] - [ -7/278*z^3 + 199/278*z^2 + 183/139*z + 175/278 -3785/39682*z^3 + 3346/19841*z^2 - 3990/19841*z + 2039/19841 1] + [ 1 0 0] + [ 14/139*z^3 + 47/139*z^2 + 145/139*z + 95/139 1 0] + [-7/278*z^3 + 199/278*z^2 + 183/139*z + 175/278 -3785/39682*z^3 + 3346/19841*z^2 - 3990/19841*z + 2039/19841 1] sage: M*G - A [0 0 0 0] [0 0 0 0] [0 0 0 0] sage: G*G.conjugate().transpose() - [ 15*z^3 + 15*z^2 + 28 0 0] - [ 0 463/139*z^3 + 463/139*z^2 + 1971/139 0] - [ 0 0 230983/19841*z^3 + 230983/19841*z^2 + 1003433/39682] + [15*z^3 + 15*z^2 + 28 0 0] + [ 0 463/139*z^3 + 463/139*z^2 + 1971/139 0] + [ 0 0 230983/19841*z^3 + 230983/19841*z^2 + 1003433/39682] sage: G.row_space() == A.row_space() True @@ -13808,10 +13808,10 @@ cdef class Matrix(Matrix1): sage: A.is_hermitian() True sage: L = A.cholesky(); L - [ 4.79...? 0 0 0] - [ 0.62...? - 3.54...?*I 5.00...? 0 0] - [ 5.21...? - 5.00...?*I 13.58...? + 10.72...?*I 24.98...? 0] - [ -4.37...?*I -0.10...? - 0.85...?*I -0.21...? + 0.37...?*I 2.81...?] + [ 4.795831523312720? 0 0 0] + [0.6255432421712243? - 3.544745038970271?*I 5.004345937369795? 0 0] + [ 5.212860351426869? - 5.004345937369795?*I 13.58818931605271? + 10.72111612276793?*I 24.98402267227776? 0] + [ -4.378802695198570?*I -0.10425720702853738? - 0.8514338573997219?*I -0.2148595374719999? + 0.3713484373384111?*I 2.811798978416028?] sage: L.parent() Full MatrixSpace of 4 by 4 dense matrices over Algebraic Field sage: (L*L.conjugate_transpose() - A.change_ring(QQbar)).norm() < 10^-10 @@ -14775,10 +14775,10 @@ cdef class Matrix(Matrix1): True sage: L, d = A._indefinite_factorization('hermitian') sage: L - [ 1 0 0 0] - [ -17/23*I + 3/23 1 0 0] - [ -24/23*I + 25/23 617/288*I + 391/144 1 0] - [ -21/23*I -49/288*I - 1/48 1336/89885*I - 773/89885 1] + [ 1 0 0 0] + [ -17/23*I + 3/23 1 0 0] + [-24/23*I + 25/23 617/288*I + 391/144 1 0] + [ -21/23*I -49/288*I - 1/48 1336/89885*I - 773/89885 1] sage: d (23, 576/23, 89885/144, 142130/17977) sage: A == L*diagonal_matrix(C, d)*L.conjugate_transpose() @@ -16328,8 +16328,8 @@ cdef class Matrix(Matrix1): sage: P.base_ring() Complex Field with 53 bits of precision sage: P.conjugate_transpose() - [ 0.950... + 0.630...*I 0.940... - 0.230...*I 0.520... + 0.410...*I] - [ 0.840... - 0.130...*I 0.230... - 0.590...*I -0.500... - 0.900...*I] + [0.950000000000000 + 0.630000000000000*I 0.940000000000000 - 0.230000000000000*I 0.520000000000000 + 0.410000000000000*I] + [0.840000000000000 - 0.130000000000000*I 0.230000000000000 - 0.590000000000000*I -0.500000000000000 - 0.900000000000000*I] There is also a shortcut for the conjugate transpose, or "Hermitian transpose":: @@ -16682,8 +16682,8 @@ cdef class Matrix(Matrix1): sage: a = matrix(RR, [[1,pi.n()], [1e2,1e-2]]) # needs sage.symbolic sage: a.exp() # needs sage.symbolic - [ 1/11882424341266*((11*sqrt(227345670387496707609) + 5941212170633)*e^(3/1275529100*sqrt(227345670387496707609)) - 11*sqrt(227345670387496707609) + 5941212170633)*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200) 445243650/75781890129165569203*(sqrt(227345670387496707609)*e^(3/1275529100*sqrt(227345670387496707609)) - sqrt(227345670387496707609))*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200)] - [ 10000/53470909535697*(sqrt(227345670387496707609)*e^(3/1275529100*sqrt(227345670387496707609)) - sqrt(227345670387496707609))*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200) -1/11882424341266*((11*sqrt(227345670387496707609) - 5941212170633)*e^(3/1275529100*sqrt(227345670387496707609)) - 11*sqrt(227345670387496707609) - 5941212170633)*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200)] + [1/11882424341266*((11*sqrt(227345670387496707609) + 5941212170633)*e^(3/1275529100*sqrt(227345670387496707609)) - 11*sqrt(227345670387496707609) + 5941212170633)*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200) 445243650/75781890129165569203*(sqrt(227345670387496707609)*e^(3/1275529100*sqrt(227345670387496707609)) - sqrt(227345670387496707609))*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200)] + [ 10000/53470909535697*(sqrt(227345670387496707609)*e^(3/1275529100*sqrt(227345670387496707609)) - sqrt(227345670387496707609))*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200) -1/11882424341266*((11*sqrt(227345670387496707609) - 5941212170633)*e^(3/1275529100*sqrt(227345670387496707609)) - 11*sqrt(227345670387496707609) - 5941212170633)*e^(-3/2551058200*sqrt(227345670387496707609) + 101/200)] sage: a.change_ring(RDF).exp() # rel tol 1e-13 # needs sage.symbolic [42748127.31532951 7368259.244159399] [234538976.1381042 40426191.45156228] @@ -17514,14 +17514,14 @@ cdef class Matrix(Matrix1): sage: U, X, polys, corners = A._zigzag_form() sage: 38416*U - [ 38416 -2612288 -8797264 -47943168 83753660284 -16775074316 1574993574 -12141218334] - [ 0 -1997632 -7222208 -38108672 66323477868 -13362573684 3694412232 -12414630592] - [ 0 3534272 12523616 66920672 -116699384082 23442252424 -4176610942 18012693216] - [ 0 5339824 18631760 100842000 -175585304193 35191011843 -3619613634 22708786576] - [ 0 1536640 5301408 28812000 -50432310506 10071675864 79884994 5258177064] - [ 0 -1767136 -6261808 -33460336 58377759731 -11719115889 1849749314 -8725304756] - [ 0 -998816 -3611104 -19054336 33189768208 -6681286842 1651135654 -5815174372] - [ 0 -1267728 -4456256 -23933168 41831027339 -8380482791 785625330 -5536675718] + [38416 -2612288 -8797264 -47943168 83753660284 -16775074316 1574993574 -12141218334] + [ 0 -1997632 -7222208 -38108672 66323477868 -13362573684 3694412232 -12414630592] + [ 0 3534272 12523616 66920672 -116699384082 23442252424 -4176610942 18012693216] + [ 0 5339824 18631760 100842000 -175585304193 35191011843 -3619613634 22708786576] + [ 0 1536640 5301408 28812000 -50432310506 10071675864 79884994 5258177064] + [ 0 -1767136 -6261808 -33460336 58377759731 -11719115889 1849749314 -8725304756] + [ 0 -998816 -3611104 -19054336 33189768208 -6681286842 1651135654 -5815174372] + [ 0 -1267728 -4456256 -23933168 41831027339 -8380482791 785625330 -5536675718] sage: X == Z True sage: U.inverse()*A*U == X @@ -17873,12 +17873,12 @@ cdef class Matrix(Matrix1): ....: [ 0, 0,a^3, 0], ....: [a^2 +4 , 0, 0,a + 2]]) sage: A.zigzag_form() - [ 0 a^3 + 2*a^2 + 2*a + 2| 0| 0] - [ 1 2*a + 2| 0| 0] - [-------------------------------------------+---------------------+---------------------] - [ 0 0| a^3| 0] - [-------------------------------------------+---------------------+---------------------] - [ 0 0| 0| a^2 + 1] + [0 a^3 + 2*a^2 + 2*a + 2| 0| 0] + [1 2*a + 2| 0| 0] + [-----------------------+---+-------] + [0 0|a^3| 0] + [-----------------------+---+-------] + [0 0| 0|a^2 + 1] sage: A.eigenvalues() Traceback (most recent call last): ... @@ -17892,10 +17892,10 @@ cdef class Matrix(Matrix1): ....: [ 0, 0,a^3, 0], ....: [a^2 +4 , 0, 0,a + 2]]) sage: A.zigzag_form(subdivide=False) # needs sage.rings.finite_rings - [ 0 a^3 + 2*a^2 + 2*a + 2 0 0] - [ 1 2*a + 2 0 0] - [ 0 0 a^3 0] - [ 0 0 0 a^2 + 1] + [0 a^3 + 2*a^2 + 2*a + 2 0 0] + [1 2*a + 2 0 0] + [0 0 a^3 0] + [0 0 0 a^2 + 1] TESTS:: @@ -18217,19 +18217,19 @@ cdef class Matrix(Matrix1): ....: [3*a + 2, a + 3, 3*a + 6, a, 3*a + 5, 5*a + 1, 3*a + 2, a + 3, a + 2, 6*a + 1, 3*a + 3], ....: [6*a + 6, 5*a + 1, 4*a, 2, 5*a + 5, 3*a + 5, 3*a + 1, 2*a, 2*a, 2*a + 4, 4*a + 2]]) sage: A.rational_form() - [ a + 2| 0 0 0| 0 0 0 0 0 0 0] - [-------+-----------------------+-------------------------------------------------------] - [ 0| 0 0 a + 6| 0 0 0 0 0 0 0] - [ 0| 1 0 6*a + 4| 0 0 0 0 0 0 0] - [ 0| 0 1 6*a + 4| 0 0 0 0 0 0 0] - [-------+-----------------------+-------------------------------------------------------] - [ 0| 0 0 0| 0 0 0 0 0 0 2*a] - [ 0| 0 0 0| 1 0 0 0 0 0 6*a + 3] - [ 0| 0 0 0| 0 1 0 0 0 0 6*a + 1] - [ 0| 0 0 0| 0 0 1 0 0 0 a + 2] - [ 0| 0 0 0| 0 0 0 1 0 0 a + 6] - [ 0| 0 0 0| 0 0 0 0 1 0 2*a + 1] - [ 0| 0 0 0| 0 0 0 0 0 1 2*a + 1] + [a + 2|0 0 0|0 0 0 0 0 0 0] + [-----+-----------+-------------------] + [ 0|0 0 a + 6|0 0 0 0 0 0 0] + [ 0|1 0 6*a + 4|0 0 0 0 0 0 0] + [ 0|0 1 6*a + 4|0 0 0 0 0 0 0] + [-----+-----------+-------------------] + [ 0|0 0 0|0 0 0 0 0 0 2*a] + [ 0|0 0 0|1 0 0 0 0 0 6*a + 3] + [ 0|0 0 0|0 1 0 0 0 0 6*a + 1] + [ 0|0 0 0|0 0 1 0 0 0 a + 2] + [ 0|0 0 0|0 0 0 1 0 0 a + 6] + [ 0|0 0 0|0 0 0 0 1 0 2*a + 1] + [ 0|0 0 0|0 0 0 0 0 1 2*a + 1] sage: invariants = A.rational_form(format='invariants') sage: invariants [[6*a + 5, 1], [6*a + 1, a + 3, a + 3, 1], [5*a, a + 4, a + 6, 6*a + 5, 6*a + 1, 5*a + 6, 5*a + 6, 1]] diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx index 915f44bcd37..1f6e335c043 100644 --- a/src/sage/matrix/matrix_double_dense.pyx +++ b/src/sage/matrix/matrix_double_dense.pyx @@ -3331,10 +3331,10 @@ cdef class Matrix_double_dense(Matrix_numpy_dense): True sage: L = A.cholesky() sage: L.round(6).zero_at(10^-10) - [ 4.795832 0.0 0.0 0.0] - [ 0.625543 - 3.544745*I 5.004346 0.0 0.0] - [ 5.21286 - 5.004346*I 13.588189 + 10.721116*I 24.984023 0.0] - [ -4.378803*I -0.104257 - 0.851434*I -0.21486 + 0.371348*I 2.811799] + [ 4.795832 0.0 0.0 0.0] + [0.625543 - 3.544745*I 5.004346 0.0 0.0] + [ 5.21286 - 5.004346*I 13.588189 + 10.721116*I 24.984023 0.0] + [ -4.378803*I -0.104257 - 0.851434*I -0.21486 + 0.371348*I 2.811799] sage: (L*L.conjugate_transpose()).round(6).zero_at(10^-10) [ 23.0 3.0 + 17.0*I 25.0 + 24.0*I 21.0*I] [ 3.0 - 17.0*I 38.0 89.0 - 69.0*I 15.0 + 7.0*I] diff --git a/src/sage/matrix/matrix_mpolynomial_dense.pyx b/src/sage/matrix/matrix_mpolynomial_dense.pyx index 3de6f32bcd5..1ff2de26b42 100644 --- a/src/sage/matrix/matrix_mpolynomial_dense.pyx +++ b/src/sage/matrix/matrix_mpolynomial_dense.pyx @@ -238,8 +238,8 @@ cdef class Matrix_mpolynomial_dense(Matrix_generic_dense): ....: [ -1/3*x*y - 3, x*y - x]]) sage: E = C.echelon_form('bareiss') # indirect doctest sage: E - [ -1/3*x*y - 3 x*y - x] - [ 0 6/5*x^2*y^2 + 3*x*y^3 - 6/5*x^2*y - 11/12*x*y^2 + 18*y^2 + 3/4*y] + [-1/3*x*y - 3 x*y - x] + [ 0 6/5*x^2*y^2 + 3*x*y^3 - 6/5*x^2*y - 11/12*x*y^2 + 18*y^2 + 3/4*y] sage: E.swapped_columns() (0, 1) @@ -354,15 +354,15 @@ cdef class Matrix_mpolynomial_dense(Matrix_generic_dense): sage: A = Matrix(P, 9, 5, l) sage: B = A.__copy__() sage: B.echelonize('row_reduction'); B - [ 1 0 0 0 x0*y0 + x1 + 1] - [ 0 1 0 0 x0*y0] - [ 0 0 1 0 x0*y0 + x0 + x1] - [ 0 0 0 1 x0*y0 + x0] - [ 0 0 0 0 x0 + y1] - [ 0 0 0 0 x1 + y0 + 1] - [ 0 0 0 0 x0*y1 + x0] - [ 0 0 0 0 x1*y0] - [ 0 0 0 0 x0*y0 + x1*y1 + x0] + [1 0 0 0 x0*y0 + x1 + 1] + [0 1 0 0 x0*y0] + [0 0 1 0 x0*y0 + x0 + x1] + [0 0 0 1 x0*y0 + x0] + [0 0 0 0 x0 + y1] + [0 0 0 0 x1 + y0 + 1] + [0 0 0 0 x0*y1 + x0] + [0 0 0 0 x1*y0] + [0 0 0 0 x0*y0 + x1*y1 + x0] This is the same result as SINGULAR's ``rowred`` command which returns:: diff --git a/src/sage/matrix/matrix_polynomial_dense.pyx b/src/sage/matrix/matrix_polynomial_dense.pyx index 5baba4c0bfe..ae5ae684793 100644 --- a/src/sage/matrix/matrix_polynomial_dense.pyx +++ b/src/sage/matrix/matrix_polynomial_dense.pyx @@ -2095,8 +2095,8 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense): Demonstrating shifts:: sage: P = M.weak_popov_form(shifts=[0,2,4]); P - [ 6*x^2 + 6*x + 4 5*x^4 + 4*x^3 + 5*x^2 + 5*x 2*x + 2] - [ 2 4*x^2 + 2*x + 4 5] + [6*x^2 + 6*x + 4 5*x^4 + 4*x^3 + 5*x^2 + 5*x 2*x + 2] + [ 2 4*x^2 + 2*x + 4 5] sage: P == M.weak_popov_form(shifts=[-10,-8,-6]) True @@ -2387,8 +2387,8 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense): sage: # needs sage.combinat sage: P = M.popov_form(shifts=[0,2,4]); P - [ 4*x^2 + 3*x + 4 x^4 + 3*x^3 + 5*x^2 + 5*x + 5 0] - [ 6 5*x^2 + 6*x + 5 1] + [4*x^2 + 3*x + 4 x^4 + 3*x^3 + 5*x^2 + 5*x + 5 0] + [ 6 5*x^2 + 6*x + 5 1] sage: P.is_popov(shifts=[0,2,4]) True sage: P == M.popov_form(shifts=[-6,-4,-2]) diff --git a/src/sage/matrix/symplectic_basis.py b/src/sage/matrix/symplectic_basis.py index de8cb9401df..22ac2378db5 100644 --- a/src/sage/matrix/symplectic_basis.py +++ b/src/sage/matrix/symplectic_basis.py @@ -244,14 +244,14 @@ def symplectic_basis_over_field(M): An inexact example:: sage: E = matrix(RR, 8, 8, [0.000000000000000, 0.420674846479344, -0.839702420666807, 0.658715385244413, 1.69467394825853, -1.14718543053828, 1.03076138152950, -0.227739521708484, -0.420674846479344, 0.000000000000000, 0.514381455379082, 0.282194064028260, -1.38977093018412, 0.278305070958958, -0.0781320488361574, -0.496003664217833, 0.839702420666807, -0.514381455379082, 0.000000000000000, -0.00618222322875384, -0.318386939149028, -0.0840205427053993, 1.28202592892333, -0.512563654267693, -0.658715385244413, -0.282194064028260, 0.00618222322875384, 0.000000000000000, 0.852525732369211, -0.356957405431611, -0.699960114607661, 0.0260496330859998, -1.69467394825853, 1.38977093018412, 0.318386939149028, -0.852525732369211, 0.000000000000000, -0.836072521423577, 0.450137632758469, -0.696145287292091, 1.14718543053828, -0.278305070958958, 0.0840205427053993, 0.356957405431611, 0.836072521423577, 0.000000000000000, 0.214878541347751, -1.20221688928379, -1.03076138152950, 0.0781320488361574, -1.28202592892333, 0.699960114607661, -0.450137632758469, -0.214878541347751, 0.000000000000000, 0.785074452163036, 0.227739521708484, 0.496003664217833, 0.512563654267693, -0.0260496330859998, 0.696145287292091, 1.20221688928379, -0.785074452163036, 0.000000000000000]); E - [ 0.000000000000000 0.420674846479344 -0.839702420666807 0.658715385244413 1.69467394825853 -1.14718543053828 1.03076138152950 -0.227739521708484] - [ -0.420674846479344 0.000000000000000 0.514381455379082 0.282194064028260 -1.38977093018412 0.278305070958958 -0.0781320488361574 -0.496003664217833] - [ 0.839702420666807 -0.514381455379082 0.000000000000000 -0.00618222322875384 -0.318386939149028 -0.0840205427053993 1.28202592892333 -0.512563654267693] - [ -0.658715385244413 -0.282194064028260 0.00618222322875384 0.000000000000000 0.852525732369211 -0.356957405431611 -0.699960114607661 0.0260496330859998] - [ -1.69467394825853 1.38977093018412 0.318386939149028 -0.852525732369211 0.000000000000000 -0.836072521423577 0.450137632758469 -0.696145287292091] - [ 1.14718543053828 -0.278305070958958 0.0840205427053993 0.356957405431611 0.836072521423577 0.000000000000000 0.214878541347751 -1.20221688928379] - [ -1.03076138152950 0.0781320488361574 -1.28202592892333 0.699960114607661 -0.450137632758469 -0.214878541347751 0.000000000000000 0.785074452163036] - [ 0.227739521708484 0.496003664217833 0.512563654267693 -0.0260496330859998 0.696145287292091 1.20221688928379 -0.785074452163036 0.000000000000000] + [ 0.000000000000000 0.420674846479344 -0.839702420666807 0.658715385244413 1.69467394825853 -1.14718543053828 1.03076138152950 -0.227739521708484] + [-0.420674846479344 0.000000000000000 0.514381455379082 0.282194064028260 -1.38977093018412 0.278305070958958 -0.0781320488361574 -0.496003664217833] + [ 0.839702420666807 -0.514381455379082 0.000000000000000 -0.00618222322875384 -0.318386939149028 -0.0840205427053993 1.28202592892333 -0.512563654267693] + [-0.658715385244413 -0.282194064028260 0.00618222322875384 0.000000000000000 0.852525732369211 -0.356957405431611 -0.699960114607661 0.0260496330859998] + [ -1.69467394825853 1.38977093018412 0.318386939149028 -0.852525732369211 0.000000000000000 -0.836072521423577 0.450137632758469 -0.696145287292091] + [ 1.14718543053828 -0.278305070958958 0.0840205427053993 0.356957405431611 0.836072521423577 0.000000000000000 0.214878541347751 -1.20221688928379] + [ -1.03076138152950 0.0781320488361574 -1.28202592892333 0.699960114607661 -0.450137632758469 -0.214878541347751 0.000000000000000 0.785074452163036] + [ 0.227739521708484 0.496003664217833 0.512563654267693 -0.0260496330859998 0.696145287292091 1.20221688928379 -0.785074452163036 0.000000000000000] sage: F, C = symplectic_basis_over_field(E); F # random [ 0.000000000000000 0.000000000000000 2.22044604925031e-16 -2.22044604925031e-16 1.00000000000000 0.000000000000000 0.000000000000000 -3.33066907387547e-16] [ 0.000000000000000 8.14814392305203e-17 -1.66533453693773e-16 -1.11022302462516e-16 0.000000000000000 1.00000000000000 -1.11022302462516e-16 0.000000000000000] diff --git a/src/sage/modular/btquotients/btquotient.py b/src/sage/modular/btquotients/btquotient.py index d38c2a4b93e..c26a393c1e1 100644 --- a/src/sage/modular/btquotients/btquotient.py +++ b/src/sage/modular/btquotients/btquotient.py @@ -2389,20 +2389,20 @@ def get_embedding_matrix(self, prec=None, exact=False): sage: X = BruhatTitsQuotient(7,2*3*5) sage: X.get_embedding_matrix(4) - [ 1 + O(7^4) 5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 6 + 3*7^2 + 4*7^3 + O(7^4)] - [ O(7^4) O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] - [ O(7^4) 2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 3 + 3*7 + 3*7^2 + O(7^4)] - [ 1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] + [1 + O(7^4) 5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 6 + 3*7^2 + 4*7^3 + O(7^4)] + [ O(7^4) O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] + [ O(7^4) 2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 3 + 3*7 + 3*7^2 + O(7^4)] + [1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] sage: X.get_embedding_matrix(3) - [ 1 + O(7^4) 5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 6 + 3*7^2 + 4*7^3 + O(7^4)] - [ O(7^4) O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] - [ O(7^4) 2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 3 + 3*7 + 3*7^2 + O(7^4)] - [ 1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] + [1 + O(7^4) 5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 6 + 3*7^2 + 4*7^3 + O(7^4)] + [ O(7^4) O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] + [ O(7^4) 2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 + 6*7^2 + 6*7^3 + O(7^4) 3 + 3*7 + 3*7^2 + O(7^4)] + [1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4) 3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)] sage: X.get_embedding_matrix(5) - [ 1 + O(7^5) 5 + 2*7 + 3*7^3 + 6*7^4 + O(7^5) 4 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5) 6 + 3*7^2 + 4*7^3 + 5*7^4 + O(7^5)] - [ O(7^5) O(7^5) 3 + 7 + O(7^5) 1 + 6*7 + 3*7^2 + 2*7^3 + 7^4 + O(7^5)] - [ O(7^5) 2 + 5*7 + 6*7^3 + 5*7^4 + O(7^5) 3 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5) 3 + 3*7 + 3*7^2 + 5*7^4 + O(7^5)] - [ 1 + O(7^5) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^5) 3 + 7 + O(7^5) 1 + 6*7 + 3*7^2 + 2*7^3 + 7^4 + O(7^5)] + [1 + O(7^5) 5 + 2*7 + 3*7^3 + 6*7^4 + O(7^5) 4 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5) 6 + 3*7^2 + 4*7^3 + 5*7^4 + O(7^5)] + [ O(7^5) O(7^5) 3 + 7 + O(7^5) 1 + 6*7 + 3*7^2 + 2*7^3 + 7^4 + O(7^5)] + [ O(7^5) 2 + 5*7 + 6*7^3 + 5*7^4 + O(7^5) 3 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5) 3 + 3*7 + 3*7^2 + 5*7^4 + O(7^5)] + [1 + O(7^5) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^5) 3 + 7 + O(7^5) 1 + 6*7 + 3*7^2 + 2*7^3 + 7^4 + O(7^5)] """ if exact is True: try: diff --git a/src/sage/modular/hecke/module.py b/src/sage/modular/hecke/module.py index 434a2865001..780fa97a04b 100644 --- a/src/sage/modular/hecke/module.py +++ b/src/sage/modular/hecke/module.py @@ -141,9 +141,9 @@ def _compute_hecke_matrix_prime_power(self, p, r, **kwds): sage: M = ModularForms(SL2Z, 24) sage: M._compute_hecke_matrix_prime_power(3, 3) - [ -4112503986561480 53074162446443642880 0] - [ 2592937954080 -1312130996155080 0] - [ 0 0 834385168339943471891603972970040] + [-4112503986561480 53074162446443642880 0] + [ 2592937954080 -1312130996155080 0] + [ 0 0 834385168339943471891603972970040] """ # convert input arguments to int's. p, r = (int(p), int(r)) diff --git a/src/sage/modular/modform/ambient_g1.py b/src/sage/modular/modform/ambient_g1.py index e331ab051f5..cd6f8361905 100644 --- a/src/sage/modular/modform/ambient_g1.py +++ b/src/sage/modular/modform/ambient_g1.py @@ -130,15 +130,15 @@ def _compute_hecke_matrix(self, n): EXAMPLES:: sage: ModularForms(Gamma1(7), 4).hecke_matrix(3) # indirect doctest - [ 0 -42 133 0 0 0 0 0 0] - [ 0 -28 91 0 0 0 0 0 0] - [ 1 -8 19 0 0 0 0 0 0] - [ 0 0 0 28 0 0 0 0 0] - [ 0 0 0 -10152/259 0 5222/37 -13230/37 -22295/37 92504/37] - [ 0 0 0 -6087/259 0 312067/4329 1370420/4329 252805/333 3441466/4329] - [ 0 0 0 -729/259 1 485/37 3402/37 5733/37 7973/37] - [ 0 0 0 729/259 0 -189/37 -1404/37 -2366/37 -3348/37] - [ 0 0 0 255/259 0 -18280/4329 -51947/4329 -10192/333 -190855/4329] + [0 -42 133 0 0 0 0 0 0] + [0 -28 91 0 0 0 0 0 0] + [1 -8 19 0 0 0 0 0 0] + [0 0 0 28 0 0 0 0 0] + [0 0 0 -10152/259 0 5222/37 -13230/37 -22295/37 92504/37] + [0 0 0 -6087/259 0 312067/4329 1370420/4329 252805/333 3441466/4329] + [0 0 0 -729/259 1 485/37 3402/37 5733/37 7973/37] + [0 0 0 729/259 0 -189/37 -1404/37 -2366/37 -3348/37] + [0 0 0 255/259 0 -18280/4329 -51947/4329 -10192/333 -190855/4329] """ return self.cuspidal_submodule().hecke_matrix(n).block_sum(self.eisenstein_submodule().hecke_matrix(n)) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index f98211a3218..eeaa16971d9 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -1239,8 +1239,8 @@ def _to_matrix(self, gens=None, prec=None): [ 1 720] [ 1 -1008] sage: M._to_matrix(gens, 6) - [ 1 720 179280 16954560 396974160 4632858720 34413301440] - [ 1 -1008 220752 16519104 399517776 4624512480 34423752384] + [1 720 179280 16954560 396974160 4632858720 34413301440] + [1 -1008 220752 16519104 399517776 4624512480 34423752384] """ if gens is None: gens = self.gen_forms() diff --git a/src/sage/modular/modsym/space.py b/src/sage/modular/modsym/space.py index f90bf5926fc..a3c81e28669 100644 --- a/src/sage/modular/modsym/space.py +++ b/src/sage/modular/modsym/space.py @@ -855,8 +855,8 @@ def q_expansion_module(self, prec=None, R=None): sage: D[0].q_expansion_module(11) Vector space of degree 11 and dimension 2 over Cyclotomic Field of order 10 and degree 4 Basis matrix: - [ 0 1 0 zeta10^2 - 1 -zeta10^2 - 1 -zeta10^3 - zeta10^2 zeta10^2 - zeta10 2*zeta10^3 + 2*zeta10 - 1 zeta10^3 - zeta10^2 - zeta10 + 1 zeta10^3 - zeta10^2 + zeta10 -2*zeta10^3 + 2*zeta10^2 - zeta10] - [ 0 0 1 zeta10^3 + zeta10 - 1 -zeta10 - 1 -zeta10^3 - zeta10^2 -2*zeta10^3 + zeta10^2 - zeta10 + 1 zeta10^2 0 zeta10^3 + 1 2*zeta10^3 - zeta10^2 + zeta10 - 1] + [0 1 0 zeta10^2 - 1 -zeta10^2 - 1 -zeta10^3 - zeta10^2 zeta10^2 - zeta10 2*zeta10^3 + 2*zeta10 - 1 zeta10^3 - zeta10^2 - zeta10 + 1 zeta10^3 - zeta10^2 + zeta10 -2*zeta10^3 + 2*zeta10^2 - zeta10] + [0 0 1 zeta10^3 + zeta10 - 1 -zeta10 - 1 -zeta10^3 - zeta10^2 -2*zeta10^3 + zeta10^2 - zeta10 + 1 zeta10^2 0 zeta10^3 + 1 2*zeta10^3 - zeta10^2 + zeta10 - 1] EXAMPLES WITH SIGN 0 and R=QQ: diff --git a/src/sage/modular/overconvergent/genus0.py b/src/sage/modular/overconvergent/genus0.py index ad6f9c73c4e..cb81e2df066 100644 --- a/src/sage/modular/overconvergent/genus0.py +++ b/src/sage/modular/overconvergent/genus0.py @@ -1037,9 +1037,9 @@ def hecke_matrix(self, m, n, use_recurrence=False, exact_arith=False, side='left [ 0 2^4 + O(2^6) 2^7 + 2^8 + O(2^9)] sage: o = OverconvergentModularForms(2, 12, 1/2, base_ring=pAdicField(2)) sage: o.hecke_matrix(2, 3, exact_arith=True) - [ 1 0 0] - [ 0 33881928/1414477 64] - [ 0 -192898739923312/2000745183529 1626332544/1414477] + [1 0 0] + [0 33881928/1414477 64] + [0 -192898739923312/2000745183529 1626332544/1414477] Side switch:: diff --git a/src/sage/modular/ssmod/ssmod.py b/src/sage/modular/ssmod/ssmod.py index ecafd5ab405..8d43831a050 100644 --- a/src/sage/modular/ssmod/ssmod.py +++ b/src/sage/modular/ssmod/ssmod.py @@ -13,15 +13,15 @@ sage: D[:3] [(Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: - [ 0 0 0 1 96 96 1 0 95 1 1 1 1 95 2 96 0 0 96 0 96 0 96 2 96 96 0 1 0 2 1 95 0], + [0 0 0 1 96 96 1 0 95 1 1 1 1 95 2 96 0 0 96 0 96 0 96 2 96 96 0 1 0 2 1 95 0], True), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: - [ 0 1 96 16 75 22 81 0 0 17 17 80 80 0 0 74 40 1 16 57 23 96 81 0 74 23 0 24 0 0 73 0 0], + [0 1 96 16 75 22 81 0 0 17 17 80 80 0 0 74 40 1 16 57 23 96 81 0 74 23 0 24 0 0 73 0 0], True), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: - [ 0 1 96 90 90 7 7 0 0 91 6 6 91 0 0 91 0 13 7 0 6 84 90 0 6 91 0 90 0 0 7 0 0], + [0 1 96 90 90 7 7 0 0 91 6 6 91 0 0 91 0 13 7 0 6 84 90 0 6 91 0 90 0 0 7 0 0], True)] sage: len(D) 9 diff --git a/src/sage/modules/ore_module.py b/src/sage/modules/ore_module.py index 83e335cdf85..42f8ae5e1d0 100644 --- a/src/sage/modules/ore_module.py +++ b/src/sage/modules/ore_module.py @@ -1364,8 +1364,8 @@ def _span(self, gens): Defining e0, e1, e2, e3, e4 sage: M._span([Q*e0]) - [ 1 0 a^4 + 5*a^3 + 6*a^2 + a 1 6*a^2] - [ 0 1 2*a^4 + 6*a^2 + 2*a + 3 0 1] + [1 0 a^4 + 5*a^3 + 6*a^2 + a 1 6*a^2] + [0 1 2*a^4 + 6*a^2 + 2*a + 3 0 1] sage: M._span([Q*e0, e1]) [1 0 0 0 0] diff --git a/src/sage/quivers/path_semigroup.py b/src/sage/quivers/path_semigroup.py index 2481a35e42b..91e8d2db9c4 100644 --- a/src/sage/quivers/path_semigroup.py +++ b/src/sage/quivers/path_semigroup.py @@ -960,9 +960,9 @@ def _poincare_series(self): sage: S = DiGraph({0:{1:['a'], 2:['b']}, 1:{0:['c'], 1:['d']}, 2:{0:['e'],2:['f']}}).path_semigroup() sage: S._poincare_series - [ (-t + 1)/(-2*t^2 - t + 1) t/(-2*t^2 - t + 1) t/(-2*t^2 - t + 1)] - [ t/(-2*t^2 - t + 1) (t^2 + t - 1)/(-2*t^3 + t^2 + 2*t - 1) -t^2/(-2*t^3 + t^2 + 2*t - 1)] - [ t/(-2*t^2 - t + 1) -t^2/(-2*t^3 + t^2 + 2*t - 1) (-t^2 - t + 1)/(2*t^3 - t^2 - 2*t + 1)] + [(-t + 1)/(-2*t^2 - t + 1) t/(-2*t^2 - t + 1) t/(-2*t^2 - t + 1)] + [ t/(-2*t^2 - t + 1) (t^2 + t - 1)/(-2*t^3 + t^2 + 2*t - 1) -t^2/(-2*t^3 + t^2 + 2*t - 1)] + [ t/(-2*t^2 - t + 1) -t^2/(-2*t^3 + t^2 + 2*t - 1) (-t^2 - t + 1)/(2*t^3 - t^2 - 2*t + 1)] Let us check that the result is plausible. We study the paths from vertex `1` to vertex `2`. The number of paths sorted by length are diff --git a/src/sage/rings/lazy_series.py b/src/sage/rings/lazy_series.py index 9ffb120eb38..6fdf6e0a5d8 100644 --- a/src/sage/rings/lazy_series.py +++ b/src/sage/rings/lazy_series.py @@ -205,8 +205,8 @@ sage: a22 = 1 + L(lambda n: 1 if n == 3 else 0, valuation=0) sage: m = matrix([[a11, a12], [a21, a22]]) sage: m.inverse() - [ 1 + z + 2*z^2 + 3*z^3 + 4*z^4 + 5*z^5 + 6*z^6 + O(z^7) -1 - 2*z - 3*z^2 - 4*z^3 - 5*z^4 - 6*z^5 - 7*z^6 + O(z^7)] - [ -1 - z - 3*z^2 - 3*z^3 - 5*z^4 - 5*z^5 - 7*z^6 + O(z^7) 2 + 2*z + 4*z^2 + 4*z^3 + 6*z^4 + 6*z^5 + 8*z^6 + O(z^7)] + [ 1 + z + 2*z^2 + 3*z^3 + 4*z^4 + 5*z^5 + 6*z^6 + O(z^7) -1 - 2*z - 3*z^2 - 4*z^3 - 5*z^4 - 6*z^5 - 7*z^6 + O(z^7)] + [-1 - z - 3*z^2 - 3*z^3 - 5*z^4 - 5*z^5 - 7*z^6 + O(z^7) 2 + 2*z + 4*z^2 + 4*z^3 + 6*z^4 + 6*z^5 + 8*z^6 + O(z^7)] """ # **************************************************************************** diff --git a/src/sage/rings/morphism.pyx b/src/sage/rings/morphism.pyx index 88060589876..c1931c4b51a 100644 --- a/src/sage/rings/morphism.pyx +++ b/src/sage/rings/morphism.pyx @@ -2164,8 +2164,8 @@ cdef class RingHomomorphism_from_base(RingHomomorphism): Defn: x |--> 2*z y |--> 3*z sage: MPf(M) - [ z*t^2 + 58*t - 6*z^2 (-6/7*z^2 - 1/20*z)*t^2 + 29*z^2*t + 6*z] - [ (-z + 1)*t^2 + 11*z^2 + 15/2*z + 1/4 (20*z + 1)*t^2] + [ z*t^2 + 58*t - 6*z^2 (-6/7*z^2 - 1/20*z)*t^2 + 29*z^2*t + 6*z] + [(-z + 1)*t^2 + 11*z^2 + 15/2*z + 1/4 (20*z + 1)*t^2] """ def __init__(self, parent, underlying): """ diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index 591d1e9641c..7e2c66908ca 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -6664,10 +6664,10 @@ def reduced_gram_matrix(self, prec=None): sage: x = polygen(QQ) sage: F. = NumberField(x^4 + x^2 + 712312*x + 131001238) sage: F.reduced_gram_matrix(prec=128) - [ 4.0000000000000000000000000000000000000 0.00000000000000000000000000000000000000 -1.9999999999999999999999999999999999037 -0.99999999999999999999999999999999383702] - [ 0.00000000000000000000000000000000000000 46721.539331563218381658483353092335550 -11488.910026551724275122749703614966768 -418.12718083977141198754424579680468382] - [ -1.9999999999999999999999999999999999037 -11488.910026551724275122749703614966768 5.5658915310500611768713076521847709187e8 1.4179092271494070050433368847682152174e8] - [ -0.99999999999999999999999999999999383702 -418.12718083977141198754424579680468382 1.4179092271494070050433368847682152174e8 1.3665897267919181137884111201405279175e12] + [ 4.0000000000000000000000000000000000000 0.00000000000000000000000000000000000000 -1.9999999999999999999999999999999999037 -0.99999999999999999999999999999999383702] + [ 0.00000000000000000000000000000000000000 46721.539331563218381658483353092335550 -11488.910026551724275122749703614966768 -418.12718083977141198754424579680468382] + [ -1.9999999999999999999999999999999999037 -11488.910026551724275122749703614966768 5.5658915310500611768713076521847709187e8 1.4179092271494070050433368847682152174e8] + [-0.99999999999999999999999999999999383702 -418.12718083977141198754424579680468382 1.4179092271494070050433368847682152174e8 1.3665897267919181137884111201405279175e12] """ if self.is_totally_real(): try: diff --git a/src/sage/rings/padics/lattice_precision.py b/src/sage/rings/padics/lattice_precision.py index d3c927c8119..b4c55c02226 100644 --- a/src/sage/rings/padics/lattice_precision.py +++ b/src/sage/rings/padics/lattice_precision.py @@ -2106,14 +2106,14 @@ def precision_lattice(self, elements=None): We can give a list of matrices as well:: sage: prec.precision_lattice([M, N]) # needs sage.modules - [ 32 0 0 0 226115584 96788480 52174848 82804736] - [ 0 32 0 0 52174848 121765888 11829248 28516352] - [ 0 0 32 0 96788480 42762240 121765888 199614464] - [ 0 0 0 2 5175296 12475904 1782272 4045824] - [ 0 0 0 0 268435456 0 0 0] - [ 0 0 0 0 0 268435456 0 0] - [ 0 0 0 0 0 0 268435456 0] - [ 0 0 0 0 0 0 0 268435456] + [32 0 0 0 226115584 96788480 52174848 82804736] + [ 0 32 0 0 52174848 121765888 11829248 28516352] + [ 0 0 32 0 96788480 42762240 121765888 199614464] + [ 0 0 0 2 5175296 12475904 1782272 4045824] + [ 0 0 0 0 268435456 0 0 0] + [ 0 0 0 0 0 268435456 0 0] + [ 0 0 0 0 0 0 268435456 0] + [ 0 0 0 0 0 0 0 268435456] """ if elements is None: elements = self._elements diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 996cea78a4f..5944aaa097d 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -572,7 +572,7 @@ ....: [0, 0, 0, -4096, -1024*I, 256, 64*I, -16, -4*I, 1], ....: [0, 0, 0, -4096, 1024*I, 256, -64*I, -16, 4*I, 1]]) sage: M.right_kernel_matrix() - [ 1.000000000000000? + 0.?e-16*I 0 0 -0.00925925925925926? + 0.?e-19*I 0.?e-35 + 0.?e-18*I -0.11111111111111111? + 0.?e-18*I 0.?e-34 + 0.?e-17*I 0.5555555555555555? + 0.?e-16*I 0 -0.5925925925925926? + 0.?e-17*I] + [1.000000000000000? + 0.?e-16*I 0 0 -0.00925925925925926? + 0.?e-19*I 0.?e-35 + 0.?e-18*I -0.11111111111111111? + 0.?e-18*I 0.?e-34 + 0.?e-17*I 0.5555555555555555? + 0.?e-16*I 0 -0.5925925925925926? + 0.?e-17*I] AUTHOR: diff --git a/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py b/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py index 850d9e975ea..e008fc25ede 100644 --- a/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py +++ b/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py @@ -35,15 +35,15 @@ sage: p = 107 sage: x = PolynomialRing(GF(p),"x").gen() sage: CyclicCover(2, x^5 + x).frobenius_matrix() - [ O(107^2) 89*107 + O(107^2) O(107^2) O(107^2)] - [ 89*107 + O(107^2) O(107^2) O(107^2) O(107^2)] - [ O(107^2) O(107^2) O(107^2) 105 + 5*107 + O(107^2)] - [ O(107^2) O(107^2) 89 + 53*107 + O(107^2) O(107^2)] + [ O(107^2) 89*107 + O(107^2) O(107^2) O(107^2)] + [89*107 + O(107^2) O(107^2) O(107^2) O(107^2)] + [ O(107^2) O(107^2) O(107^2) 105 + 5*107 + O(107^2)] + [ O(107^2) O(107^2) 89 + 53*107 + O(107^2) O(107^2)] sage: CyclicCover(2, 3*x^5 + x).frobenius_matrix() - [ O(107^2) 14*107 + O(107^2) O(107^2) O(107^2)] - [ 69*107 + O(107^2) O(107^2) O(107^2) O(107^2)] - [ O(107^2) O(107^2) O(107^2) 61 + 58*107 + O(107^2)] - [ O(107^2) O(107^2) 69 + 53*107 + O(107^2) O(107^2)] + [ O(107^2) 14*107 + O(107^2) O(107^2) O(107^2)] + [69*107 + O(107^2) O(107^2) O(107^2) O(107^2)] + [ O(107^2) O(107^2) O(107^2) 61 + 58*107 + O(107^2)] + [ O(107^2) O(107^2) 69 + 53*107 + O(107^2) O(107^2)] sage: CyclicCover(3, x^3 + x).frobenius_matrix() [ 0 0 O(107) O(107)] [ 0 0 52 + O(107) O(107)] @@ -1026,15 +1026,15 @@ def frobenius_matrix(self, N=None): sage: p = 107 sage: x = PolynomialRing(GF(p), "x").gen() sage: CyclicCover(2, x^5 + x).frobenius_matrix() - [ O(107^2) 89*107 + O(107^2) O(107^2) O(107^2)] - [ 89*107 + O(107^2) O(107^2) O(107^2) O(107^2)] - [ O(107^2) O(107^2) O(107^2) 105 + 5*107 + O(107^2)] - [ O(107^2) O(107^2) 89 + 53*107 + O(107^2) O(107^2)] + [ O(107^2) 89*107 + O(107^2) O(107^2) O(107^2)] + [89*107 + O(107^2) O(107^2) O(107^2) O(107^2)] + [ O(107^2) O(107^2) O(107^2) 105 + 5*107 + O(107^2)] + [ O(107^2) O(107^2) 89 + 53*107 + O(107^2) O(107^2)] sage: CyclicCover(2, 3*x^5 + x).frobenius_matrix() - [ O(107^2) 14*107 + O(107^2) O(107^2) O(107^2)] - [ 69*107 + O(107^2) O(107^2) O(107^2) O(107^2)] - [ O(107^2) O(107^2) O(107^2) 61 + 58*107 + O(107^2)] - [ O(107^2) O(107^2) 69 + 53*107 + O(107^2) O(107^2)] + [ O(107^2) 14*107 + O(107^2) O(107^2) O(107^2)] + [69*107 + O(107^2) O(107^2) O(107^2) O(107^2)] + [ O(107^2) O(107^2) O(107^2) 61 + 58*107 + O(107^2)] + [ O(107^2) O(107^2) 69 + 53*107 + O(107^2) O(107^2)] sage: CyclicCover(3, x^3 + x).frobenius_matrix() [ 0 0 O(107) O(107)] [ 0 0 52 + O(107) O(107)] diff --git a/src/sage/schemes/elliptic_curves/padic_lseries.py b/src/sage/schemes/elliptic_curves/padic_lseries.py index 6cb54115933..bff350a8469 100644 --- a/src/sage/schemes/elliptic_curves/padic_lseries.py +++ b/src/sage/schemes/elliptic_curves/padic_lseries.py @@ -1473,8 +1473,8 @@ def frobenius(self, prec=20, algorithm='mw'): sage: L = E.padic_lseries(5) sage: phi = L.frobenius(5) sage: phi - [ 2 + 5^2 + 5^4 + O(5^5) 3*5^-1 + 3 + 5 + 4*5^2 + 5^3 + O(5^4)] - [ 3 + 3*5^2 + 4*5^3 + 3*5^4 + O(5^5) 3 + 4*5 + 3*5^2 + 4*5^3 + 3*5^4 + O(5^5)] + [ 2 + 5^2 + 5^4 + O(5^5) 3*5^-1 + 3 + 5 + 4*5^2 + 5^3 + O(5^4)] + [3 + 3*5^2 + 4*5^3 + 3*5^4 + O(5^5) 3 + 4*5 + 3*5^2 + 4*5^3 + 3*5^4 + O(5^5)] sage: -phi^2 [5^-1 + O(5^4) O(5^4)] [ O(5^5) 5^-1 + O(5^4)] diff --git a/src/sage/schemes/elliptic_curves/padics.py b/src/sage/schemes/elliptic_curves/padics.py index 87f985e7052..2477d8f5dcd 100644 --- a/src/sage/schemes/elliptic_curves/padics.py +++ b/src/sage/schemes/elliptic_curves/padics.py @@ -1602,8 +1602,8 @@ def matrix_of_frobenius(self, p, prec=20, check=False, check_hypotheses=True, al sage: E = EllipticCurve('37a1') sage: E.matrix_of_frobenius(7) - [ 2*7 + 4*7^2 + 5*7^4 + 6*7^5 + 6*7^6 + 7^8 + 4*7^9 + 3*7^10 + 2*7^11 + 5*7^12 + 4*7^14 + 7^16 + 2*7^17 + 3*7^18 + 4*7^19 + 3*7^20 + O(7^21) 2 + 3*7 + 6*7^2 + 7^3 + 3*7^4 + 5*7^5 + 3*7^7 + 7^8 + 3*7^9 + 6*7^13 + 7^14 + 7^16 + 5*7^17 + 4*7^18 + 7^19 + O(7^20)] - [ 2*7 + 3*7^2 + 7^3 + 3*7^4 + 6*7^5 + 2*7^6 + 3*7^7 + 5*7^8 + 3*7^9 + 2*7^11 + 6*7^12 + 5*7^13 + 4*7^16 + 4*7^17 + 6*7^18 + 6*7^19 + 4*7^20 + O(7^21) 6 + 4*7 + 2*7^2 + 6*7^3 + 7^4 + 6*7^7 + 5*7^8 + 2*7^9 + 3*7^10 + 4*7^11 + 7^12 + 6*7^13 + 2*7^14 + 6*7^15 + 5*7^16 + 4*7^17 + 3*7^18 + 2*7^19 + O(7^20)] + [ 2*7 + 4*7^2 + 5*7^4 + 6*7^5 + 6*7^6 + 7^8 + 4*7^9 + 3*7^10 + 2*7^11 + 5*7^12 + 4*7^14 + 7^16 + 2*7^17 + 3*7^18 + 4*7^19 + 3*7^20 + O(7^21) 2 + 3*7 + 6*7^2 + 7^3 + 3*7^4 + 5*7^5 + 3*7^7 + 7^8 + 3*7^9 + 6*7^13 + 7^14 + 7^16 + 5*7^17 + 4*7^18 + 7^19 + O(7^20)] + [2*7 + 3*7^2 + 7^3 + 3*7^4 + 6*7^5 + 2*7^6 + 3*7^7 + 5*7^8 + 3*7^9 + 2*7^11 + 6*7^12 + 5*7^13 + 4*7^16 + 4*7^17 + 6*7^18 + 6*7^19 + 4*7^20 + O(7^21) 6 + 4*7 + 2*7^2 + 6*7^3 + 7^4 + 6*7^7 + 5*7^8 + 2*7^9 + 3*7^10 + 4*7^11 + 7^12 + 6*7^13 + 2*7^14 + 6*7^15 + 5*7^16 + 4*7^17 + 3*7^18 + 2*7^19 + O(7^20)] sage: M = E.matrix_of_frobenius(11,prec=3); M [ 9*11 + 9*11^3 + O(11^4) 10 + 11 + O(11^3)] [ 2*11 + 11^2 + O(11^4) 6 + 11 + 10*11^2 + O(11^3)] @@ -1615,8 +1615,8 @@ def matrix_of_frobenius(self, p, prec=20, check=False, check_hypotheses=True, al -5 sage: E = EllipticCurve('83a1') sage: E.matrix_of_frobenius(3,6) - [ 2*3 + 3^5 + O(3^6) 2*3 + 2*3^2 + 2*3^3 + O(3^6)] - [ 2*3 + 3^2 + 2*3^5 + O(3^6) 2 + 2*3^2 + 2*3^3 + 2*3^4 + 3^5 + O(3^6)] + [ 2*3 + 3^5 + O(3^6) 2*3 + 2*3^2 + 2*3^3 + O(3^6)] + [2*3 + 3^2 + 2*3^5 + O(3^6) 2 + 2*3^2 + 2*3^3 + 2*3^4 + 3^5 + O(3^6)] """ p = Integer(p) prec = int(prec) diff --git a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx index 3dddecd4154..75ccc571ecb 100644 --- a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx +++ b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx @@ -182,10 +182,10 @@ def hypellfrob(p, N, Q): sage: R. = PolynomialRing(ZZ) sage: f = x^5 + 2*x^2 + x + 1; p = 101 sage: M = hypellfrob(p, 4, f); M - [ 91844754 + O(101^4) 38295665 + O(101^4) 44498269 + O(101^4) 11854028 + O(101^4)] - [ 93514789 + O(101^4) 48987424 + O(101^4) 53287857 + O(101^4) 61431148 + O(101^4)] - [ 77916046 + O(101^4) 60656459 + O(101^4) 101244586 + O(101^4) 56237448 + O(101^4)] - [ 58643832 + O(101^4) 81727988 + O(101^4) 85294589 + O(101^4) 70104432 + O(101^4)] + [91844754 + O(101^4) 38295665 + O(101^4) 44498269 + O(101^4) 11854028 + O(101^4)] + [93514789 + O(101^4) 48987424 + O(101^4) 53287857 + O(101^4) 61431148 + O(101^4)] + [77916046 + O(101^4) 60656459 + O(101^4) 101244586 + O(101^4) 56237448 + O(101^4)] + [58643832 + O(101^4) 81727988 + O(101^4) 85294589 + O(101^4) 70104432 + O(101^4)] sage: -M.trace() 7 + O(101^4) sage: sum(legendre_symbol(f(i), p) for i in range(p)) diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py index dc9ddc3e3f5..b6ef84281d3 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py @@ -43,10 +43,10 @@ def matrix_of_frobenius(self, p, prec=20): sage: R. = QQ['x'] sage: H = HyperellipticCurve(x^5 - 2*x + 3) sage: H.matrix_of_frobenius(K) - [ 4*5 + O(5^3) 5 + 2*5^2 + O(5^3) 2 + 3*5 + 2*5^2 + O(5^3) 2 + 5 + 5^2 + O(5^3)] - [ 3*5 + 5^2 + O(5^3) 3*5 + O(5^3) 4*5 + O(5^3) 2 + 5^2 + O(5^3)] - [ 4*5 + 4*5^2 + O(5^3) 3*5 + 2*5^2 + O(5^3) 5 + 3*5^2 + O(5^3) 2*5 + 2*5^2 + O(5^3)] - [ 5^2 + O(5^3) 5 + 4*5^2 + O(5^3) 4*5 + 3*5^2 + O(5^3) 2*5 + O(5^3)] + [ 4*5 + O(5^3) 5 + 2*5^2 + O(5^3) 2 + 3*5 + 2*5^2 + O(5^3) 2 + 5 + 5^2 + O(5^3)] + [ 3*5 + 5^2 + O(5^3) 3*5 + O(5^3) 4*5 + O(5^3) 2 + 5^2 + O(5^3)] + [4*5 + 4*5^2 + O(5^3) 3*5 + 2*5^2 + O(5^3) 5 + 3*5^2 + O(5^3) 2*5 + 2*5^2 + O(5^3)] + [ 5^2 + O(5^3) 5 + 4*5^2 + O(5^3) 4*5 + 3*5^2 + O(5^3) 2*5 + O(5^3)] You can also pass directly a prime `p` with to construct a pAdic field with precision ``prec``:: diff --git a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py index ac3ec459563..f235f3c7e46 100644 --- a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +++ b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py @@ -1787,10 +1787,10 @@ def matrix_of_frobenius_hyperelliptic(Q, p=None, prec=None, M=None): sage: R. = QQ['x'] sage: A,f = monsky_washnitzer.matrix_of_frobenius_hyperelliptic(x^5 - 2*x + 3, p, prec) sage: A - [ 4*5 + O(5^3) 5 + 2*5^2 + O(5^3) 2 + 3*5 + 2*5^2 + O(5^3) 2 + 5 + 5^2 + O(5^3)] - [ 3*5 + 5^2 + O(5^3) 3*5 + O(5^3) 4*5 + O(5^3) 2 + 5^2 + O(5^3)] - [ 4*5 + 4*5^2 + O(5^3) 3*5 + 2*5^2 + O(5^3) 5 + 3*5^2 + O(5^3) 2*5 + 2*5^2 + O(5^3)] - [ 5^2 + O(5^3) 5 + 4*5^2 + O(5^3) 4*5 + 3*5^2 + O(5^3) 2*5 + O(5^3)] + [ 4*5 + O(5^3) 5 + 2*5^2 + O(5^3) 2 + 3*5 + 2*5^2 + O(5^3) 2 + 5 + 5^2 + O(5^3)] + [ 3*5 + 5^2 + O(5^3) 3*5 + O(5^3) 4*5 + O(5^3) 2 + 5^2 + O(5^3)] + [4*5 + 4*5^2 + O(5^3) 3*5 + 2*5^2 + O(5^3) 5 + 3*5^2 + O(5^3) 2*5 + 2*5^2 + O(5^3)] + [ 5^2 + O(5^3) 5 + 4*5^2 + O(5^3) 4*5 + 3*5^2 + O(5^3) 2*5 + O(5^3)] """ prof = Profiler() prof("setup") diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py index 512ea11566f..98dc7ce915f 100644 --- a/src/sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py +++ b/src/sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py @@ -45,11 +45,11 @@ sage: ok, V = Similar(A, B); ok True sage: V - [ 1 2824643/1601680 -6818729/1601680 -43439399/11211760 73108601/11211760] - [ 0 342591/320336 -695773/320336 -2360063/11211760 -10291875/2242352] - [ 0 -367393/640672 673091/640672 -888723/4484704 15889341/4484704] - [ 0 661457/3203360 -565971/3203360 13485411/22423520 -69159661/22423520] - [ 0 -4846439/3203360 7915157/3203360 -32420037/22423520 285914347/22423520] + [1 2824643/1601680 -6818729/1601680 -43439399/11211760 73108601/11211760] + [0 342591/320336 -695773/320336 -2360063/11211760 -10291875/2242352] + [0 -367393/640672 673091/640672 -888723/4484704 15889341/4484704] + [0 661457/3203360 -565971/3203360 13485411/22423520 -69159661/22423520] + [0 -4846439/3203360 7915157/3203360 -32420037/22423520 285914347/22423520] sage: ok, V = Similar(2*A, B); ok False """ diff --git a/src/sage/tests/books/judson-abstract-algebra/galois-sage.py b/src/sage/tests/books/judson-abstract-algebra/galois-sage.py index af1f6fa8e6f..e779bcc9f2b 100644 --- a/src/sage/tests/books/judson-abstract-algebra/galois-sage.py +++ b/src/sage/tests/books/judson-abstract-algebra/galois-sage.py @@ -204,14 +204,14 @@ sage: tau_matrix = column_matrix([tau(be).vector() for be in basis]) sage: tau_matrix - [ 1 0 0 0 -28 0 0 0] - [ 0 -11/30 0 0 0 779/15 0 0] - [ 0 0 -14/25 0 0 0 -858/25 0] - [ 0 0 0 779/750 0 0 0 -4031/375] - [ 0 0 0 0 -1 0 0 0] - [ 0 1/60 0 0 0 11/30 0 0] - [ 0 0 -1/50 0 0 0 14/25 0] - [ 0 0 0 11/1500 0 0 0 -779/750] + [1 0 0 0 -28 0 0 0] + [0 -11/30 0 0 0 779/15 0 0] + [0 0 -14/25 0 0 0 -858/25 0] + [0 0 0 779/750 0 0 0 -4031/375] + [0 0 0 0 -1 0 0 0] + [0 1/60 0 0 0 11/30 0 0] + [0 0 -1/50 0 0 0 14/25 0] + [0 0 0 11/1500 0 0 0 -779/750] ~~~~~~~~~~~~~~~~~~~~~~ ::