Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Algorithm for Characteristic Classes #29581

Closed
mjungmath opened this issue Apr 25, 2020 · 179 comments
Closed

New Algorithm for Characteristic Classes #29581

mjungmath opened this issue Apr 25, 2020 · 179 comments

Comments

@mjungmath
Copy link

The current algorithm for characteristic forms is comparably slow. The worst case scenario showed computations times about 1h in dimension four.

With this ticket, we want to replace the current algorithm and implement characteristic cohomology classes as sub-ring of the de Rham cohomology ring (cf. #31691).

The idea is that characteristic (cohomology) classes are generated by Chern/Pontryagin/Euler classes. The generators can be computed by an Faddeev-LeVerrier-like algorithm (cf. #30681).

Depends on #32270
Depends on #32272
Depends on #32396

CC: @slel @egourgoulhon @tscrim @mkoeppe @tobiasdiez

Component: manifolds

Keywords: characteristic_classes

Author: Michael Jung

Branch/Commit: ac5cbbf

Reviewer: Travis Scrimshaw, Eric Gourgoulhon

Issue created by migration from https://trac.sagemath.org/ticket/29581

@mjungmath mjungmath added this to the sage-9.1 milestone Apr 25, 2020
@mjungmath
Copy link
Author

Branch: u/gh-mjungmath/new_algorithm

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 25, 2020

New commits:

3b36f0dTrac #29570: alternating_form returns correct element
85e7970Trac #29570: Typo fixed, doctest added, returned element preferably non-zero
1a803ebTrac #29581: New Algorithm for Char Classes

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 25, 2020

Commit: 1a803eb

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 Apr 25, 2020
@slel
Copy link
Member

slel commented Apr 26, 2020

comment:4

Please add a short description in the "Description" field of the ticket,
and the author's full name in the "Authors" field of the ticket. Don't forget
to set to needs_review when this is ready for review.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 28, 2020

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

730046cMerge branch 'develop' into t/29570/diff_form_bug
130ae3fTrac #29570: NotImplementedError for non-generic ring elements
bba21e1Trac #29570: Strange typo fixed...
ba3b4b9Trac #29570: correct parent, vectorfield_module changes reverted
841e1bfMerge branch 't/29570/diff_form_bug' into t/29581/new_algorithm
cb442ebTrac #29570: new algorithm added and code cleaned

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 28, 2020

Changed commit from 1a803eb to cb442eb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 28, 2020

Changed commit from cb442eb to 15c7341

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 28, 2020

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

15c7341Trac #29581: new algorithm added and code cleaned

@mjungmath
Copy link
Author

Author: Michael Jung

@mjungmath
Copy link
Author

Changed keywords from none to characteristic_classes

@mjungmath

This comment has been minimized.

@fchapoton
Copy link
Contributor

comment:8

Correct syntax for crosslinks is

.. SEEALSO::

@fchapoton
Copy link
Contributor

comment:9
  • do not use this:
if distinct_real == False

but

if not distinct_real

(at least in two places)

  • The following change is wrong:
-        - ``cmatrix`` -- curvature matrix
-
+            - ``cmatrix`` -- curvature matrix
         OUTPUT:
 
-        - ``I/(2*pi)*cmatrix``
+            - ``I/(2*pi)*cmatrix``

as one should not indent inside INPUT or OUTPUT blocks (because they end with only one colon). And moreover, one does want empty lines to separate these things.

This is also incorrect:

-            self._dual_exterior_powers[p] = ExtPowerDualFreeModule(self, p)
+                self._dual_exterior_powers[p] = ExtPowerDualFreeModule(self, p)

Why did you change the indentation ? it was ok.

@mjungmath
Copy link
Author

comment:10

I am sorry. At this stage, this is just a draft. The indentations are typos coming from using alt+tab (at least I guess so). I will fix this soon.

@mjungmath
Copy link
Author

comment:11

Thanks for your advice. :)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 4, 2020

Changed commit from 15c7341 to d372293

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 4, 2020

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

d372293Trac #29581: Strange typos reverted

@mjungmath
Copy link
Author

comment:15

An example for the application of the new algorithm would be really nice. For instance a Todd class or A-Hat class. But I have no idea for a suitable one. If anyone does, or at least knows someone who does, I would really appreciate it. Thanks! :)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 8, 2020

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

c975bd2Merge branch 'develop' into t/29581/new_algorithm
19815c4Trac #29581: Readability of one line

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 8, 2020

Changed commit from d372293 to 19815c4

@egourgoulhon
Copy link
Member

comment:112

#18036 is probably relevant here.

@tscrim
Copy link
Collaborator

tscrim commented Sep 29, 2021

comment:113

I think you want to follow the change from #32386 since you are wanting to do symbolic ring computations. Otherwise you end up with

sage: I.parent()
Number Field in I with defining polynomial x^2 + 1 with I = 1*I

@egourgoulhon
Copy link
Member

comment:114

Replying to @tscrim:

I think you want to follow the change from #32386 since you are wanting to do symbolic ring computations. Otherwise you end up with

sage: I.parent()
Number Field in I with defining polynomial x^2 + 1 with I = 1*I

In src/sage/symbolic/all.py there is a deprecation warning against from sage.symbolic.expression import I:

lazy_import("sage.symbolic.expression", "I", deprecation=(18036,
        "import I from sage.symbolic.constants for the imaginary unit viewed as an element of SR, or from sage.rings.imaginary_unit for the element of ZZ[i]"))

However, this warning does not seem effective...

@egourgoulhon
Copy link
Member

comment:115

In a fresh Sage session, we have (since #18036 I guess)

sage: I.parent()
Number Field in I with defining polynomial x^2 + 1 with I = 1*I
sage: from sage.symbolic.constants import I as I_symb
sage: I_symb.parent()
Symbolic Ring
sage: SR(I) is I_symb
False

I would have expected True for the last output (i.e. to have I unique as a symbolic expression).

@tscrim
Copy link
Collaborator

tscrim commented Sep 29, 2021

comment:116

It's not so unnatural to have copies being made. It would also be a lot of work for SR to check that some potentially very complicated expression is equal to I.

Okay, then follow the deprecation and import from sage.symbolic.constants. The main thing is to not use the one from from sage.rings.imaginary_unit import I.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 29, 2021

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

44f8cfaTrac #29581: import I from symbolic.constants

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 29, 2021

Changed commit from 4e2e8b8 to 44f8cfa

@mjungmath
Copy link
Author

comment:118

Okay, there we go. Thank you for this feedback!

@mjungmath
Copy link
Author

Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Eric Gourgoulhon

@tscrim
Copy link
Collaborator

tscrim commented Sep 29, 2021

comment:120

Green bot. LGTM.

@vbraun
Copy link
Member

vbraun commented Oct 3, 2021

comment:121
[docpdf] ! Package inputenc Error: Unicode character ϑ (U+03D1)
[docpdf] (inputenc)                not set up for use with LaTeX.
[docpdf] 
[docpdf] See the inputenc package documentation for explanation.
[docpdf] Type  H <return>  for immediate help.
[docpdf]  ...                                              
[docpdf]                                                   
[docpdf] l.73283 ...1}{\PYGZsh{} use spherical coordinates}
[docpdf]                                                   
[docpdf] ? 
[docpdf] ! Emergency stop.

@egourgoulhon
Copy link
Member

comment:122

Indeed, any new Unicode character has to be declared in

src/sage/docs/conf.py

for the pdf doc to be generated successfully.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 3, 2021

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

ac5cbbfTrac #29581: remove unicode character

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 3, 2021

Changed commit from 44f8cfa to ac5cbbf

@mjungmath
Copy link
Author

comment:124

That should solve it. Hopefully.

@tscrim
Copy link
Collaborator

tscrim commented Oct 3, 2021

comment:125

That is one way to solve it.

@vbraun
Copy link
Member

vbraun commented Oct 10, 2021

Changed branch from u/gh-mjungmath/new_algorithm to ac5cbbf

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

No branches or pull requests

7 participants