Ask Your Question
5

How to create/use matrices valued in differential forms?

asked 2019-05-25 17:16:00 +0100

sum8tion gravatar image

updated 2019-08-29 18:36:03 +0100

FrédéricC gravatar image

First, for context, I am working with holomorphic Hermitian vector bundles, and I need to compute the connection and curvature matrices, and compute some representatives for Chern classes and the Chern form.

Ultimately I want to have a matrix which is valued in differential forms, and when I multiply matrices, I want the component-wise multiplication to be the wedge product of forms.

When I naively try to build a matrix of forms 'by hand', or when I pre-define my matrix space to be valued in the module of differential forms, I get an error telling me that the space of differential forms is a not a ring.

For example,

import sys
import mpmath
sys.modules['sympy.mpmath'] = mpmath
M = Manifold(2, 'M', field='complex')
U = M.open_subset('U')
c_xy.<x,y> = U.chart()
e_xy = c_xy.frame()
a = M.diff_form(2, name='a')
a.parent()
eU = c_xy.frame()
a.degree()
a[eU,0,1] = x*y^2 + 2*x
a.display(eU)
A = matrix([[a, a], [a, a]])

prints out

Module Omega^2(M) of 2-forms on the 2-dimensional complex manifold M
2
a = (x*y^2 + 2*x) dx/\dy

and raises a type error:

TypeError: base_ring (=Module Omega^2(M) of 2-forms on the 2-dimensional complex manifold M) must be a ring
edit retag flag offensive close merge delete

Comments

Hi

maybe you can give your code, so someone might be more easily able to help you.

your post is in duplicate, maybe you can delete one of them?(but in fact I do not know if it is possible on the sagemath site !

ortollj gravatar imageortollj ( 2019-05-25 19:14:06 +0100 )edit

just for information: there is a button 101 which allows you to display code more readable.

ortollj gravatar imageortollj ( 2019-05-26 08:06:33 +0100 )edit

It seems that someone fixed it for me. How do I do it myself?

sum8tion gravatar imagesum8tion ( 2019-05-30 16:25:09 +0100 )edit

To display blocks of code or error messages, skip a line above and below, and do one of the following (all give the same result):

  • indent all code lines with 4 spaces
  • select all code lines and click the "code" button (the icon with '101 010')
  • select all code lines and hit ctrl-K

For instance, typing

If we define `f` by

    def f(x, y, z):
        return x * y * z

then `f(2, 3, 5)` returns `30` but `f(2*3*5)` gives:

    TypeError: f() takes exactly 3 arguments (1 given)

produces:

If we define f by

def f(x, y, z):
    return x * y * z

then f(2, 3, 5) returns 30 but f(2*3*5) gives:

TypeError: f() takes exactly 3 arguments (1 given)
slelievre gravatar imageslelievre ( 2019-06-01 15:40:56 +0100 )edit

1 Answer

Sort by » oldest newest most voted
7

answered 2019-05-27 14:12:16 +0100

eric_g gravatar image

updated 2019-05-27 14:23:43 +0100

At the moment (SageMath 8.7), differential forms of degree $p$ on a manifold $M$ are considered to belong to (i.e. their parent is) the set $\Omega^p(M)$ of all differential forms of degree $p$, which is a $C^\infty(M)$-module and not a ring. Hence one cannot construct matrices from them. However, since SageMath 8.8.beta3 (see the ticket #27584 for details), it is possible to consider the graded algebra

$$\Omega^*(M) = \bigoplus^n_{p=0} \Omega^p(M), $$

where $n = \mathrm{dim}\ M$. The set $ \Omega^* (M) $ is a ring, the multiplication of which is the wedge product. It is therefore possible to form matrices from its elements. The latter are called mixed differential forms, so that, continuing from your example, one may write

sage: aa = M.mixed_form(comp=[0, 0, a], name='aa')
sage: aa.parent()
Graded algebra Omega^*(M) of mixed differential forms 
 on the 2-dimensional complex manifold M
sage: aa.display(eU)
aa = [0] + [0] + [(x*y^2 + 2*x) dx/\dy]

It is now possible to form a matrix and use the standard matrix operations:

sage: A = matrix([[aa, aa], [aa, aa]])
sage: A
[Mixed differential form aa on the 2-dimensional complex manifold M 
 Mixed differential form aa on the 2-dimensional complex manifold M]
[Mixed differential form aa on the 2-dimensional complex manifold M 
 Mixed differential form aa on the 2-dimensional complex manifold M]
sage: A.base_ring()
Graded algebra Omega^*(M) of mixed differential forms 
 on the 2-dimensional complex manifold M
sage: A[0,1]
Mixed differential form aa on the 2-dimensional complex manifold M
sage: det(A)
Mixed differential form aa/\aa-aa/\aa on the 2-dimensional complex manifold M
sage: det(A).display(eU)
aa/\aa-aa/\aa = [0] + [0] + [0]

The above feature will be available in the next stable release of SageMath (8.8), which should appear in a few weeks. Meanwhile you can install the latest development version (8.8.beta6 as of today) to use it, see e.g. the section "1. Starting from the latest sources" in this page.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-05-25 17:16:00 +0100

Seen: 986 times

Last updated: May 27 '19