Opened 3 years ago

Closed 3 years ago

#28579 closed enhancement (fixed)

Wedge Product with Scalar Fields

Reported by: Michael Jung Owned by:
Priority: major Milestone: sage-9.0
Component: geometry Keywords: manifolds, scalar fields, wedge product
Cc: Travis Scrimshaw, Eric Gourgoulhon Merged in:
Authors: Michael Jung Reviewers: Eric Gourgoulhon
Report Upstream: N/A Work issues:
Branch: 16d849e (Commits, GitHub, GitLab) Commit: 16d849e038486dbb6447ed72ef1b2789fd9513e4
Dependencies: Stopgaps:

Status badges

Description (last modified by Michael Jung)

The wedge product of differential forms was not compatible with scalar fields:

sage: M = Manifold(2, 'M')
sage: c_cart.<x,y> = M.chart()
sage: a = M.diff_form(1, [x, y], name='a')
sage: f = M.scalar_field(x^2, name='f')
sage: a.wedge(f)
AttributeError                            Traceback (most recent call last)
<ipython-input-1-039619b3382c> in <module>()
      3 a = M.diff_form(Integer(1), [x, y], name='a')
      4 f = M.scalar_field(x**Integer(2), name='f')
----> 5 a.wedge(f)
...
AttributeError: 'DiffScalarFieldAlgebra_with_category.element_class' object has no attribute '_ambient_domain'

In this ticket, this gets fixed.

This ticket is part of the metaticket #28519.

Change History (10)

comment:1 Changed 3 years ago by Michael Jung

Branch: u/gh-DeRhamSource/wedge_product_with_scalar_fields

comment:2 Changed 3 years ago by Michael Jung

Authors: Michael Jung
Cc: Travis Scrimshaw Eric Gourgoulhon added
Commit: 62dabd4520bc2349ef0b8336b461e1cbcce20390
Component: PLEASE CHANGEgeometry
Description: modified (diff)
Keywords: manifolds scalar fields wedge product added
Reviewers: Eric Gourgoulon, Travis Scrimshaw
Status: newneeds_review
Type: PLEASE CHANGEenhancement

New commits:

62dabd4Wedge product compatible with scalar fields

comment:3 Changed 3 years ago by Michael Jung

Description: modified (diff)

comment:4 Changed 3 years ago by Michael Jung

Dependencies: #28579

comment:5 Changed 3 years ago by Michael Jung

Dependencies: #28579

comment:6 Changed 3 years ago by Eric Gourgoulhon

Thanks for fixing this.

A question: why have you made the method degree() of scalar fields return self._tensor_rank instead of 0?

comment:7 Changed 3 years ago by Michael Jung

Actually, I had no particular reason in mind. :D I guess, one reason is, to make clear the connection between the degree and the tensor rank. Moreover, this is more consistent to what is implemented in diff_form.py. In the end it felt more "round".

Do you want me to change it back?

Last edited 3 years ago by Michael Jung (previous) (diff)

comment:8 Changed 3 years ago by git

Commit: 62dabd4520bc2349ef0b8336b461e1cbcce2039016d849e038486dbb6447ed72ef1b2789fd9513e4

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

16d849eTypos fixed

comment:9 in reply to:  7 Changed 3 years ago by Eric Gourgoulhon

Reviewers: Eric Gourgoulon, Travis ScrimshawEric Gourgoulhon
Status: needs_reviewpositive_review

Replying to gh-DeRhamSource:

Actually, I had no particular reason in mind. :D I guess, one reason is, to make clear the connection between the degree and the tensor rank. Moreover, this is more consistent to what is implemented in diff_form.py. In the end it felt more "round".

Do you want me to change it back?

No I think it's OK. As you say, it's consistent with the degree() method of differential forms. Thanks.

A general comment: when you create a ticket, do not fill the "Reviewers" field; it will be filled by the reviewers themselves when they are actually making the review. If you want to suggest a reviewer for your ticket, simply add its username to the "Cc" field.

comment:10 Changed 3 years ago by Volker Braun

Branch: u/gh-DeRhamSource/wedge_product_with_scalar_fields16d849e038486dbb6447ed72ef1b2789fd9513e4
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.