Skip to content

diff and pdiff method of class Mv throws exception when differentiate by a coordinate symbol #513

@mammalwong

Description

@mammalwong

x is a coordinate symbol (a plain sympy Symbol object) and ex is a Mv instance of a Ga basis symbol. I tried to invoke (x*ex).diff(x) and the method throws exception. From the exception stack frame below, it looks like Mv.diff passed self.obj to Ga.pDiff and pDiff try to resolve .obj again from obj.


AttributeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 (x*ex).diff(x)

1 frames
/usr/local/lib/python3.10/dist-packages/galgebra/mv.py in diff(self, coord)
1070 obj += tmp1 * tmp2
1071 else:
-> 1072 obj = self.Ga.pDiff(self.obj, coord)
1073 return Mv(obj, ga=self.Ga)
1074

/usr/local/lib/python3.10/dist-packages/galgebra/ga.py in pDiff(self, A, coord)
2050 # variable, but including case of non-constant basis vectors
2051
-> 2052 dA = self.mv(expand(diff(A.obj, coord)))
2053
2054 if self.connect_flg and self.dslot == -1 and not A.is_scalar(): # Basis blades are function of coordinates

AttributeError: 'Mul' object has no attribute 'obj'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions