#28579 closed enhancement (fixed)

Wedge Product with Scalar Fields

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

Description (last modified by gh-DeRhamSource)

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 12 months ago by gh-DeRhamSource

  • Branch set to u/gh-DeRhamSource/wedge_product_with_scalar_fields

comment:2 Changed 12 months ago by gh-DeRhamSource

  • Authors set to Michael Jung
  • Cc tscrim egourgoulhon added
  • Commit set to 62dabd4520bc2349ef0b8336b461e1cbcce20390
  • Component changed from PLEASE CHANGE to geometry
  • Description modified (diff)
  • Keywords manifolds scalar fields wedge product added
  • Reviewers set to Eric Gourgoulon, Travis Scrimshaw
  • Status changed from new to needs_review
  • Type changed from PLEASE CHANGE to enhancement

New commits:

62dabd4Wedge product compatible with scalar fields

comment:3 Changed 12 months ago by gh-DeRhamSource

  • Description modified (diff)

comment:4 Changed 12 months ago by gh-DeRhamSource

  • Dependencies set to #28579

comment:5 Changed 12 months ago by gh-DeRhamSource

  • Dependencies #28579 deleted

comment:6 Changed 12 months ago by egourgoulhon

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 follow-up: Changed 12 months ago by 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?

Last edited 12 months ago by gh-DeRhamSource (previous) (diff)

comment:8 Changed 12 months ago by git

  • Commit changed from 62dabd4520bc2349ef0b8336b461e1cbcce20390 to 16d849e038486dbb6447ed72ef1b2789fd9513e4

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

16d849eTypos fixed

comment:9 in reply to: ↑ 7 Changed 12 months ago by egourgoulhon

  • Reviewers changed from Eric Gourgoulon, Travis Scrimshaw to Eric Gourgoulhon
  • Status changed from needs_review to positive_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 11 months ago by vbraun

  • Branch changed from u/gh-DeRhamSource/wedge_product_with_scalar_fields to 16d849e038486dbb6447ed72ef1b2789fd9513e4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.