Commit ff51547
Release Manager
sagemathgh-37132: Fix corners cases of free resolutions
<!-- ^^^^^
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 -->
as seen in
```sage
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: S = P2.coordinate_ring()
sage: I = S.ideal(0)
sage: C = I.graded_free_resolution(); C
S(0) <-- 0
sage: C[1]
Ambient free module of rank 0 over the integral domain Multivariate
Polynomial Ring in x, y, z over Rational Field
sage: C[0]
------------------------------------------------------------------------
---
IndexError Traceback (most recent call
last)
Cell In[5], line 1
----> 1 C[Integer(0)]
File ~/GitHub/sage/src/sage/homology/free_resolution.py:426, in
FiniteFreeResolution.__getitem__(self, i)
424 F = FreeModule(self._base_ring, 0)
425 elif i == self._length:
--> 426 F = FreeModule(self._base_ring, self._maps[i - 1].ncols())
427 else:
428 F = FreeModule(self._base_ring, self._maps[i].nrows())
IndexError: list index out of range
sage: C.differential(1)
------------------------------------------------------------------------
---
IndexError Traceback (most recent call
last)
Cell In[6], line 1
----> 1 C.differential(Integer(1))
File ~/GitHub/sage/src/sage/homology/free_resolution.py:489, in
FiniteFreeResolution.differential(self, i)
487 elif i == self._length + 1:
488 s = FreeModule(self._base_ring, 0)
--> 489 t = FreeModule(self._base_ring, self._maps[i - 2].ncols())
490 m = s.hom(0, t)
491 elif i > self._length + 1:
IndexError: list index out of range
```
<!-- Why is this change required? What problem does it solve? -->
<!-- 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.
- [ ] I have linked a relevant issue or discussion.
- [x] 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#37132
Reported by: Kwankyu Lee
Reviewer(s): Travis Scrimshaw
1 file changed
+54
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
245 | 253 | | |
246 | 254 | | |
247 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
248 | 259 | | |
249 | 260 | | |
250 | 261 | | |
| |||
422 | 433 | | |
423 | 434 | | |
424 | 435 | | |
| 436 | + | |
| 437 | + | |
425 | 438 | | |
426 | 439 | | |
427 | 440 | | |
| |||
444 | 457 | | |
445 | 458 | | |
446 | 459 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
452 | 466 | | |
453 | 467 | | |
454 | 468 | | |
| |||
476 | 490 | | |
477 | 491 | | |
478 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
479 | 518 | | |
480 | 519 | | |
481 | 520 | | |
| |||
484 | 523 | | |
485 | 524 | | |
486 | 525 | | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | 526 | | |
492 | 527 | | |
493 | 528 | | |
494 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
495 | 537 | | |
496 | 538 | | |
497 | 539 | | |
| |||
0 commit comments