clifford icon indicating copy to clipboard operation
clifford copied to clipboard

Introduce a scalar product function (and operator)?

Open eric-wieser opened this issue 4 years ago • 0 comments

Today, all of the following are ways to compute scalar products

  1. (a * b)[()]
  2. (a | b)[()]
  3. (a << b)[()]
  4. (a * b)[0]
  5. (a | b)[0]
  6. (a << b)[0]

The problems with these approaches are:

  • 1 and 4 compute a lot of unwanted terms
  • 2 and 5 compute some unwanted terms
  • 3 and 6 compute fewer unwanted terms
  • 4, 5, and 6 fail if a.layout._basis_blade_order.bitmap_to_index[0] != 0.

It would be straightforward to compile a smt_func in the same way we compile the other functions. The question is, what should the API look like?

Some options:

  • a @ b - treads on the toes of #267
  • a % b
  • a // b - weird, because // suggests division
  • clifford.operator.sp(a, b)
  • a.sp(b)
  • a.scalar_product(b)
  • ...

Other libraries:

  • Ganja: no scalar product operator
  • tpga: no scalar product operator
  • garamon: a.scalarProduct(b)
  • Galgebra:
    • docs suggest & was once the scalar product operator, but not implemented
    • a.Ga.scalar_product(a, b)
  • Galgebra.jl: A ⊛ B

eric-wieser avatar Jun 26 '20 10:06 eric-wieser