Skip to content

Commit 0310f72

Browse files
utensileric-wieser
authored andcommitted
Reproduce a few bugs of printing
1 parent 0cc73f5 commit 0310f72

File tree

2 files changed

+158
-1
lines changed

2 files changed

+158
-1
lines changed

doc/python/BACCAB.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
print('\\bm{a|(b*c)} =', a | (b * c))
1010
print('\\bm{a|(b^c)} =', a | (b ^ c))
1111
print('\\bm{a|(b^c^d)} =', a | (b ^ c ^ d))
12-
# FIXME:FIXED this should print 0, got blank
1312
print('\\bm{a|(b^c)+c|(a^b)+b|(c^a)} =',
1413
(a | (b ^ c)) + (c | (a ^ b)) + (b | (c ^ a)))
1514
print('\\bm{a*(b^c)-b*(a^c)+c*(a^b)} =',

examples/ipython/printing-galgebra.ipynb

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,164 @@
237237
" data = f.read()\n",
238238
"display_pretty(data, raw=True)"
239239
]
240+
},
241+
{
242+
"cell_type": "markdown",
243+
"metadata": {},
244+
"source": [
245+
"## Reproduce Some bugs"
246+
]
247+
},
248+
{
249+
"cell_type": "code",
250+
"execution_count": 10,
251+
"metadata": {},
252+
"outputs": [],
253+
"source": [
254+
"Format()\n",
255+
"xyz_coords = x, y, z = symbols('x y z', real=True)\n",
256+
"o3d, ex, ey, ez = Ga.build('e', g=[1, 1, 1], coords=xyz_coords, norm=True)"
257+
]
258+
},
259+
{
260+
"cell_type": "code",
261+
"execution_count": 11,
262+
"metadata": {},
263+
"outputs": [
264+
{
265+
"data": {
266+
"text/latex": [
267+
"$\\displaystyle \\left( \\left( 1\\right), \\ \\left( e_{x}, \\ e_{y}, \\ e_{z}\\right), \\ \\left( e^{e}_{x y}, \\ e^{e}_{x z}, \\ e^{e}_{y z}\\right), \\ \\left( e^{e e}_{x y z}\\right)\\right)$"
268+
],
269+
"text/plain": [
270+
"((1,), (eₓ, e_y, e_z), (e_x_y__e, e_x_z__e, e_y_z__e), (e_x_y_z__e__e,))"
271+
]
272+
},
273+
"execution_count": 11,
274+
"metadata": {},
275+
"output_type": "execute_result"
276+
}
277+
],
278+
"source": [
279+
"# FIXME BUG: incorrect handling of \\wedge\n",
280+
"o3d.blades"
281+
]
282+
},
283+
{
284+
"cell_type": "code",
285+
"execution_count": 12,
286+
"metadata": {},
287+
"outputs": [],
288+
"source": [
289+
"def build_ga_from_solution(solution, norm=False):\n",
290+
" [metric, coordinate_set, _index_config, cosmological_constant] = solution\n",
291+
" return Ga('e', g=metric, coords=coordinate_set, norm=norm)\n",
292+
"\n",
293+
"g4coords = u, x, y, z = symbols(\"u x y z\")\n",
294+
"g = [\n",
295+
" [0, 0, -exp(-z), 0],\n",
296+
" [0, S.Half * u ** 2 * exp(4 * z), 0, 0],\n",
297+
" [-exp(-z), 0, 12 * exp(-2 * z), u * exp(-z)],\n",
298+
" [0, 0, u * exp(-z), S.Half * u ** 2],\n",
299+
"]\n",
300+
"g4 = build_ga_from_solution([g, g4coords, None, 0])"
301+
]
302+
},
303+
{
304+
"cell_type": "code",
305+
"execution_count": 13,
306+
"metadata": {},
307+
"outputs": [
308+
{
309+
"data": {
310+
"text/plain": [
311+
"(e_u, e_x, e_y, e_z)"
312+
]
313+
},
314+
"execution_count": 13,
315+
"metadata": {},
316+
"output_type": "execute_result"
317+
}
318+
],
319+
"source": [
320+
"# FIXME BUG: should be LaTeX\n",
321+
"g4.mv()"
322+
]
323+
},
324+
{
325+
"cell_type": "code",
326+
"execution_count": 14,
327+
"metadata": {},
328+
"outputs": [
329+
{
330+
"data": {
331+
"text/plain": [
332+
"(-10*e_u - exp(z)*e_y + 2*e_z/u,\n",
333+
" 2*exp(-4*z)*e_x/u**2,\n",
334+
" -exp(z)*e_u,\n",
335+
" 2*e_u/u + 2*e_z/u**2)"
336+
]
337+
},
338+
"execution_count": 14,
339+
"metadata": {},
340+
"output_type": "execute_result"
341+
}
342+
],
343+
"source": [
344+
"# FIXME BUG: should be LaTeX\n",
345+
"g4.mvr()"
346+
]
347+
},
348+
{
349+
"cell_type": "code",
350+
"execution_count": 15,
351+
"metadata": {},
352+
"outputs": [
353+
{
354+
"data": {
355+
"text/latex": [
356+
"$\\displaystyle \\left( \\left( 1\\right), \\ \\left( e_{u}, \\ e_{x}, \\ e_{y}, \\ e_{z}\\right), \\ \\left( e^{e}_{u x}, \\ e^{e}_{u y}, \\ e^{e}_{u z}, \\ e^{e}_{x y}, \\ e^{e}_{x z}, \\ e^{e}_{y z}\\right), \\ \\left( e^{e e}_{u x y}, \\ e^{e e}_{u x z}, \\ e^{e e}_{u y z}, \\ e^{e e}_{x y z}\\right), \\ \\left( e^{e e e}_{u x y z}\\right)\\right)$"
357+
],
358+
"text/plain": [
359+
"((1,), (eᵤ, eₓ, e_y, e_z), (e_u_x__e, e_u_y__e, e_u_z__e, e_x_y__e, e_x_z__e, \n",
360+
"e_y_z__e), (e_u_x_y__e__e, e_u_x_z__e__e, e_u_y_z__e__e, e_x_y_z__e__e), (e_u_\n",
361+
"x_y_z__e__e__e,))"
362+
]
363+
},
364+
"execution_count": 15,
365+
"metadata": {},
366+
"output_type": "execute_result"
367+
}
368+
],
369+
"source": [
370+
"# FIXME BUG: incorrect handling of \\wedge\n",
371+
"g4.blades"
372+
]
373+
},
374+
{
375+
"cell_type": "code",
376+
"execution_count": 16,
377+
"metadata": {},
378+
"outputs": [
379+
{
380+
"data": {
381+
"text/latex": [
382+
"$\\displaystyle e^{e e e}_{u x y z}$"
383+
],
384+
"text/plain": [
385+
"e_u_x_y_z__e__e__e"
386+
]
387+
},
388+
"execution_count": 16,
389+
"metadata": {},
390+
"output_type": "execute_result"
391+
}
392+
],
393+
"source": [
394+
"# FIXME BUG: incorrect handling of \\wedge\n",
395+
"# This is the root cause of the above\n",
396+
"g4.e.obj"
397+
]
240398
}
241399
],
242400
"metadata": {

0 commit comments

Comments
 (0)