|
| 1 | +{ |
| 2 | + "cells" : |
| 3 | + [ |
| 4 | + { |
| 5 | + "cell_origin" : "client", |
| 6 | + "cell_type" : "latex", |
| 7 | + "cells" : |
| 8 | + [ |
| 9 | + { |
| 10 | + "cell_origin" : "client", |
| 11 | + "cell_type" : "latex_view", |
| 12 | + "source" : "\\algorithm{map_sympy}{Map Sympy algorithms to Cadabra expressions}\n\nCadabra expressions are typically tensor expressions, which you cannot feed directly\ninto Sympy. With the \\algo{map_sympy} function you can recursively apply Sympy algorithms\nto the scalar parts of Cadabra expressions.\n\nThe simplest example is when you have a scalar expression in Cadabra, for instance" |
| 13 | + } |
| 14 | + ], |
| 15 | + "hidden" : true, |
| 16 | + "source" : "\\algorithm{map_sympy}{Map Sympy algorithms to Cadabra expressions}\n\nCadabra expressions are typically tensor expressions, which you cannot feed directly\ninto Sympy. With the \\algo{map_sympy} function you can recursively apply Sympy algorithms\nto the scalar parts of Cadabra expressions.\n\nThe simplest example is when you have a scalar expression in Cadabra, for instance" |
| 17 | + }, |
| 18 | + { |
| 19 | + "cell_origin" : "client", |
| 20 | + "cell_type" : "input", |
| 21 | + "cells" : |
| 22 | + [ |
| 23 | + { |
| 24 | + "cell_origin" : "server", |
| 25 | + "cell_type" : "latex_view", |
| 26 | + "source" : "\\begin{dmath*}{}\\int \\sin{x}\\,\\,{\\rm d}x\\end{dmath*}" |
| 27 | + } |
| 28 | + ], |
| 29 | + "source" : "ex:= \\int{\\sin(x)}{x};" |
| 30 | + }, |
| 31 | + { |
| 32 | + "cell_origin" : "client", |
| 33 | + "cell_type" : "input", |
| 34 | + "cells" : |
| 35 | + [ |
| 36 | + { |
| 37 | + "cell_origin" : "server", |
| 38 | + "cell_type" : "latex_view", |
| 39 | + "source" : "\\begin{dmath*}{}-\\cos{x}\\end{dmath*}" |
| 40 | + } |
| 41 | + ], |
| 42 | + "source" : "map_sympy(ex);" |
| 43 | + }, |
| 44 | + { |
| 45 | + "cell_origin" : "client", |
| 46 | + "cell_type" : "latex", |
| 47 | + "cells" : |
| 48 | + [ |
| 49 | + { |
| 50 | + "cell_origin" : "client", |
| 51 | + "cell_type" : "latex_view", |
| 52 | + "source" : "The inert Cadabra expression gets evaluated by Sympy and then stored again in the `ex` object," |
| 53 | + } |
| 54 | + ], |
| 55 | + "hidden" : true, |
| 56 | + "source" : "The inert Cadabra expression gets evaluated by Sympy and then stored again in the `ex` object," |
| 57 | + }, |
| 58 | + { |
| 59 | + "cell_origin" : "client", |
| 60 | + "cell_type" : "input", |
| 61 | + "cells" : |
| 62 | + [ |
| 63 | + { |
| 64 | + "cell_origin" : "server", |
| 65 | + "cell_type" : "latex_view", |
| 66 | + "source" : "\\begin{dmath*}{}-\\cos{x}\\end{dmath*}" |
| 67 | + } |
| 68 | + ], |
| 69 | + "source" : "ex;" |
| 70 | + }, |
| 71 | + { |
| 72 | + "cell_origin" : "client", |
| 73 | + "cell_type" : "latex", |
| 74 | + "cells" : |
| 75 | + [ |
| 76 | + { |
| 77 | + "cell_origin" : "client", |
| 78 | + "cell_type" : "latex_view", |
| 79 | + "source" : "In more complicated cases you may have a tensorial expression which you would like to \nsimplify using Sympy, for instance" |
| 80 | + } |
| 81 | + ], |
| 82 | + "hidden" : true, |
| 83 | + "source" : "In more complicated cases you may have a tensorial expression which you would like to \nsimplify using Sympy, for instance" |
| 84 | + }, |
| 85 | + { |
| 86 | + "cell_origin" : "client", |
| 87 | + "cell_type" : "input", |
| 88 | + "cells" : |
| 89 | + [ |
| 90 | + { |
| 91 | + "cell_origin" : "server", |
| 92 | + "cell_type" : "latex_view", |
| 93 | + "source" : "\\begin{dmath*}{}\\left({\\left(\\sin{x}\\right)}^{2}+{\\left(\\cos{x}\\right)}^{2}\\right) A_{m}-A_{m}\\end{dmath*}" |
| 94 | + } |
| 95 | + ], |
| 96 | + "source" : "ex:= (\\sin(x)**2 + \\cos(x)**2) A_{m} - A_{m};" |
| 97 | + }, |
| 98 | + { |
| 99 | + "cell_origin" : "client", |
| 100 | + "cell_type" : "input", |
| 101 | + "cells" : |
| 102 | + [ |
| 103 | + { |
| 104 | + "cell_origin" : "server", |
| 105 | + "cell_type" : "latex_view", |
| 106 | + "source" : "\\begin{dmath*}{}0\\end{dmath*}" |
| 107 | + } |
| 108 | + ], |
| 109 | + "source" : "map_sympy(ex, \"simplify\");" |
| 110 | + }, |
| 111 | + { |
| 112 | + "cell_origin" : "client", |
| 113 | + "cell_type" : "input", |
| 114 | + "source" : "" |
| 115 | + } |
| 116 | + ], |
| 117 | + "description" : "Cadabra JSON notebook format", |
| 118 | + "version" : 1 |
| 119 | +} |
0 commit comments