Skip to main content

Clifford and Geometric Algebra with TensorFlow

Project description

TFGA - TensorFlow Geometric Algebra

Python package for Geometric / Clifford Algebra with TensorFlow 2.

Build status PyPI

GitHub Docs (coming soon)

Installation

Install using pip: pip install tfga

Requirements:

  • Python 3
  • tensorflow 2
  • numpy
  • scipy (optional, for approx_pow)

Basic usage

from tfga import GeometricAlgebra

ga = GeometricAlgebra(metric=[1, 1, 1])

# 1 e_0 + 1 e_1 + 1 e_2
ordinary_vector = ga.ones(batch_shape=[], kind="vector")

# 5 + 5 e_01 + 5 e_02 + 5.0 e_12
quaternion = ga.fill(batch_shape=[], fill_value=5.0, kind="even")

# 5 + 1 e_0 + 1 e_1 + 1 e_2 + 5 e_01 + 5 e_02 + 5.0 e_12
multivector = ordinary_vector + quaternion

# Inner product e_0 | 1 e_0 + 1 e_1 + 1 e_2 = 1
print(ga.basis_mvs[0] | ordinary_vector)

# Exterior product e_0 ^ e_1 = e_01
print(ga.basis_mvs[0] ^ ga.basis_mvs[1])

# Grade reversal ~(5 + 5 e_01 + 5 e_02 + 5.0 e_12)
# = 5 + 5 e_10 + 5 e_20 + 5.0 e_21
# = 5 - 5 e_01 - 5 e_02 - 5.0 e_12
print(~quaternion)

Notebooks

Generic examples

Quantum Electrodynamics using Geometric Algebra

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfga-0.1.3.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

tfga-0.1.3-py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page