You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-37608: src/sage/modules: Doctest cosmetics
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes#12345". -->
Standard reformatting of doctests and their outputs
Split out from #35095
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. -->
- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.
### ⌛ Dependencies
<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - #12345: short description why this is a dependency -->
<!-- - #34567: ... -->
URL: #37608
Reported by: Matthias Köppe
Reviewer(s): Frédéric Chapoton
sage: V = QQ^3; W = span([[1,2,3],[-1,2,5/3]], QQ)
95
-
sage: phi = V.hom(matrix(QQ,3,[1..9]))
94
+
sage: V = QQ^3; W = span([[1,2,3],[-1,2,5/3]], QQ)
95
+
sage: phi = V.hom(matrix(QQ, 3, [1..9]))
96
96
sage: phi.rank()
97
97
2
98
98
sage: phi(V) #indirect doctest
@@ -104,12 +104,12 @@ def pushforward(self, x):
104
104
We compute the image of a submodule of a ZZ-module embedded in
105
105
a rational vector space::
106
106
107
-
sage: V = QQ^3; W = V.span_of_basis([[2,2,3],[-1,2,5/3]], ZZ)
108
-
sage: phi = W.hom([W.0, W.0-W.1]); phi
107
+
sage: V = QQ^3; W = V.span_of_basis([[2,2,3],[-1,2,5/3]], ZZ)
108
+
sage: phi = W.hom([W.0, W.0 - W.1]); phi
109
109
Free module morphism defined by the matrix
110
110
[ 1 0]
111
111
[ 1 -1]...
112
-
sage: phi(span([2*W.1],ZZ))
112
+
sage: phi(span([2*W.1],ZZ))
113
113
Free module of degree 3 and rank 1 over Integer Ring
114
114
Echelon basis matrix:
115
115
[ 6 0 8/3]
@@ -127,8 +127,8 @@ def _repr_(self):
127
127
128
128
EXAMPLES::
129
129
130
-
sage: V = ZZ^3; W = span([[1,2,3],[-1,2,8]], ZZ)
131
-
sage: phi = V.hom(matrix(ZZ,3,[1..9]))
130
+
sage: V = ZZ^3; W = span([[1,2,3],[-1,2,8]], ZZ)
131
+
sage: phi = V.hom(matrix(ZZ, 3, [1..9]))
132
132
sage: phi._repr_()
133
133
'Free module morphism defined by the matrix\n[1 2 3]\n[4 5 6]\n[7 8 9]\nDomain: Ambient free module of rank 3 over the principal ideal domain Integer Ring\nCodomain: Ambient free module of rank 3 over the principal ideal domain Integer Ring'
134
134
@@ -242,8 +242,8 @@ def inverse_image(self, V):
242
242
243
243
We test computing inverse images over a field::
244
244
245
-
sage: V = QQ^3; W = span([[1,2,3],[-1,2,5/3]], QQ)
246
-
sage: phi = V.hom(matrix(QQ,3,[1..9]))
245
+
sage: V = QQ^3; W = span([[1,2,3],[-1,2,5/3]], QQ)
246
+
sage: phi = V.hom(matrix(QQ, 3, [1..9]))
247
247
sage: phi.rank()
248
248
2
249
249
sage: I = phi.inverse_image(W); I
@@ -297,7 +297,7 @@ def inverse_image(self, V):
297
297
298
298
We test that :issue:`24590` is resolved::
299
299
300
-
sage: A = FreeQuadraticModule(ZZ,1,matrix([2]))
300
+
sage: A = FreeQuadraticModule(ZZ, 1, matrix([2]))
301
301
sage: f = A.Hom(A).an_element()
302
302
sage: f.inverse_image(A)
303
303
Free module of degree 1 and rank 1 over Integer Ring
0 commit comments