Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arsenovic/f167cadf8bc431744e1c7bc2a6ae16c1 to your computer and use it in GitHub Desktop.
Save arsenovic/f167cadf8bc431744e1c7bc2a6ae16c1 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "30804db9",
"metadata": {},
"source": [
"## G(n,n) ( balanced algebra)\n",
"\n",
"Implementation of directional scaling in G3, by using rotors in G(3,3)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "fd5e4f33",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3.0^e1) + (8.0^e2) + (15.0^e3)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from clifford import Cl \n",
"from pylab import *\n",
"\n",
"\n",
"layout,blades = Cl(3,3)\n",
"locals().update(blades)\n",
"\n",
"\n",
"J1,J2,J3 = e14,e25,e36\n",
"Js = [J1,J2,J3] # list of J's\n",
"J = sum(Js)\n",
"\n",
"\n",
"up = lambda x: x + (x|J ) # put it on the null cones\n",
"dn = lambda x: x(e123) # project back into original space\n",
"\n",
"x = 1*e1 + 2*e2 + 3*e3\n",
"X = up(x)\n",
"\n",
"D = e**(-log(sqrt(3))*J1 - log(sqrt(4))*J2- log(sqrt(5))*J3 )\n",
"\n",
"dn(D*X*~D)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "074edcb4",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment