|
1 | 1 | """ |
2 | 2 | Geometric Algebra (inherits Metric) |
3 | 3 | """ |
4 | | - |
| 4 | +import warnings |
5 | 5 | import operator |
6 | 6 | import copy |
7 | 7 | from collections import OrderedDict |
@@ -268,20 +268,6 @@ class Ga(metric.Metric): |
268 | 268 | Derivatives of basis functions. Two dimensional list. First entry is differentiating coordinate index. |
269 | 269 | Second entry is basis vector index. Quantities are linear combinations of basis vector symbols. |
270 | 270 |
|
271 | | - .. attribute:: Pdop_identity |
272 | | -
|
273 | | - Partial differential operator identity (operates on multivector function to return function). |
274 | | -
|
275 | | - .. attribute:: Pdiffs |
276 | | -
|
277 | | - Dictionary of partial differential operators (operates on multivector functions) for each coordinate |
278 | | - :math:`\{x: \partial_{x}, ...\}` |
279 | | -
|
280 | | - .. attribute:: sPds |
281 | | -
|
282 | | - Dictionary of scalar partial differential operators (operates on scalar functions) for each coordinate |
283 | | - :math:`\{x: \partial_{x}, ...\}` |
284 | | -
|
285 | 271 | .. attribute:: grad |
286 | 272 |
|
287 | 273 | Geometric derivative operator from left. ``grad*F`` returns multivector |
@@ -420,12 +406,6 @@ def __init__(self, bases, **kwargs): |
420 | 406 | if self.coords is not None: |
421 | 407 | self.coord_vec = sum([coord * base for (coord, base) in zip(self.coords, self.basis)]) |
422 | 408 | self._build_reciprocal_basis(self.gsym) |
423 | | - self.Pdop_identity = mv.Pdop({},ga=self) # Identity Pdop = 1 |
424 | | - self.Pdiffs = {} |
425 | | - self.sPds = {} |
426 | | - for x in self.coords: # Partial derivative operator for each coordinate |
427 | | - self.Pdiffs[x] = mv.Pdop({x:1}, ga=self) |
428 | | - self.sPds[x] = mv.Sdop([(S(1), self.Pdiffs[x])], ga=self) |
429 | 409 | self._build_grads() |
430 | 410 | else: |
431 | 411 | self.r_basis_mv = None |
@@ -516,6 +496,30 @@ def mv_x(self): |
516 | 496 | def X(self): |
517 | 497 | return self.mv(sum([coord*base for (coord, base) in zip(self.coords, self.basis)])) |
518 | 498 |
|
| 499 | + @property |
| 500 | + def Pdiffs(self): |
| 501 | + # galgebra 0.4.5 |
| 502 | + warnings.warn( |
| 503 | + "ga.Pdiffs[x] is deprecated, use `ga.pdop(x)` instead", |
| 504 | + DeprecationWarning, stacklevel=2) |
| 505 | + return {x: self.pdop(x) for x in self.coords} |
| 506 | + |
| 507 | + @property |
| 508 | + def sPds(self): |
| 509 | + # galgebra 0.4.5 |
| 510 | + warnings.warn( |
| 511 | + "ga.sPds[x] is deprecated, use `ga.sdop(x)` instead", |
| 512 | + DeprecationWarning, stacklevel=2) |
| 513 | + return {x: self.sdop(x) for x in self.coords} |
| 514 | + |
| 515 | + @property |
| 516 | + def Pdop_identity(self): |
| 517 | + # galgebra 0.4.5 |
| 518 | + warnings.warn( |
| 519 | + "ga.Pdop_identity is deprecated, use `ga.pdop({})` instead", |
| 520 | + DeprecationWarning, stacklevel=2) |
| 521 | + return self.pdop({}) |
| 522 | + |
519 | 523 | def mv(self, root=None, *args, **kwargs): |
520 | 524 | """ |
521 | 525 | Instanciate and return a multivector for this, 'self', |
@@ -600,7 +604,7 @@ def _build_grads(self): |
600 | 604 | if self.norm: |
601 | 605 | r_basis = [x / e_norm for (x, e_norm) in zip(self.r_basis_mv, self.e_norm)] |
602 | 606 |
|
603 | | - pdx = [self.Pdiffs[x] for x in self.coords] |
| 607 | + pdx = [self.pdop(x) for x in self.coords] |
604 | 608 |
|
605 | 609 | self.grad = mv.Dop(r_basis, pdx, ga=self) |
606 | 610 | self.rgrad = mv.Dop(r_basis, pdx, ga=self, cmpflg=True) |
|
0 commit comments