# conjugate of scalar field

I'm new to SageMath.

I was wondering how to form the conjugate of a complex scalar function on a Lorentzian manifold. This is useful for calculating Newman Penrose spin coefficients. According to the SageMath documentation, one can apply standard math functions (eg abs()) but as far as I can see there is no conjugate, real or imaginary part capability for scalar fields. For example trying conjugate(f) leads to:

TypeError: cannot coerce arguments: no canonical
coercion from Algebra of differentiable scalar fields on
the 4-dimensional Lorentzian manifold M to Symbolic Ring


On the other hand using SageManifolds to differentiate abs(f(t)) where f(t) is a scalar function leads to:

dabs(f) = 1/2*(conjugate(d(f)/dt)*f(t) + conjugate(f(t))*d(f)/dt)/abs(f(t)) dt


I'm not sure if this is a misunderstanding on my part or a missing feature.

edit retag close merge delete

Thank you eric_g much appreciated.

( 2022-02-27 23:34:50 +0200 )edit

Sort by ยป oldest newest most voted

The conjugate operator is not implemented because scalar fields on a real manifold are supposed to be real-valued functions. You can however bypass this limitation and implement it yourself by declaring the following Python function:

def conj(f):
name, latex_name = f._function_name("conj", r"\,\mathrm{conj}")
cf = type(f)(f.parent(), name=name, latex_name=latex_name)
for chart, func in f._express.items():
cf._express[chart] = chart.function(func.expr().conjugate())
return cf


This is modeled from the abs function, see the Python code returned by f.__abs__??.

more

## Stats

Seen: 258 times

Last updated: Feb 25 '22