{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from clifford.g3c import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Metric\n", "print(e1*e1)\n", "print(e2*e2)\n", "print(e3*e3)\n", "print(e4*e4)\n", "print(e5*e5)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Example\n", "a = (2 + 5.7*e2)*(e1 + e3*e4)\n", "b = 5*e2 - 3.5*e1\n", "print(a)\n", "print(b)\n", "\n", "# Projection\n", "print(a(2))\n", "\n", "# Outer product\n", "print(a^b)\n", "\n", "# Inner product\n", "print(a|b)\n", "\n", "# Left contraction\n", "print(a.lc(b))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Mapping points from euclidean to conformal \n", "b_up = up(5*e2 - 3.5*e1)\n", "print(b_up)\n", "\n", "# And back again\n", "print( down(b_up) )" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.13" } }, "nbformat": 4, "nbformat_minor": 0 }