Skip to content

Conversation

kellerlv
Copy link
Contributor

A package for computing simplicial modules and the Dold-Kan correspondence, by Michael DeBellevue and Keller VandeBogert

Copy link
Member

@d-torrance d-torrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Currently, test 5 is failing with the following error:

i13 : 	    assert isSimplicial C2
stdio:15:31:(3): error: no method found for applying isSimplicial to:
     argument   :   1      1      1      1      1 . (of class SimplicialModule)
                   S  <-- S  <-- S  <-- S  <-- S  .
                                                  .
                   0      1      2      3      4  .

(forgot to update old function name)
@d-torrance
Copy link
Member

The tests are failing on one of the builds due to running out of memory:

-- capturing check(47, "SimplicialModules") Insufficient memory for the allocation

Is there any way of making this example smaller? There are a few others that take a while:

-- capturing check(9, "SimplicialModules")   -- 6.0101s elapsed
...
-- capturing check(26, "SimplicialModules")  -- 69.118s elapsed
-- capturing check(27, "SimplicialModules")  -- 22.6293s elapsed

@kellerlv
Copy link
Contributor Author

The tests are failing on one of the builds due to running out of memory:

-- capturing check(47, "SimplicialModules") Insufficient memory for the allocation

Is there any way of making this example smaller? There are a few others that take a while:

-- capturing check(9, "SimplicialModules")   -- 6.0101s elapsed
...
-- capturing check(26, "SimplicialModules")  -- 69.118s elapsed
-- capturing check(27, "SimplicialModules")  -- 22.6293s elapsed

Yes -- I should have pruned this one down. I had to fix a similar example in the documentation that was causing memory issues so I should have done a similar tweak here.

Should now run without taking too much memory
@kellerlv kellerlv requested a review from d-torrance August 15, 2025 12:53
Copy link
Member

@d-torrance d-torrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few additional comments on the code. Also, some of the tests are still pretty lengthy:

 -- capturing check(26, "SimplicialModules") -- 35.9748s elapsed
 -- capturing check(27, "SimplicialModules") -- 18.2174s elapsed
...
-- capturing check(47, "SimplicialModules") -- 7.68881s elapsed
...
 -- capturing check(49, "SimplicialModules") -- 8.55586s elapsed
 -- capturing check(50, "SimplicialModules") -- 20.7422s elapsed

Headline => "methods for working in the category of simplicial modules",
Keywords => {"Homological Algebra", "Commutative Algebra"},
PackageExports => {"Complexes", "SchurFunctors"},
PackageImports => {"Complexes"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having Complexes in both PackageImports and PackageExports is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the preferred threshold for test lengths? These tests took about half as long as those times on my computer, but I acknowledge 35 seconds is quite long. One issue with this is that simplicial objects are generally very big and computationally cumbersome, so it's hard to build nontrivial examples that also run quickly. I kind of knew the example sizes would be an issue here but wasn't sure what was considered acceptable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the main bottleneck? Have you profiled the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I haven't profiled it mostly because I don't know how. For all of the slow tests it generally stems not from this package's constructors themselves, but the general slowness of applying Schur functors/exterior powers to large matrices (which are functions from other packages).

@@ -0,0 +1,311 @@
needsPackage "SchurFunctors"
needsPackage "Complexes"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These calls to needsPackage are unnecessary since the packages are in PackageExports

schurMap(List,SimplicialModule) := SimplicialModule => opts -> (lambda,S) -> (tdeg := topDegree S;
--C := S.complex;
L := hashTable for i to tdeg list i => schurModule(lambda,combineSFactors(S,i));
H1 := hashTable for i in keys (S.dd.map) list i => schur(lambda,((S.dd)_i));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using applyValues here would be a bit cleaner here since we wouldn't need to create an intermediate list

--C := S.complex;
L := hashTable for i to tdeg list i => schurModule(lambda,combineSFactors(S,i));
H1 := hashTable for i in keys (S.dd.map) list i => schur(lambda,((S.dd)_i));
if opts.Degeneracy==true then H2 := hashTable for i in keys (S.ss.map) list i => schur(lambda,((S.ss)_i));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing to true here is unnecessary since opts.Degeneracy is already a boolean

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Although since it's an option, === true would make sure it's not null also.

schurMap(List,SimplicialModuleMap) := SimplicialModuleMap => opts -> (lambda,phi) -> (
S1 := source phi;
S2 := target phi;
if instance((keys phi.map)#0,Sequence) then error "Expected SimplicialModuleMap to have singly graded indices";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually error message begin with a lowercase letter

map(schurMap(lambda,S2),schurMap(lambda,S1),new HashTable from for i to max(topDegree S1,topDegree S2) list i => schur(lambda,phi_i),Degree => degree phi)
)

schurMap(List,Complex) := Complex => opts -> (lambda,C) -> (S := if not(opts.TopDegree === null) then simplicialModule(C,opts.TopDegree)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use =!= here to negate ===

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants