# Turn mixed form algebra into de Rham complex

Reported by: Owned by: Michael Jung major sage-9.4 manifolds chain_complex Eric Gourgoulhon, Travis Scrimshaw, Matthias Köppe, John Palmieri Michael Jung Travis Scrimshaw N/A 566176a 566176a74a480456b7836c13a173e217b721b70a

We turn the algebra of mixed differential forms into a de Rham complex and add it to the category of ChainComplexes, see #31669.

Furthermore, we add de Rham cohomology to SageManifolds? with limited functionality. For now, the implementation will only consist of abstract elements that are given by representatives of mixed forms, i.e. we take closed mixed forms, put a bracket around it and do all computations in the algebra of mixed forms.

### comment:1 Changed 20 months ago by Michael Jung

Summary: Make mixed forms to de Rham complex → Turn mixed forms into de Rham complex

### comment:2 Changed 20 months ago by Michael Jung

Description: modified (diff)

### comment:3 Changed 20 months ago by Michael Jung

Branch: → public/31691_de_rham_complex

### comment:4 Changed 20 months ago by git

Branch pushed to git repo; I updated commit sha1. New commits:

 ​a050f71 Trac #31691: add category and differential ​eeeadf5 Trac #31691: more concrete examples

### comment:5 follow-up:  8 Changed 20 months ago by Michael Jung

Here is a first draft. Unfortunately I get an error with the current test:

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: C = M.de_rham_complex()
sage: d0 = C.differential(0); d0
Exception raised:
...
ValueError: Algebra of differentiable scalar fields on the 2-dimensional differentiable manifold M is not in Category of modules over Algebra of differentiable scalar fields on the 2-dimensional differentiable manifold M


This is somewhat peculiar. Each algebra should automatically be a module over itself... Should I simply add the category to the scalar field algebra or does that need a broader fix?

### comment:6 Changed 20 months ago by git

Branch pushed to git repo; I updated commit sha1. New commits:

 ​252cb8f Trac #31691: invoke derivative instead of differential

### comment:8 in reply to:  5 Changed 20 months ago by Michael Jung

Here is a first draft. Unfortunately I get an error with the current test:

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: C = M.de_rham_complex()
sage: d0 = C.differential(0); d0
Exception raised:
...
ValueError: Algebra of differentiable scalar fields on the 2-dimensional differentiable manifold M is not in Category of modules over Algebra of differentiable scalar fields on the 2-dimensional differentiable manifold M


This is somewhat peculiar. Each algebra should automatically be a module over itself... Should I simply add the category to the scalar field algebra or does that need a broader fix?

See #31713.

### comment:9 Changed 20 months ago by git

Branch pushed to git repo; I updated commit sha1. New commits:

 ​ab3d601 Trac #31691: de Rham cohomology ring

### comment:10 Changed 20 months ago by Michael Jung

This draft should already reflect what I have in mind. Comments are welcome.

### comment:11 Changed 20 months ago by Michael Jung

I must apologize. I was extremely sloppy here: differentials are no morphisms in the category of modules over scalar fields, they are morphisms in the category of modules over K!

I'll fix this.

### comment:12 Changed 19 months ago by Michael Jung

That was expected. Same problem, but now with differential form modules not considered as vector spaces.

There should be some way to define these morphisms, no?

Last edited 19 months ago by Michael Jung (previous) (diff)

### comment:13 Changed 19 months ago by git

Commit: ab3d601704d47453641f4e1a225a596784507a4b → 4746ddb61e6d2da8e7d7b5e76d39772b286f56a2

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

 ​4746ddb Trac #31691: turn mixed form algebra into de rham complex

### comment:14 Changed 19 months ago by Michael Jung

Status: new → needs_review

### comment:15 Changed 19 months ago by Michael Jung

This is just a first step.

My idea (not for this ticket): Optimally, we want to cover our manifold by contractible chart domains. Therefore it would be helpful if we could determine whether an open subset is contractible or not. Perhaps this needs some input from the user. But then, we can probably check for exactness (I still have to think about it) and, other than that, construct Cech cohomology.

Last edited 19 months ago by Michael Jung (previous) (diff)

### comment:16 Changed 19 months ago by Michael Jung

P.S. I said "simply connected" in the first place, but of course I meant contractible.

### comment:17 Changed 19 months ago by Michael Jung

Authors: → Michael Jung

### comment:18 Changed 19 months ago by Michael Jung

Summary: Turn mixed forms into de Rham complex → Turn mixed form algebra into de Rham complex

### comment:19 Changed 19 months ago by Michael Jung

Description: modified (diff)

### comment:20 Changed 19 months ago by Michael Jung

Description: modified (diff)

### comment:21 Changed 19 months ago by git

Commit: 4746ddb61e6d2da8e7d7b5e76d39772b286f56a2 → fb8331abc00f6886b511819bff1e4116bb2e6d30

Branch pushed to git repo; I updated commit sha1. New commits:

 ​fb8331a Trac #31691: fix doctest in manifold.py

Patchbot green.

### comment:24 follow-up:  25 Changed 19 months ago by Travis Scrimshaw

I think it would be best to split off the cohomology ring into a separate file.

Do you want to give a special (latex) name to zero and one?

For the class-level docstring of DeRahmComologyRing:

-Define the de Rham cohomology ring of a de Rham complex.
The de Rham cohomology ring of a de Rham complex.


I don't think you should assume that the parents are the same for cup (unlike what you can do for _mul_).

In your cohomology() method, you have both \left. and \right.. I don't understand the point of this.

The input block to differential() is over-indented. Also, remove the full-stop/period.

### comment:25 in reply to:  24 ; follow-up:  26 Changed 19 months ago by Michael Jung

I think it would be best to split off the cohomology ring into a separate file.

Sounds reasonable.

Do you want to give a special (latex) name to zero and one?

I don't think so. That would make more sense if we can distinguish cohomology classes properly.

For the class-level docstring of DeRahmComologyRing:

-Define the de Rham cohomology ring of a de Rham complex.
The de Rham cohomology ring of a de Rham complex.


Thanks, done.

I don't think you should assume that the parents are the same for cup (unlike what you can do for _mul_).

What do you mean?

In your cohomology() method, you have both \left. and \right.. I don't understand the point of this.

The point is that \middle/ has the appropriate size.

The input block to differential() is over-indented. Also, remove the full-stop/period.

Thanks, done.

### comment:26 in reply to:  25 ; follow-up:  27 Changed 19 months ago by Travis Scrimshaw

I don't think you should assume that the parents are the same for cup (unlike what you can do for _mul_).

What do you mean?

If you take the cup with something the coerces in (perhaps 2?) but is not actually an element of the same parent, then it will either fail or could end up with an element that is not actually in the ring. However, for _mul_, this can never happen because the coercion framework would make sure both arguments belong to the same parent.

### comment:27 in reply to:  26 ; follow-up:  28 Changed 19 months ago by Michael Jung

I don't think you should assume that the parents are the same for cup (unlike what you can do for _mul_).

What do you mean?

If you take the cup with something the coerces in (perhaps 2?) but is not actually an element of the same parent, then it will either fail or could end up with an element that is not actually in the ring. However, for _mul_, this can never happen because the coercion framework would make sure both arguments belong to the same parent.

Currently, there is not even a natural coercion implemented. The only coercion that would be admissible is the one from closed differential forms (and everything that is contained in it) into cohomology, but we don't have that subspace implemented. Therefore, it wouldn't even work with _mul_.

### comment:28 in reply to:  27 ; follow-up:  29 Changed 19 months ago by Travis Scrimshaw

I don't think you should assume that the parents are the same for cup (unlike what you can do for _mul_).

What do you mean?

If you take the cup with something the coerces in (perhaps 2?) but is not actually an element of the same parent, then it will either fail or could end up with an element that is not actually in the ring. However, for _mul_, this can never happen because the coercion framework would make sure both arguments belong to the same parent.

Currently, there is not even a natural coercion implemented. The only coercion that would be admissible is the one from closed differential forms (and everything that is contained in it) into cohomology, but we don't have that subspace implemented. Therefore, it wouldn't even work with _mul_.

However, it will fail with a much more reasonable message and it will be all setup for when there is a coercion implemented. Most importantly, it will handle the natural coercion from the scalar field into the ring, but cup will not. You should have cup simply redirect to *. This will also make it easier if this ever gets subclassed too.

### comment:29 in reply to:  28 Changed 19 months ago by Michael Jung

However, it will fail with a much more reasonable message and it will be all setup for when there is a coercion implemented. Most importantly, it will handle the natural coercion from the scalar field into the ring, but cup will not. You should have cup simply redirect to *. This will also make it easier if this ever gets subclassed too.

It will get subclassed. My idea is that a characteristic class becomes a subclass of DeRhamCohomologyClass with a dedicated representative method.

### comment:30 Changed 19 months ago by Michael Jung

So your idea is good. I will redirect cup to the product.

### comment:31 Changed 19 months ago by git

Commit: fb8331abc00f6886b511819bff1e4116bb2e6d30 → 566176a74a480456b7836c13a173e217b721b70a

Branch pushed to git repo; I updated commit sha1. New commits:

 ​566176a Trac #31691: new file + improved doc + cup product delegates to *

### comment:32 Changed 19 months ago by Michael Jung

Commit pushed. Wait for patchbot.

### comment:33 Changed 19 months ago by Travis Scrimshaw

Reviewers: → Travis Scrimshaw

Green bot => positive review

Morally green?

### comment:35 Changed 19 months ago by Travis Scrimshaw

Status: needs_review → positive_review

### comment:36 Changed 19 months ago by Michael Jung

Thanks for the review!

### comment:37 Changed 18 months ago by Volker Braun

Branch: public/31691_de_rham_complex → 566176a74a480456b7836c13a173e217b721b70a → fixed positive_review → closed
Note: See TracTickets for help on using tickets.