Opened 3 years ago

Last modified 3 years ago

#27584 closed enhancement

Characteristic Classes - MixedAlgebra — at Version 15

Reported by: gh-DeRhamSource Owned by:
Priority: major Milestone: sage-8.8
Component: geometry Keywords: characteristic classes, manifolds
Cc: egourgoulhon, tscrim Merged in:
Authors: Michael Jung Reviewers:
Report Upstream: N/A Work issues:
Branch: u/gh-DeRhamSource/characteristic_classes___mixedalgebra (Commits, GitHub, GitLab) Commit: 3ca14f2de40c60ec79036c03931dc5b30729cee6
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-DeRhamSource)

This project is my master thesis. I want to implement a computation of characteristic classes of vector bundles out of their curvature matrices. The algorithm is based on this short script.

In this first step, the graded algebra of "mixed" differential forms of a manifold will be introduced so one can use the matrix framework of sage in the following steps.

A demo notebook is provided at https://github.com/DeRhamSource/MixedFormNotebook

Change History (15)

comment:1 Changed 3 years ago by gh-DeRhamSource

  • Authors set to Michael Jung
  • Cc egourgoulhon added
  • Component changed from PLEASE CHANGE to geometry
  • Description modified (diff)
  • Keywords characteristic classes manifolds added
  • Type changed from PLEASE CHANGE to enhancement

comment:2 Changed 3 years ago by gh-DeRhamSource

  • Cc tscrim added
  • Description modified (diff)
  • Summary changed from Characteristic Classes to Characteristic Classes - MixedAlgebra

comment:3 Changed 3 years ago by gh-DeRhamSource

  • Branch set to u/DeRhamSource/char_class_algebra

comment:4 Changed 3 years ago by gh-DeRhamSource

  • Branch changed from u/DeRhamSource/char_class_algebra to u/gh-DeRhamSource/char_class_algebra

comment:5 Changed 3 years ago by gh-DeRhamSource

  • Branch u/gh-DeRhamSource/char_class_algebra deleted

comment:6 Changed 3 years ago by gh-DeRhamSource

  • Branch set to u/gh-DeRhamSource/characteristic_classes___mixedalgebra

comment:7 Changed 3 years ago by git

  • Commit set to 49f21e50d792f4000c0b0b6cf64c93fd5eaf2da2

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

49f21e5Initial version (without doctests)

comment:8 Changed 3 years ago by egourgoulhon

Here is the answer to the question raised in https://groups.google.com/d/msg/sage-devel/hwsQWuLN0nc/1_8LjLL4AgAJ, namely when a is a differential form (from previously existing DiffForm class) and A is a mixed form (as introduced in this ticket), why do we get

sage: a.__mul__(A)
Mixed differential form A/\a on the 2-dimensional differentiable manifold M

I think this results from a clash between (i) the operator __mul__ being used to denote the wedge product for mixed differential forms and (ii) the operator __mul__ being used to denote tensor product for differential forms. Indeed a.__mul__(A) calls the method __mul__ implemented in line 2169 of src/sage/manifolds/differentiable/tensorfield.py, which is devoted to the tensor product (the differential form a being considered as a tensor field of type (0,p), where p=degree(a)). As you can see in line 2269, if A does not belong to the class TensorField, one assumes that A is a scalar field (the only possible case until this ticket) and the code return A*a, i.e. A.wedge(a).

A possible solution could be to change the lines 2269-2271 of tensorfield.py to

if isinstance(other, MixedForm):
    return other.parent()(self)._mul_(other)
elif not isinstance(other, TensorField):
    # Multiplication by a scalar field or a number
    return other * self

A better way would be to redefine __mul__ in DiffForm, falling back to the tensor field version if other is not a mixed form.

comment:9 Changed 3 years ago by git

  • Commit changed from 49f21e50d792f4000c0b0b6cf64c93fd5eaf2da2 to 4ba165d85dff93b5cbad4fb7af3b403e2e968077

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

4ba165dSage Compatibility

comment:10 Changed 3 years ago by egourgoulhon

Your code looks nice, as well as the demo notebook!

Just a remark at this stage: you should not put any Jupyter notebook in the ticket's git branch. Indeed, when the ticket gets a positive review, the branch is merged into Sage's main branch, which must contain only source code (it is already very large just with sources). It is of course a good idea to share notebooks during the development process, but you should put them to a public repository (e.g. GitHub) and simply add a link to them in some comment on the ticket.

comment:11 Changed 3 years ago by tscrim

The other thing you could do is add the notebook file as an attachment (but note that you cannot delete it afterwards).

comment:12 follow-up: Changed 3 years ago by gh-DeRhamSource

Oh I'm sorry, I didn't realize that. How can I delete this file from the ticket?

In the next step, I will translate the notebook to english and add Doctests to the main files. Then, I guess, it's ready for review.

Last edited 3 years ago by gh-DeRhamSource (previous) (diff)

comment:13 in reply to: ↑ 12 Changed 3 years ago by egourgoulhon

Replying to gh-DeRhamSource:

Oh I'm sorry, I didn't realize that. How can I delete this file from the ticket?

Since the file is not very large, I guess it suffices to run

git rm scripts/MixedAlgebra.ipynb

before your next commit. Otherwise (i.e. for a large file), I would have recommended to delete the branch and to start a brand new one.

In the next step, I will translate the notebook to english and add Doctests to the main files. Then, I guess, it's ready for review.

OK very good!

comment:14 Changed 3 years ago by git

  • Commit changed from 4ba165d85dff93b5cbad4fb7af3b403e2e968077 to 3ca14f2de40c60ec79036c03931dc5b30729cee6

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

3ca14f2Notebook removed + Minor Changes

comment:15 Changed 3 years ago by gh-DeRhamSource

  • Description modified (diff)
Note: See TracTickets for help on using tickets.