Skip to content

Commit

Permalink
sagemathgh-35945: sage.categories: Update # needs
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
- Part of: sagemath#29705
- Cherry-picked from: sagemath#35095
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] 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
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#35945
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
  • Loading branch information
Release Manager committed Aug 23, 2023
2 parents b9e3c31 + f29be5a commit b6cd037
Show file tree
Hide file tree
Showing 144 changed files with 5,918 additions and 5,322 deletions.
67 changes: 36 additions & 31 deletions src/sage/categories/action.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -333,28 +333,30 @@ cdef class InverseAction(Action):
EXAMPLES::
sage: V = QQ^3 # optional - sage.modules
sage: v = V((1, 2, 3)) # optional - sage.modules
sage: V = QQ^3 # needs sage.modules
sage: v = V((1, 2, 3)) # needs sage.modules
sage: cm = get_coercion_model()
sage: a = cm.get_action(V, QQ, operator.mul) # optional - sage.modules
sage: a # optional - sage.modules
sage: # needs sage.modules
sage: a = cm.get_action(V, QQ, operator.mul)
sage: a
Right scalar multiplication by Rational Field
on Vector space of dimension 3 over Rational Field
sage: ~a # optional - sage.modules
sage: ~a
Right inverse action by Rational Field
on Vector space of dimension 3 over Rational Field
sage: (~a)(v, 1/3) # optional - sage.modules
sage: (~a)(v, 1/3)
(3, 6, 9)
sage: b = cm.get_action(QQ, V, operator.mul) # optional - sage.modules
sage: b # optional - sage.modules
sage: # needs sage.modules
sage: b = cm.get_action(QQ, V, operator.mul)
sage: b
Left scalar multiplication by Rational Field
on Vector space of dimension 3 over Rational Field
sage: ~b # optional - sage.modules
sage: ~b
Left inverse action by Rational Field
on Vector space of dimension 3 over Rational Field
sage: (~b)(1/3, v) # optional - sage.modules
sage: (~b)(1/3, v)
(3, 6, 9)
sage: c = cm.get_action(ZZ, list, operator.mul)
Expand Down Expand Up @@ -398,11 +400,12 @@ cdef class InverseAction(Action):
Check that this action can be pickled (:trac:`29031`)::
sage: V = QQ^3 # optional - sage.modules
sage: v = V((1, 2, 3)) # optional - sage.modules
sage: cm = get_coercion_model() # optional - sage.modules
sage: a = cm.get_action(V, QQ, operator.mul) # optional - sage.modules
sage: loads(dumps(~a)) is not None # optional - sage.modules
sage: # needs sage.modules
sage: V = QQ^3
sage: v = V((1, 2, 3))
sage: cm = get_coercion_model()
sage: a = cm.get_action(V, QQ, operator.mul)
sage: loads(dumps(~a)) is not None
True
"""
return (type(self), (self._action,))
Expand Down Expand Up @@ -432,16 +435,17 @@ cdef class PrecomposedAction(Action):
We demonstrate that an example discussed on :trac:`14711` did not become a
problem::
sage: E = ModularSymbols(11).2 # optional - sage.modular
sage: s = E.modular_symbol_rep() # optional - sage.modular
sage: del E,s # optional - sage.modular
sage: import gc # optional - sage.modular
sage: _ = gc.collect() # optional - sage.modular
sage: E = ModularSymbols(11).2 # optional - sage.modular
sage: v = E.manin_symbol_rep() # optional - sage.modular
sage: c,x = v[0] # optional - sage.modular
sage: y = x.modular_symbol_rep() # optional - sage.modular
sage: coercion_model.get_action(QQ, parent(y), op=operator.mul) # optional - sage.modular
sage: # needs sage.modular
sage: E = ModularSymbols(11).2
sage: s = E.modular_symbol_rep()
sage: del E,s
sage: import gc
sage: _ = gc.collect()
sage: E = ModularSymbols(11).2
sage: v = E.manin_symbol_rep()
sage: c,x = v[0]
sage: y = x.modular_symbol_rep()
sage: coercion_model.get_action(QQ, parent(y), op=operator.mul)
Left scalar multiplication by Rational Field
on Abelian Group of all Formal Finite Sums over Rational Field
with precomposition on right by Coercion map:
Expand Down Expand Up @@ -483,12 +487,13 @@ cdef class PrecomposedAction(Action):
Check that this action can be pickled (:trac:`29031`)::
sage: E = ModularSymbols(11).2 # optional - sage.modular
sage: v = E.manin_symbol_rep() # optional - sage.modular
sage: c,x = v[0] # optional - sage.modular
sage: y = x.modular_symbol_rep() # optional - sage.modular
sage: act = coercion_model.get_action(QQ, parent(y), op=operator.mul) # optional - sage.modular
sage: loads(dumps(act)) is not None # optional - sage.modular
sage: # needs sage.modular
sage: E = ModularSymbols(11).2
sage: v = E.manin_symbol_rep()
sage: c,x = v[0]
sage: y = x.modular_symbol_rep()
sage: act = coercion_model.get_action(QQ, parent(y), op=operator.mul)
sage: loads(dumps(act)) is not None
True
"""
return (type(self), (self._action, self.G_precomposition, self.S_precomposition))
Expand Down
Loading

0 comments on commit b6cd037

Please sign in to comment.