Skip to content

Commit

Permalink
Try fix #518
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed May 11, 2024
1 parent 3f3c29d commit 24383a5
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
86 changes: 86 additions & 0 deletions examples/ipython/issue-518.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "2956314d-53f6-4150-ab15-90eaa84e8815",
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$\\displaystyle 1$"
],
"text/plain": [
"1"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from galgebra.ga import Ga\n",
"import sympy as S\n",
"\n",
"ga = Ga('e', g=[1,1,1], coords=S.symbols(f\"0:{3}\", real=True), wedge=False)\n",
"x,y,z = ga.mv()\n",
"(x**0).grade()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2fa9ab19-eb44-4eb8-b369-453cd779a249",
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$\\displaystyle 1$"
],
"text/plain": [
"1"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(x**2).grade()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9b287705-2c5a-4a6b-88f4-ba7c7c336947",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
2 changes: 1 addition & 1 deletion galgebra/mv.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def __pow__(self, n): # Integer power operator
if n < 0:
return (self**(-n)).inv()

result = S.One
result = Mv(S.One, 'scalar', ga=self.Ga)
for x in range(n):
result *= self
return result
Expand Down

0 comments on commit 24383a5

Please sign in to comment.