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

Installation

Install using pip: pip install tfga

Requirements:

  • Python 3
  • tensorflow 2
  • numpy

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 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 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 e_12)
# = 5 + 5 e_10 + 5 e_20 + 5 e_21
# = 5 - 5 e_01 - 5 e_02 - 5 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.5.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfga-0.1.5-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file tfga-0.1.5.tar.gz.

File metadata

  • Download URL: tfga-0.1.5.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for tfga-0.1.5.tar.gz
Algorithm Hash digest
SHA256 812feafa24d20e66602991575c94c7d2c03703670c1793f90edd11212c42e6df
MD5 8c4def9aa1f29de2735e0794752e9ba0
BLAKE2b-256 14044b1f3d9649ce133d6c8f208ddd908c72b03570d0c764bb062e9f1eb12e23

See more details on using hashes here.

File details

Details for the file tfga-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: tfga-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for tfga-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8c841418528d52b6dfa4728b42e7f55230debe3ab93b63d2df5b54918e171a61
MD5 a60cbf954aee2933d305b80b62b77f6e
BLAKE2b-256 1e9aac133bd6ee443480270293a9231c0d452befc2861e43ac0ec40d56f9bbc0

See more details on using hashes here.

Supported by

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