Releases: Kenny2github/MultiVectors
Releases · Kenny2github/MultiVectors
1.2.1
1.2.0
New Stuff
- Proper docs instead of a monolithic
docs.mdfile.
Removed
- BREAKING: Scalar factories are no longer supported. They make typechecking extremely difficult and are too magical.
- Since it's doubtful that anyone was using them (or this library, for that matter...) this is not marked with a major version change.
1.1.0
New Stuff
MultiVector.expcomputesmath.e ** Vusing the Taylor series, which basically applies to anything for which scalar-thing and thing-thing addition and multiplication are defined.MultiVector.scalarclassmethod generates a scalar MultiVector from a string, by passing it through the scalar factory.
Changes
MultiVector.__rpow__is now defined in terms ofMultiVector.exp(a^b = e^(b ln a))- BREAKING: This means that
math.e ** V == V.exphas different behavior from previousmath.e ** VwhenV*V != -1. This is because previously I was mistakenly applying Euler's formula to objects that do not behave like the imaginary unit. The docs have been updated to reflect this. - Since this is a correction of behavior, I'm calling it a bugfix and not incrementing the major version.
- Note that the behavior remains the same across versions when
V*V == -1, which should be the case for all valid use cases ofMultiVector.rotate
- BREAKING: This means that
1.0.0
New Stuff
MultiVector.gradereturns the grade of a blade (a single-term multivector) orNoneif the multivector has more than one term.- FEATURE: Scalar factories, by means of
multivectors.set_scalar_factory(). See the end of the docs. MultiVectors can now compare equal to scalars if they themselves are scalar.MultiVectors can now be relationally compared with scalars if they themselves are scalar.MultiVectors can now be 1/ed, but only if they are blades.MultiVector.__invert__implements the conjugate.
Changes
- BREAKING: Removed
Bladeclass. It is replaced by single-termMultiVectors. - BREAKING: Swapped behaviors of
v % gradeandv[idxs]- they are nowv % idxsandv[grade(s)]because[]notation denotes subscript more often. MultiVector.termsnow returns a tuple of single-termMultiVectors.MultiVector.__init__now takes a more active role in casting values to the scalar factory.- An empty
MultiVectoris no longer possible; if there are no terms, a scalar 0 is inserted. MultiVector.from_termsnow always returns aMultiVector, which means that all operations now do too.repr(n * _)='(' + repr(n) + ')'to distinguish it fromn.- Since
Bladeis no more,repr(v)now*-multiples bases instead of swizzling them. MultiVector.__pow__no longer supports ternarypow()because modulo means index swizzling now.- Normalization is now done by
MultiVector.__pos__instead of__invert__. math.fsum()is no longer used as it causesDecimals to lose precision by casting them to floats. If you need precision in addition, useDecimal.MultiVector.rotatewill now raise aTypeErrorifplaneis not a basis.
0.1.1
New Stuff
Blade.__eq__, Blade.__ne__, MultiVector.__eq__, MultiVector.__ne__are now defined for all objects.Blade.__lt__, Blade.__le__, Blade.__gt__, Blade.__ge__are now defined for blades of the same bases.- New documentation.
run_tests.pyrunsdocteston the module and Markdown, with a non-zero exit status on failure.
Fixes
- A couple of fixes in doctests.
0.1.0
New Features
multivectors.xyandfrom multivectors import xyzare now a thing (swizzling on the module level) but unlike class-level swizzling, invalid chars will cause anAttributeError(from multivectors import awould setato1.0otherwise)Blade.termsreturns(blade,)for compatibility withMultiVector.termsreal @ bladeis now supportedA ** -n = 1 / (A ** n)real ^ bladeis now supported- To better mimic regular
floats, scalar blades can now be passed tocomplex(),int(), andarr[] round(blade),math.trunc(blade),math.floor(blade), andmath.ceil(blade)act on the scalar part, returning that times the basessimple @ multivectoris now supportedsimple ^ multivectoris now supportedround(multivector),math.trunc(multivector),math.floor(multivector), andmath.ceil(multivector)act on each component of the multivector, returning their sum
Changes
names_to_idxs()takes a new parameter that controls whether to fail on invalid charsrepr(Blade)usesrepr()on its scalar again;%.2fis still used instr()multivector ** -nis now explicitly rejected
Fixes
names_to_idxs()no longer fails on invalid chars betweeneand the digits of the number (enablese_1)idxs_to_idxs()now always returns a liststr(Blade)used to returne0fore1blade @ non-simplenow correctly fails- Fixed infinite recursion when
Blade(scalar=x) / blade blade ^ non-simplenow correctly failsblade ^ realno longer fails- Correction:
abs(blade)is(blade * blade) ** .5, notblade.scalar float(blade)can't returnNotImplemented, so raiseTypeErrormultivector % gradenow returns the blades, not just their scalarsMultiVector.angle_to()returns a real, not aMultiVector.- Noted in docstring of
MultiVector.angle_to()that multivectors of singular grade 1 only are accepted
0.0.0
Initial release
- Create the library