1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 20 2006 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>
-->
<head>
<title>Maxima Manual: 28. itensor</title>
<meta name="description" content="Maxima Manual: 28. itensor">
<meta name="keywords" content="Maxima Manual: 28. itensor">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
color: black;
background: white;
margin-left: 8%;
margin-right: 13%;
}
h1
{
margin-left: +8%;
font-size: 150%;
font-family: sans-serif
}
h2
{
font-size: 125%;
font-family: sans-serif
}
h3
{
font-size: 100%;
font-family: sans-serif
}
h2,h3,h4,h5,h6 { margin-left: +4%; }
div.textbox
{
border: solid;
border-width: thin;
/* width: 100%; */
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em
}
div.titlebox
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em;
background: rgb(200,255,255);
font-family: sans-serif
}
div.synopsisbox
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em;
background: rgb(255,220,255);
/*background: rgb(200,255,255); */
/* font-family: fixed */
}
pre.example
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 1em;
padding-right: 1em;
background: rgb(247,242,180); /* kind of sandy */
/* background: rgb(200,255,255); */ /* sky blue */
font-family: "Lucida Console", monospace
}
div.spacerbox
{
border: none;
padding-top: 2em;
padding-bottom: 2em
}
div.image
{
margin: 0;
padding: 1em;
text-align: center;
}
-->
</style>
<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="itensor"></a>
<a name="SEC93"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_27.html#SEC92" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC94" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima_27.html#SEC91" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 28. itensor </h1>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC94">28.1 Introduction to itensor</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC97">28.2 Definitions for itensor</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="Introduction-to-itensor"></a>
<a name="SEC94"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC93" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC95" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC93" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 28.1 Introduction to itensor </h2>
<p>Maxima implements symbolic tensor manipulation of two distinct types:
component tensor manipulation (<code>ctensor</code> package) and indicial tensor manipulation (<code>itensor</code> package).
</p>
<p>Nota bene: Please see the note on 'new tensor notation' below.
</p>
<p>Component tensor manipulation means that geometrical tensor
objects are represented as arrays or matrices. Tensor operations such
as contraction or covariant differentiation are carried out by
actually summing over repeated (dummy) indices with <code>do</code> statements.
That is, one explicitly performs operations on the appropriate tensor
components stored in an array or matrix.
</p>
<p>Indicial tensor manipulation is implemented by representing
tensors as functions of their covariant, contravariant and derivative
indices. Tensor operations such as contraction or covariant
differentiation are performed by manipulating the indices themselves
rather than the components to which they correspond.
</p>
<p>These two approaches to the treatment of differential, algebraic and
analytic processes in the context of Riemannian geometry have various
advantages and disadvantages which reveal themselves only through the
particular nature and difficulty of the user's problem. However, one
should keep in mind the following characteristics of the two
implementations:
</p>
<p>The representation of tensors and tensor operations explicitly in
terms of their components makes <code>ctensor</code> easy to use. Specification of
the metric and the computation of the induced tensors and invariants
is straightforward. Although all of Maxima's powerful simplification
capacity is at hand, a complex metric with intricate functional and
coordinate dependencies can easily lead to expressions whose size is
excessive and whose structure is hidden. In addition, many calculations
involve intermediate expressions which swell causing programs to
terminate before completion. Through experience, a user can avoid
many of these difficulties.
</p>
<p>Because of the special way in which tensors and tensor operations
are represented in terms of symbolic operations on their indices,
expressions which in the component representation would be
unmanageable can sometimes be greatly simplified by using the special
routines for symmetrical objects in <code>itensor</code>. In this way the structure
of a large expression may be more transparent. On the other hand, because
of the the special indicial representation in <code>itensor</code>, in some cases the
user may find difficulty with the specification of the metric, function
definition, and the evaluation of differentiated "indexed" objects.
</p>
<hr size="6">
<a name="SEC95"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC94" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC96" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC94" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.1.1 New tensor notation </h3>
<p>Until now, the <code>itensor</code> package in Maxima has used a notation that sometimes
led to incorrect index ordering. Consider the following, for instance:
</p>
<table><tr><td> </td><td><pre class="example">(%i2) imetric(g);
(%o2) done
(%i3) ishow(g([],[j,k])*g([],[i,l])*a([i,j],[]))$
i l j k
(%t3) g g a
i j
(%i4) ishow(contract(%))$
k l
(%t4) a
</pre></td></tr></table>
<p>This result is incorrect unless <code>a</code> happens to be a symmetric tensor.
The reason why this happens is that although <code>itensor</code> correctly maintains
the order within the set of covariant and contravariant indices, once an
index is raised or lowered, its position relative to the other set of
indices is lost.
</p>
<p>To avoid this problem, a new notation has been developed that remains fully
compatible with the existing notation and can be used interchangeably. In
this notation, contravariant indices are inserted in the appropriate
positions in the covariant index list, but with a minus sign prepended.
Functions like <code>contract</code> and <code>ishow</code> are now aware of this
new index notation and can process tensors appropriately.
</p>
<p>In this new notation, the previous example yields a correct result:
</p>
<table><tr><td> </td><td><pre class="example">(%i5) ishow(g([-j,-k],[])*g([-i,-l],[])*a([i,j],[]))$
i l j k
(%t5) g a g
i j
(%i6) ishow(contract(%))$
l k
(%t6) a
</pre></td></tr></table>
<p>Presently, the only code that makes use of this notation is the <code>lc2kdt</code>
function. Through this notation, it achieves consistent results as it
applies the metric tensor to resolve Levi-Civita symbols without resorting
to numeric indices.
</p>
<p>Since this code is brand new, it probably contains bugs. While it has been
tested to make sure that it doesn't break anything using the "old" tensor
notation, there is a considerable chance that "new" tensors will fail to
interoperate with certain functions or features. These bugs will be fixed
as they are encountered... until then, caveat emptor!
</p>
<hr size="6">
<a name="SEC96"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC95" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC94" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.1.2 Indicial tensor manipulation </h3>
<p>The indicial tensor manipulation package may be loaded by
<code>load(itensor)</code>. Demos are also available: try <code>demo(tensor)</code>.
</p>
<p>In <code>itensor</code> a tensor is represented as an "indexed object" . This is a
function of 3 groups of indices which represent the covariant,
contravariant and derivative indices. The covariant indices are
specified by a list as the first argument to the indexed object, and
the contravariant indices by a list as the second argument. If the
indexed object lacks either of these groups of indices then the empty
list <code>[]</code> is given as the corresponding argument. Thus, <code>g([a,b],[c])</code>
represents an indexed object called <code>g</code> which has two covariant indices
<code>(a,b)</code>, one contravariant index (<code>c</code>) and no derivative indices.
</p>
<p>The derivative indices, if they are present, are appended as
additional arguments to the symbolic function representing the tensor.
They can be explicitly specified by the user or be created in the
process of differentiation with respect to some coordinate variable.
Since ordinary differentiation is commutative, the derivative indices
are sorted alphanumerically, unless <code>iframe_flag</code> is set to <code>true</code>,
indicating that a frame metric is being used. This canonical ordering makes it
possible for Maxima to recognize that, for example, <code>t([a],[b],i,j)</code> is
the same as <code>t([a],[b],j,i)</code>. Differentiation of an indexed object with
respect to some coordinate whose index does not appear as an argument
to the indexed object would normally yield zero. This is because
Maxima would not know that the tensor represented by the indexed
object might depend implicitly on the corresponding coordinate. By
modifying the existing Maxima function <code>diff</code> in <code>itensor</code>, Maxima now
assumes that all indexed objects depend on any variable of
differentiation unless otherwise stated. This makes it possible for
the summation convention to be extended to derivative indices. It
should be noted that <code>itensor</code> does not possess the capabilities of
raising derivative indices, and so they are always treated as
covariant.
</p>
<p>The following functions are available in the tensor package for
manipulating indexed objects. At present, with respect to the
simplification routines, it is assumed that indexed objects do not
by default possess symmetry properties. This can be overridden by
setting the variable <code>allsym[false]</code> to <code>true</code>, which will
result in treating all indexed objects completely symmetric in their
lists of covariant indices and symmetric in their lists of
contravariant indices.
</p>
<p>The <code>itensor</code> package generally treats tensors as opaque objects. Tensorial
equations are manipulated based on algebraic rules, specifically symmetry
and contraction rules. In addition, the <code>itensor</code> package understands
covariant differentiation, curvature, and torsion. Calculations can be
performed relative to a metric of moving frame, depending on the setting
of the <code>iframe_flag</code> variable.
</p>
<p>A sample session below demonstrates how to load the <code>itensor</code> package,
specify the name of the metric, and perform some simple calculations.
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) imetric(g);
(%o2) done
(%i3) components(g([i,j],[]),p([i,j],[])*e([],[]))$
(%i4) ishow(g([k,l],[]))$
(%t4) e p
k l
(%i5) ishow(diff(v([i],[]),t))$
(%t5) 0
(%i6) depends(v,t);
(%o6) [v(t)]
(%i7) ishow(diff(v([i],[]),t))$
d
(%t7) -- (v )
dt i
(%i8) ishow(idiff(v([i],[]),j))$
(%t8) v
i,j
(%i9) ishow(extdiff(v([i],[]),j))$
(%t9) v - v
j,i i,j
-----------
2
(%i10) ishow(liediff(v,w([i],[])))$
%3 %3
(%t10) v w + v w
i,%3 ,i %3
(%i11) ishow(covdiff(v([i],[]),j))$
%4
(%t11) v - v ichr2
i,j %4 i j
(%i12) ishow(ev(%,ichr2))$
%4 %5
(%t12) v - g v (e p + e p - e p - e p
i,j %4 j %5,i ,i j %5 i j,%5 ,%5 i j
+ e p + e p )/2
i %5,j ,j i %5
(%i13) iframe_flag:true;
(%o13) true
(%i14) ishow(covdiff(v([i],[]),j))$
%6
(%t14) v - v icc2
i,j %6 i j
(%i15) ishow(ev(%,icc2))$
%6
(%t15) v - v ifc2
i,j %6 i j
(%i16) ishow(radcan(ev(%,ifc2,ifc1)))$
%6 %8 %6 %8
(%t16) - (ifg v ifb + ifg v ifb - 2 v
%6 j %8 i %6 i j %8 i,j
%6 %8
- ifg v ifb )/2
%6 %8 i j
(%i17) ishow(canform(s([i,j],[])-s([j,i])))$
(%t17) s - s
i j j i
(%i18) decsym(s,2,0,[sym(all)],[]);
(%o18) done
(%i19) ishow(canform(s([i,j],[])-s([j,i])))$
(%t19) 0
(%i20) ishow(canform(a([i,j],[])+a([j,i])))$
(%t20) a + a
j i i j
(%i21) decsym(a,2,0,[anti(all)],[]);
(%o21) done
(%i22) ishow(canform(a([i,j],[])+a([j,i])))$
(%t22) 0
</pre></td></tr></table>
<hr size="6">
<a name="Definitions-for-itensor"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC96" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC98" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC93" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="SEC97"></a>
<h2 class="section"> 28.2 Definitions for itensor </h2>
<hr size="6">
<a name="SEC98"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC97" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC99" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.1 Managing indexed objects </h3>
<dl>
<dt><u>Function:</u> <b>entertensor</b><i> (<var>name</var>)</i>
<a name="IDX851"></a>
</dt>
<dd><p>is a function which, by prompting, allows one to create an indexed
object called <var>name</var> with any number of tensorial and derivative
indices. Either a single index or a list of indices (which may be
null) is acceptable input (see the example under <code>covdiff</code>).
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>changename</b><i> (<var>old</var>, <var>new</var>, <var>expr</var>)</i>
<a name="IDX852"></a>
</dt>
<dd><p>will change the name of all indexed objects called <var>old</var> to <var>new</var>
in <var>expr</var>. <var>old</var> may be either a symbol or a list of the form
<code>[<var>name</var>, <var>m</var>, <var>n</var>]</code> in which case only those indexed objects called
<var>name</var> with <var>m</var> covariant and <var>n</var> contravariant indices will be
renamed to <var>new</var>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>listoftens</b>
<a name="IDX853"></a>
</dt>
<dd><p>Lists all tensors in a tensorial expression, complete with their indices. E.g.,
</p>
<table><tr><td> </td><td><pre class="example">
(%i6) ishow(a([i,j],[k])*b([u],[],v)+c([x,y],[])*d([],[])*e)$
k
(%t6) d e c + a b
x y i j u,v
(%i7) ishow(listoftens(%))$
k
(%t7) [a , b , c , d]
i j u,v x y
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>ishow</b><i> (<var>expr</var>)</i>
<a name="IDX854"></a>
</dt>
<dd><p>displays <var>expr</var> with the indexed objects in it shown having their
covariant indices as subscripts and contravariant indices as
superscripts. The derivative indices are displayed as subscripts,
separated from the covariant indices by a comma (see the examples
throughout this document).
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>indices</b><i> (<var>expr</var>)</i>
<a name="IDX855"></a>
</dt>
<dd><p>Returns a list of two elements. The first is a list of the free
indices in <var>expr</var> (those that occur only once). The second is the
list of the dummy indices in <var>expr</var> (those that occur exactly twice)
as the following example demonstrates.
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(a([i,j],[k,l],m,n)*b([k,o],[j,m,p],q,r))$
k l j m p
(%t2) a b
i j,m n k o,q r
(%i3) indices(%);
(%o3) [[l, p, i, n, o, q, r], [k, j, m]]
</pre></td></tr></table>
<p>A tensor product containing the same index more than twice is syntactically
illegal. <code>indices</code> attempts to deal with these expressions in a
reasonable manner; however, when it is called to operate upon such an
illegal expression, its behavior should be considered undefined.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>rename</b><i> (<var>expr</var>)</i>
<a name="IDX856"></a>
</dt>
<dt><u>Function:</u> <b>rename</b><i> (<var>expr</var>, <var>count</var>)</i>
<a name="IDX857"></a>
</dt>
<dd><p>Returns an expression equivalent to <var>expr</var> but with the dummy indices
in each term chosen from the set <code>[%1, %2,...]</code>, if the optional second
argument is omitted. Otherwise, the dummy indices are indexed
beginning at the value of <var>count</var>. Each dummy index in a product
will be different. For a sum, <code>rename</code> will operate upon each term in
the sum resetting the counter with each term. In this way <code>rename</code> can
serve as a tensorial simplifier. In addition, the indices will be
sorted alphanumerically (if <code>allsym</code> is <code>true</code>) with respect to
covariant or contravariant indices depending upon the value of <code>flipflag</code>.
If <code>flipflag</code> is <code>false</code> then the indices will be renamed according
to the order of the contravariant indices. If <code>flipflag</code> is <code>true</code>
the renaming will occur according to the order of the covariant
indices. It often happens that the combined effect of the two renamings will
reduce an expression more than either one by itself.
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) allsym:true;
(%o2) true
(%i3) g([],[%4,%5])*g([],[%6,%7])*ichr2([%1,%4],[%3])*
ichr2([%2,%3],[u])*ichr2([%5,%6],[%1])*ichr2([%7,r],[%2])-
g([],[%4,%5])*g([],[%6,%7])*ichr2([%1,%2],[u])*
ichr2([%3,%5],[%1])*ichr2([%4,%6],[%3])*ichr2([%7,r],[%2]),noeval$
(%i4) expr:ishow(%)$
%4 %5 %6 %7 %3 u %1 %2
(%t4) g g ichr2 ichr2 ichr2 ichr2
%1 %4 %2 %3 %5 %6 %7 r
%4 %5 %6 %7 u %1 %3 %2
- g g ichr2 ichr2 ichr2 ichr2
%1 %2 %3 %5 %4 %6 %7 r
(%i5) flipflag:true;
(%o5) true
(%i6) ishow(rename(expr))$
%2 %5 %6 %7 %4 u %1 %3
(%t6) g g ichr2 ichr2 ichr2 ichr2
%1 %2 %3 %4 %5 %6 %7 r
%4 %5 %6 %7 u %1 %3 %2
- g g ichr2 ichr2 ichr2 ichr2
%1 %2 %3 %4 %5 %6 %7 r
(%i7) flipflag:false;
(%o7) false
(%i8) rename(%th(2));
(%o8) 0
(%i9) ishow(rename(expr))$
%1 %2 %3 %4 %5 %6 %7 u
(%t9) g g ichr2 ichr2 ichr2 ichr2
%1 %6 %2 %3 %4 r %5 %7
%1 %2 %3 %4 %6 %5 %7 u
- g g ichr2 ichr2 ichr2 ichr2
%1 %3 %2 %6 %4 r %5 %7
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>flipflag</b>
<a name="IDX858"></a>
</dt>
<dd><p>Default: <code>false</code>. If <code>false</code> then the indices will be
renamed according to the order of the contravariant indices,
otherwise according to the order of the covariant indices.
</p>
<p>If <code>flipflag</code> is <code>false</code> then <code>rename</code> forms a list
of the contravariant indices as they are encountered from left to right
(if <code>true</code> then of the covariant indices). The first dummy
index in the list is renamed to <code>%1</code>, the next to <code>%2</code>, etc.
Then sorting occurs after the <code>rename</code>-ing (see the example
under <code>rename</code>).
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>defcon</b><i> (<var>tensor_1</var>)</i>
<a name="IDX859"></a>
</dt>
<dt><u>Function:</u> <b>defcon</b><i> (<var>tensor_1</var>, <var>tensor_2</var>, <var>tensor_3</var>)</i>
<a name="IDX860"></a>
</dt>
<dd><p>gives <var>tensor_1</var> the property that the
contraction of a product of <var>tensor_1</var> and <var>tensor_2</var> results in <var>tensor_3</var>
with the appropriate indices. If only one argument, <var>tensor_1</var>, is
given, then the contraction of the product of <var>tensor_1</var> with any indexed
object having the appropriate indices (say <code>my_tensor</code>) will yield an
indexed object with that name, i.e. <code>my_tensor</code>, and with a new set of
indices reflecting the contractions performed.
For example, if <code>imetric:g</code>, then <code>defcon(g)</code> will implement the
raising and lowering of indices through contraction with the metric
tensor.
More than one <code>defcon</code> can be given for the same indexed object; the
latest one given which applies in a particular contraction will be
used.
<code>contractions</code> is a list of those indexed objects which have been given
contraction properties with <code>defcon</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>remcon</b><i> (<var>tensor_1</var>, ..., <var>tensor_n</var>)</i>
<a name="IDX861"></a>
</dt>
<dt><u>Function:</u> <b>remcon</b><i> (all)</i>
<a name="IDX862"></a>
</dt>
<dd><p>removes all the contraction properties
from the <var>tensor_1</var>, ..., <var>tensor_n</var>). <code>remcon(all)</code> removes all contraction
properties from all indexed objects.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>contract</b><i> (<var>expr</var>)</i>
<a name="IDX863"></a>
</dt>
<dd><p>Carries out the tensorial contractions in <var>expr</var> which may be any
combination of sums and products. This function uses the information
given to the <code>defcon</code> function. For best results, <code>expr</code>
should be fully expanded. <code>ratexpand</code> is the fastest way to expand
products and powers of sums if there are no variables in the denominators
of the terms. The <code>gcd</code> switch should be <code>false</code> if GCD
cancellations are unnecessary.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>indexed_tensor</b><i> (<var>tensor</var>)</i>
<a name="IDX864"></a>
</dt>
<dd><p>Must be executed before assigning components to a <var>tensor</var> for which
a built in value already exists as with <code>ichr1</code>, <code>ichr2</code>,
<code>icurvature</code>. See the example under <code>icurvature</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>components</b><i> (<var>tensor</var>, <var>expr</var>)</i>
<a name="IDX865"></a>
</dt>
<dd><p>permits one to assign an indicial value to an expression
<var>expr</var> giving the values of the components of <var>tensor</var>. These
are automatically substituted for the tensor whenever it occurs with
all of its indices. The tensor must be of the form <code>t([...],[...])</code>
where either list may be empty. <var>expr</var> can be any indexed expression
involving other objects with the same free indices as <var>tensor</var>. When
used to assign values to the metric tensor wherein the components
contain dummy indices one must be careful to define these indices to
avoid the generation of multiple dummy indices. Removal of this
assignment is given to the function <code>remcomps</code>.
</p>
<p>It is important to keep in mind that <code>components</code> cares only about
the valence of a tensor, not about any particular index ordering. Thus
assigning components to, say, <code>x([i,-j],[])</code>, <code>x([-j,i],[])</code>, or
<code>x([i],[j])</code> all produce the same result, namely components being
assigned to a tensor named <code>x</code> with valence <code>(1,1)</code>.
</p>
<p>Components can be assigned to an indexed expression in four ways, two
of which involve the use of the <code>components</code> command:
</p>
<p>1) As an indexed expression. For instance:
</p>
<table><tr><td> </td><td><pre class="example">
(%i2) components(g([],[i,j]),e([],[i])*p([],[j]))$
(%i3) ishow(g([],[i,j]))$
i j
(%t3) e p
</pre></td></tr></table>
<p>2) As a matrix:
</p>
<table><tr><td> </td><td><pre class="example">
(%i6) components(g([i,j],[]),lg);
(%o6) done
(%i7) ishow(g([i,j],[]))$
(%t7) g
i j
(%i8) g([3,3],[]);
(%o8) 1
(%i9) g([4,4],[]);
(%o9) - 1
</pre></td></tr></table>
<p>3) As a function. You can use a Maxima function to specify the
components of a tensor based on its indices. For instance, the following
code assigns <code>kdelta</code> to <code>h</code> if <code>h</code> has the same number
of covariant and contravariant indices and no derivative indices, and
<code>g</code> otherwise:
</p>
<table><tr><td> </td><td><pre class="example">
(%i4) h(l1,l2,[l3]):=if length(l1)=length(l2) and length(l3)=0
then kdelta(l1,l2) else apply(g,append([l1,l2], l3))$
(%i5) ishow(h([i],[j]))$
j
(%t5) kdelta
i
(%i6) ishow(h([i,j],[k],l))$
k
(%t6) g
i j,l
</pre></td></tr></table>
<p>4) Using Maxima's pattern matching capabilities, specifically the
<code>defrule</code> and <code>applyb1</code> commands:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) matchdeclare(l1,listp);
(%o2) done
(%i3) defrule(r1,m(l1,[]),(i1:idummy(),
g([l1[1],l1[2]],[])*q([i1],[])*e([],[i1])))$
(%i4) defrule(r2,m([],l1),(i1:idummy(),
w([],[l1[1],l1[2]])*e([i1],[])*q([],[i1])))$
(%i5) ishow(m([i,n],[])*m([],[i,m]))$
i m
(%t5) m m
i n
(%i6) ishow(rename(applyb1(%,r1,r2)))$
%1 %2 %3 m
(%t6) e q w q e g
%1 %2 %3 n
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>remcomps</b><i> (<var>tensor</var>)</i>
<a name="IDX866"></a>
</dt>
<dd><p>Unbinds all values from <var>tensor</var> which were assigned with the
<code>components</code> function.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>showcomps</b><i> (<var>tensor</var>)</i>
<a name="IDX867"></a>
</dt>
<dd><p>Shows component assignments of a tensor, as made using the <code>components</code>
command. This function can be particularly useful when a matrix is assigned
to an indicial tensor using <code>components</code>, as demonstrated by the
following example:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(ctensor);
(%o1) /share/tensor/ctensor.mac
(%i2) load(itensor);
(%o2) /share/tensor/itensor.lisp
(%i3) lg:matrix([sqrt(r/(r-2*m)),0,0,0],[0,r,0,0],
[0,0,sin(theta)*r,0],[0,0,0,sqrt((r-2*m)/r)]);
[ r ]
[ sqrt(-------) 0 0 0 ]
[ r - 2 m ]
[ ]
[ 0 r 0 0 ]
(%o3) [ ]
[ 0 0 r sin(theta) 0 ]
[ ]
[ r - 2 m ]
[ 0 0 0 sqrt(-------) ]
[ r ]
(%i4) components(g([i,j],[]),lg);
(%o4) done
(%i5) showcomps(g([i,j],[]));
[ r ]
[ sqrt(-------) 0 0 0 ]
[ r - 2 m ]
[ ]
[ 0 r 0 0 ]
(%t5) g = [ ]
i j [ 0 0 r sin(theta) 0 ]
[ ]
[ r - 2 m ]
[ 0 0 0 sqrt(-------) ]
[ r ]
(%o5) false
</pre></td></tr></table>
<p>The <code>showcomps</code> command can also display components of a tensor of
rank higher than 2.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>idummy</b><i> ()</i>
<a name="IDX868"></a>
</dt>
<dd><p>Increments <code>icounter</code> and returns as its value an index of the form
<code>%n</code> where n is a positive integer. This guarantees that dummy indices
which are needed in forming expressions will not conflict with indices
already in use (see the example under <code>indices</code>).
</p>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>idummyx</b>
<a name="IDX869"></a>
</dt>
<dd><p>Default value: <code>%</code>
</p>
<p>Is the prefix for dummy indices (see the example under <code>indices</code>).
</p>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>icounter</b>
<a name="IDX870"></a>
</dt>
<dd><p>Default value: <code>1</code>
</p>
<p>Determines the numerical suffix to be used in
generating the next dummy index in the tensor package. The prefix is
determined by the option <code>idummy</code> (default: <code>%</code>).
</p></dd></dl>
<dl>
<dt><u>Function:</u> <b>kdelta</b><i> (<var>L1</var>, <var>L2</var>)</i>
<a name="IDX871"></a>
</dt>
<dd><p>is the generalized Kronecker delta function defined in
the <code>itensor</code> package with <var>L1</var> the list of covariant indices and <var>L2</var>
the list of contravariant indices. <code>kdelta([i],[j])</code> returns the ordinary
Kronecker delta. The command <code>ev(<var>expr</var>,kdelta)</code> causes the evaluation of
an expression containing <code>kdelta([],[])</code> to the dimension of the
manifold.
</p>
<p>In what amounts to an abuse of this notation, <code>itensor</code> also allows
<code>kdelta</code> to have 2 covariant and no contravariant, or 2 contravariant
and no covariant indices, in effect providing a co(ntra)variant "unit matrix"
capability. This is strictly considered a programming aid and not meant to
imply that <code>kdelta([i,j],[])</code> is a valid tensorial object.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>kdels</b><i> (<var>L1</var>, <var>L2</var>)</i>
<a name="IDX872"></a>
</dt>
<dd><p>Symmetricized Kronecker delta, used in some calculations. For instance:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) kdelta([1,2],[2,1]);
(%o2) - 1
(%i3) kdels([1,2],[2,1]);
(%o3) 1
(%i4) ishow(kdelta([a,b],[c,d]))$
c d d c
(%t4) kdelta kdelta - kdelta kdelta
a b a b
(%i4) ishow(kdels([a,b],[c,d]))$
c d d c
(%t4) kdelta kdelta + kdelta kdelta
a b a b
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>levi_civita</b><i> (<var>L</var>)</i>
<a name="IDX873"></a>
</dt>
<dd><p>is the permutation (or Levi-Civita) tensor which yields 1 if
the list <var>L</var> consists of an even permutation of integers, -1 if it
consists of an odd permutation, and 0 if some indices in <var>L</var> are
repeated.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>lc2kdt</b><i> (<var>expr</var>)</i>
<a name="IDX874"></a>
</dt>
<dd><p>Simplifies expressions containing the Levi-Civita symbol, converting these
to Kronecker-delta expressions when possible. The main difference between
this function and simply evaluating the Levi-Civita symbol is that direct
evaluation often results in Kronecker expressions containing numerical
indices. This is often undesirable as it prevents further simplification.
The <code>lc2kdt</code> function avoids this problem, yielding expressions that
are more easily simplified with <code>rename</code> or <code>contract</code>.
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) expr:ishow('levi_civita([],[i,j])*'levi_civita([k,l],[])*a([j],[k]))$
i j k
(%t2) levi_civita a levi_civita
j k l
(%i3) ishow(ev(expr,levi_civita))$
i j k 1 2
(%t3) kdelta a kdelta
1 2 j k l
(%i4) ishow(ev(%,kdelta))$
i j j i k
(%t4) (kdelta kdelta - kdelta kdelta ) a
1 2 1 2 j
1 2 2 1
(kdelta kdelta - kdelta kdelta )
k l k l
(%i5) ishow(lc2kdt(expr))$
k i j k j i
(%t5) a kdelta kdelta - a kdelta kdelta
j k l j k l
(%i6) ishow(contract(expand(%)))$
i i
(%t6) a - a kdelta
l l
</pre></td></tr></table>
<p>The <code>lc2kdt</code> function sometimes makes use of the metric tensor.
If the metric tensor was not defined previously with <code>imetric</code>,
this results in an error.
</p>
<table><tr><td> </td><td><pre class="example">
(%i7) expr:ishow('levi_civita([],[i,j])*'levi_civita([],[k,l])*a([j,k],[]))$
i j k l
(%t7) levi_civita levi_civita a
j k
(%i8) ishow(lc2kdt(expr))$
Maxima encountered a Lisp error:
Error in $IMETRIC [or a callee]:
$IMETRIC [or a callee] requires less than two arguments.
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
(%i9) imetric(g);
(%o9) done
(%i10) ishow(lc2kdt(expr))$
%3 i k %4 j l %3 i l %4 j k
(%t10) (g kdelta g kdelta - g kdelta g kdelta ) a
%3 %4 %3 %4 j k
(%i11) ishow(contract(expand(%)))$
l i l i
(%t11) a - a g
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>lc_l</b>
<a name="IDX875"></a>
</dt>
<dd><p>Simplification rule used for expressions containing the unevaluated Levi-Civita
symbol (<code>levi_civita</code>). Along with <code>lc_u</code>, it can be used to simplify
many expressions more efficiently than the evaluation of <code>levi_civita</code>.
For example:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) el1:ishow('levi_civita([i,j,k],[])*a([],[i])*a([],[j]))$
i j
(%t2) a a levi_civita
i j k
(%i3) el2:ishow('levi_civita([],[i,j,k])*a([i])*a([j]))$
i j k
(%t3) levi_civita a a
i j
(%i4) ishow(canform(contract(expand(applyb1(el1,lc_l,lc_u)))))$
(%t4) 0
(%i5) ishow(canform(contract(expand(applyb1(el2,lc_l,lc_u)))))$
(%t5) 0
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>lc_u</b>
<a name="IDX876"></a>
</dt>
<dd><p>Simplification rule used for expressions containing the unevaluated Levi-Civita
symbol (<code>levi_civita</code>). Along with <code>lc_u</code>, it can be used to simplify
many expressions more efficiently than the evaluation of <code>levi_civita</code>.
For details, see <code>lc_l</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>canten</b><i> (<var>expr</var>)</i>
<a name="IDX877"></a>
</dt>
<dd><p>Simplifies <var>expr</var> by renaming (see <code>rename</code>)
and permuting dummy indices. <code>rename</code> is restricted to sums of tensor
products in which no derivatives are present. As such it is limited
and should only be used if <code>canform</code> is not capable of carrying out the
required simplification.
</p>
<p>The <code>canten</code> function returns a mathematically correct result only
if its argument is an expression that is fully symmetric in its indices.
For this reason, <code>canten</code> returns an error if <code>allsym</code> is not
set to <code>true</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>concan</b><i> (<var>expr</var>)</i>
<a name="IDX878"></a>
</dt>
<dd><p>Similar to <code>canten</code> but also performs index contraction.
</p>
</dd></dl>
<hr size="6">
<a name="SEC99"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC98" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC100" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.2 Tensor symmetries </h3>
<dl>
<dt><u>Option variable:</u> <b>allsym</b>
<a name="IDX879"></a>
</dt>
<dd><p>Default: <code>false</code>. if <code>true</code> then all indexed objects
are assumed symmetric in all of their covariant and contravariant
indices. If <code>false</code> then no symmetries of any kind are assumed
in these indices. Derivative indices are always taken to be symmetric
unless <code>iframe_flag</code> is set to <code>true</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>decsym</b><i> (<var>tensor</var>, <var>m</var>, <var>n</var>, [<var>cov_1</var>, <var>cov_2</var>, ...], [<var>contr_1</var>, <var>contr_2</var>, ...])</i>
<a name="IDX880"></a>
</dt>
<dd><p>Declares symmetry properties for <var>tensor</var> of <var>m</var> covariant and
<var>n</var> contravariant indices. The <var>cov_i</var> and <var>contr_i</var> are
pseudofunctions expressing symmetry relations among the covariant and
contravariant indices respectively. These are of the form
<code>symoper(<var>index_1</var>, <var>index_2</var>,...)</code> where <code>symoper</code> is one of
<code>sym</code>, <code>anti</code> or <code>cyc</code> and the <var>index_i</var> are integers
indicating the position of the index in the <var>tensor</var>. This will
declare <var>tensor</var> to be symmetric, antisymmetric or cyclic respectively
in the <var>index_i</var>. <code>symoper(all)</code> is also an allowable form which
indicates all indices obey the symmetry condition. For example, given an
object <code>b</code> with 5 covariant indices,
<code>decsym(b,5,3,[sym(1,2),anti(3,4)],[cyc(all)])</code> declares <code>b</code>
symmetric in its first and second and antisymmetric in its third and
fourth covariant indices, and cyclic in all of its contravariant indices.
Either list of symmetry declarations may be null. The function which
performs the simplifications is <code>canform</code> as the example below
illustrates.
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) expr:contract(expand(a([i1,j1,k1],[])*kdels([i,j,k],[i1,j1,k1])))$
(%i3) ishow(expr)$
(%t3) a + a + a + a + a + a
k j i k i j j k i j i k i k j i j k
(%i4) decsym(a,3,0,[sym(all)],[]);
(%o4) done
(%i5) ishow(canform(expr))$
(%t5) 6 a
i j k
(%i6) remsym(a,3,0);
(%o6) done
(%i7) decsym(a,3,0,[anti(all)],[]);
(%o7) done
(%i8) ishow(canform(expr))$
(%t8) 0
(%i9) remsym(a,3,0);
(%o9) done
(%i10) decsym(a,3,0,[cyc(all)],[]);
(%o10) done
(%i11) ishow(canform(expr))$
(%t11) 3 a + 3 a
i k j i j k
(%i12) dispsym(a,3,0);
(%o12) [[cyc, [[1, 2, 3]], []]]
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>remsym</b><i> (<var>tensor</var>, <var>m</var>, <var>n</var>)</i>
<a name="IDX881"></a>
</dt>
<dd><p>Removes all symmetry properties from <var>tensor</var> which has <var>m</var>
covariant indices and <var>n</var> contravariant indices.
</p></dd></dl>
<dl>
<dt><u>Function:</u> <b>canform</b><i> (<var>expr</var>)</i>
<a name="IDX882"></a>
</dt>
<dd><p>Simplifies <var>expr</var> by renaming dummy
indices and reordering all indices as dictated by symmetry conditions
imposed on them. If <code>allsym</code> is <code>true</code> then all indices are assumed
symmetric, otherwise symmetry information provided by <code>decsym</code>
declarations will be used. The dummy indices are renamed in the same
manner as in the <code>rename</code> function. When <code>canform</code> is applied to a large
expression the calculation may take a considerable amount of time.
This time can be shortened by calling <code>rename</code> on the expression first.
Also see the example under <code>decsym</code>. Note: <code>canform</code> may not be able to
reduce an expression completely to its simplest form although it will
always return a mathematically correct result.
</p></dd></dl>
<hr size="6">
<a name="SEC100"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC99" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC101" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.3 Indicial tensor calculus </h3>
<dl>
<dt><u>Function:</u> <b>diff</b><i> (<var>expr</var>, <var>v_1</var>, [<var>n_1</var>, [<var>v_2</var>, <var>n_2</var>] ...])</i>
<a name="IDX883"></a>
</dt>
<dd><p>is the usual Maxima differentiation function which has been expanded
in its abilities for <code>itensor</code>. It takes the derivative of <var>expr</var> with
respect to <var>v_1</var> <var>n_1</var> times, with respect to <var>v_2</var> <var>n_2</var>
times, etc. For the tensor package, the function has been modified so
that the <var>v_i</var> may be integers from 1 up to the value of the variable
<code>dim</code>. This will cause the differentiation to be carried out with
respect to the <var>v_i</var>th member of the list <code>vect_coords</code>. If
<code>vect_coords</code> is bound to an atomic variable, then that variable
subscripted by <var>v_i</var> will be used for the variable of
differentiation. This permits an array of coordinate names or
subscripted names like <code>x[1]</code>, <code>x[2]</code>, ... to be used.
</p></dd></dl>
<dl>
<dt><u>Function:</u> <b>idiff</b><i> (<var>expr</var>, <var>v_1</var>, [<var>n_1</var>, [<var>v_2</var>, <var>n_2</var>] ...])</i>
<a name="IDX884"></a>
</dt>
<dd><p>Indicial differentiation. Unlike <code>diff</code>, which differentiates
with respect to an independent variable, <code>idiff)</code> can be used
to differentiate with respect to a coordinate. For an indexed object,
this amounts to appending the <var>v_i</var> as derivative indices.
Subsequently, derivative indices will be sorted, unless <code>iframe_flag</code>
is set to <code>true</code>.
</p>
<p><code>idiff</code> can also differentiate the determinant of the metric
tensor. Thus, if <code>imetric</code> has been bound to <code>G</code> then
<code>idiff(determinant(g),k)</code> will return
<code>2*determinant(g)*ichr2([%i,k],[%i])</code> where the dummy index <code>%i</code>
is chosen appropriately.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>liediff</b><i> (<var>v</var>, <var>ten</var>)</i>
<a name="IDX885"></a>
</dt>
<dd><p>Computes the Lie-derivative of the tensorial expression <var>ten</var> with
respect to the vector field <var>v</var>. <var>ten</var> should be any indexed
tensor expression; <var>v</var> should be the name (without indices) of a vector
field. For example:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(liediff(v,a([i,j],[])*b([],[k],l)))$
k %2 %2 %2
(%t2) b (v a + v a + v a )
,l i j,%2 ,j i %2 ,i %2 j
%1 k %1 k %1 k
+ (v b - b v + v b ) a
,%1 l ,l ,%1 ,l ,%1 i j
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>rediff</b><i> (<var>ten</var>)</i>
<a name="IDX886"></a>
</dt>
<dd><p>Evaluates all occurrences of the <code>idiff</code> command in the tensorial
expression <var>ten</var>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>undiff</b><i> (<var>expr</var>)</i>
<a name="IDX887"></a>
</dt>
<dd><p>Returns an expression equivalent to <var>expr</var> but with all derivatives
of indexed objects replaced by the noun form of the <code>idiff</code> function. Its
arguments would yield that indexed object if the differentiation were
carried out. This is useful when it is desired to replace a
differentiated indexed object with some function definition resulting
in <var>expr</var> and then carry out the differentiation by saying
<code>ev(<var>expr</var>, idiff)</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>evundiff</b><i> (<var>expr</var>)</i>
<a name="IDX888"></a>
</dt>
<dd><p>Equivalent to the execution of <code>undiff</code>, followed by <code>ev</code> and
<code>rediff</code>.
</p>
<p>The point of this operation is to easily evalute expressions that cannot
be directly evaluated in derivative form. For instance, the following
causes an error:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) icurvature([i,j,k],[l],m);
Maxima encountered a Lisp error:
Error in $ICURVATURE [or a callee]:
$ICURVATURE [or a callee] requires less than three arguments.
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
</pre></td></tr></table>
<p>However, if <code>icurvature</code> is entered in noun form, it can be evaluated
using <code>evundiff</code>:
</p>
<table><tr><td> </td><td><pre class="example">(%i3) ishow('icurvature([i,j,k],[l],m))$
l
(%t3) icurvature
i j k,m
(%i4) ishow(evundiff(%))$
l l %1 l %1
(%t4) - ichr2 - ichr2 ichr2 - ichr2 ichr2
i k,j m %1 j i k,m %1 j,m i k
l l %1 l %1
+ ichr2 + ichr2 ichr2 + ichr2 ichr2
i j,k m %1 k i j,m %1 k,m i j
</pre></td></tr></table>
<p>Note: In earlier versions of Maxima, derivative forms of the
Christoffel-symbols also could not be evaluated. This has been fixed now,
so <code>evundiff</code> is no longer necessary for expressions like this:
</p>
<table><tr><td> </td><td><pre class="example">(%i5) imetric(g);
(%o5) done
(%i6) ishow(ichr2([i,j],[k],l))$
k %3
g (g - g + g )
j %3,i l i j,%3 l i %3,j l
(%t6) -----------------------------------------
2
k %3
g (g - g + g )
,l j %3,i i j,%3 i %3,j
+ -----------------------------------
2
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>flush</b><i> (<var>expr</var>, <var>tensor_1</var>, <var>tensor_2</var>, ...)</i>
<a name="IDX889"></a>
</dt>
<dd><p>Set to zero, in
<var>expr</var>, all occurrences of the <var>tensor_i</var> that have no derivative indices.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>flushd</b><i> (<var>expr</var>, <var>tensor_1</var>, <var>tensor_2</var>, ...)</i>
<a name="IDX890"></a>
</dt>
<dd><p>Set to zero, in
<var>expr</var>, all occurrences of the <var>tensor_i</var> that have derivative indices.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>flushnd</b><i> (<var>expr</var>, <var>tensor</var>, <var>n</var>)</i>
<a name="IDX891"></a>
</dt>
<dd><p>Set to zero, in <var>expr</var>, all
occurrences of the differentiated object <var>tensor</var> that have <var>n</var> or more
derivative indices as the following example demonstrates.
</p><table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(a([i],[J,r],k,r)+a([i],[j,r,s],k,r,s))$
J r j r s
(%t2) a + a
i,k r i,k r s
(%i3) ishow(flushnd(%,a,3))$
J r
(%t3) a
i,k r
</pre></td></tr></table></dd></dl>
<dl>
<dt><u>Function:</u> <b>coord</b><i> (<var>tensor_1</var>, <var>tensor_2</var>, ...)</i>
<a name="IDX892"></a>
</dt>
<dd><p>Gives <var>tensor_i</var> the coordinate differentiation property that the
derivative of contravariant vector whose name is one of the
<var>tensor_i</var> yields a Kronecker delta. For example, if <code>coord(x)</code> has
been done then <code>idiff(x([],[i]),j)</code> gives <code>kdelta([i],[j])</code>.
<code>coord</code> is a list of all indexed objects having this property.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>remcoord</b><i> (<var>tensor_1</var>, <var>tensor_2</var>, ...)</i>
<a name="IDX893"></a>
</dt>
<dt><u>Function:</u> <b>remcoord</b><i> (all)</i>
<a name="IDX894"></a>
</dt>
<dd><p>Removes the coordinate differentiation property from the <code>tensor_i</code>
that was established by the function <code>coord</code>. <code>remcoord(all)</code>
removes this property from all indexed objects.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>makebox</b><i> (<var>expr</var>)</i>
<a name="IDX895"></a>
</dt>
<dd><p>Display <var>expr</var> in the same manner as <code>show</code>; however,
any tensor d'Alembertian occurring in <var>expr</var> will be indicated using the
symbol <code>[]</code>. For example, <code>[]p([m],[n])</code> represents
<code>g([],[i,j])*p([m],[n],i,j)</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>conmetderiv</b><i> (<var>expr</var>, <var>tensor</var>)</i>
<a name="IDX896"></a>
</dt>
<dd><p>Simplifies expressions containing ordinary derivatives of
both covariant and contravariant forms of the metric tensor (the
current restriction). For example, <code>conmetderiv</code> can relate the
derivative of the contravariant metric tensor with the Christoffel
symbols as seen from the following:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(g([],[a,b],c))$
a b
(%t2) g
,c
(%i3) ishow(conmetderiv(%,g))$
%1 b a %1 a b
(%t3) - g ichr2 - g ichr2
%1 c %1 c
</pre></td></tr></table></dd></dl>
<dl>
<dt><u>Function:</u> <b>simpmetderiv</b><i> (<var>expr</var>)</i>
<a name="IDX897"></a>
</dt>
<dt><u>Function:</u> <b>simpmetderiv</b><i> (<var>expr</var>[, <var>stop</var>])</i>
<a name="IDX898"></a>
</dt>
<dd><p>Simplifies expressions containing products of the derivatives of the
metric tensor. Specifically, <code>simpmetderiv</code> recognizes two identities:
</p>
<table><tr><td> </td><td><pre class="example">
ab ab ab a
g g + g g = (g g ) = (kdelta ) = 0
,d bc bc,d bc ,d c ,d
</pre></td></tr></table>
<p>hence
</p>
<table><tr><td> </td><td><pre class="example">
ab ab
g g = - g g
,d bc bc,d
</pre></td></tr></table>
<p>and
</p>
<table><tr><td> </td><td><pre class="example">
ab ab
g g = g g
,j ab,i ,i ab,j
</pre></td></tr></table>
<p>which follows from the symmetries of the Christoffel symbols.
</p>
<p>The <code>simpmetderiv</code> function takes one optional parameter which, when
present, causes the function to stop after the first successful
substitution in a product expression. The <code>simpmetderiv</code> function
also makes use of the global variable <var>flipflag</var> which determines
how to apply a "canonical" ordering to the product indices.
</p>
<p>Put together, these capabilities can be used to achieve powerful
simplifications that are difficult or impossible to accomplish otherwise.
This is demonstrated through the following example that explicitly uses the
partial simplification features of <code>simpmetderiv</code> to obtain a
contractible expression:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) imetric(g);
(%o2) done
(%i3) ishow(g([],[a,b])*g([],[b,c])*g([a,b],[],d)*g([b,c],[],e))$
a b b c
(%t3) g g g g
a b,d b c,e
(%i4) ishow(canform(%))$
errexp1 has improper indices
-- an error. Quitting. To debug this try debugmode(true);
(%i5) ishow(simpmetderiv(%))$
a b b c
(%t5) g g g g
a b,d b c,e
(%i6) flipflag:not flipflag;
(%o6) true
(%i7) ishow(simpmetderiv(%th(2)))$
a b b c
(%t7) g g g g
,d ,e a b b c
(%i8) flipflag:not flipflag;
(%o8) false
(%i9) ishow(simpmetderiv(%th(2),stop))$
a b b c
(%t9) - g g g g
,e a b,d b c
(%i10) ishow(contract(%))$
b c
(%t10) - g g
,e c b,d
</pre></td></tr></table>
<p>See also <code>weyl.dem</code> for an example that uses <code>simpmetderiv</code>
and <code>conmetderiv</code> together to simplify contractions of the Weyl tensor.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>flush1deriv</b><i> (<var>expr</var>, <var>tensor</var>)</i>
<a name="IDX899"></a>
</dt>
<dd><p>Set to zero, in <code>expr</code>, all occurrences of <code>tensor</code> that have
exactly one derivative index.
</p>
</dd></dl>
<hr size="6">
<a name="SEC101"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC100" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC102" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.4 Tensors in curved spaces </h3>
<dl>
<dt><u>Function:</u> <b>imetric</b><i> (<var>g</var>)</i>
<a name="IDX900"></a>
</dt>
<dt><u>System variable:</u> <b>imetric</b>
<a name="IDX901"></a>
</dt>
<dd><p>Specifies the metric by assigning the variable <code>imetric:<var>g</var></code> in
addition, the contraction properties of the metric <var>g</var> are set up by
executing the commands <code>defcon(<var>g</var>),defcon(<var>g</var>,<var>g</var>,kdelta)</code>.
The variable <code>imetric</code> (unbound by default), is bound to the metric, assigned by
the <code>imetric(<var>g</var>)</code> command.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>idim</b><i> (<var>n</var>)</i>
<a name="IDX902"></a>
</dt>
<dd><p>Sets the dimensions of the metric. Also initializes the antisymmetry
properties of the Levi-Civita symbols for the given dimension.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>ichr1</b><i> ([<var>i</var>, <var>j</var>, <var>k</var>])</i>
<a name="IDX903"></a>
</dt>
<dd><p>Yields the Christoffel symbol of the first kind via the
definition
</p><table><tr><td> </td><td><pre class="example"> (g + g - g )/2 .
ik,j jk,i ij,k
</pre></td></tr></table>
<p>To evaluate the Christoffel symbols for a particular metric, the
variable <code>imetric</code> must be assigned a name as in the example under <code>chr2</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>ichr2</b><i> ([<var>i</var>, <var>j</var>], [<var>k</var>])</i>
<a name="IDX904"></a>
</dt>
<dd><p>Yields the Christoffel symbol of the second kind
defined by the relation
</p><table><tr><td> </td><td><pre class="example"> ks
ichr2([i,j],[k]) = g (g + g - g )/2
is,j js,i ij,s
</pre></td></tr></table></dd></dl>
<dl>
<dt><u>Function:</u> <b>icurvature</b><i> ([<var>i</var>, <var>j</var>, <var>k</var>], [<var>h</var>])</i>
<a name="IDX905"></a>
</dt>
<dd><p>Yields the Riemann
curvature tensor in terms of the Christoffel symbols of the second
kind (<code>ichr2</code>). The following notation is used:
</p><table><tr><td> </td><td><pre class="example"> h h h %1 h
icurvature = - ichr2 - ichr2 ichr2 + ichr2
i j k i k,j %1 j i k i j,k
h %1
+ ichr2 ichr2
%1 k i j
</pre></td></tr></table></dd></dl>
<dl>
<dt><u>Function:</u> <b>covdiff</b><i> (<var>expr</var>, <var>v_1</var>, <var>v_2</var>, ...)</i>
<a name="IDX906"></a>
</dt>
<dd><p>Yields the covariant derivative of <var>expr</var> with
respect to the variables <var>v_i</var> in terms of the Christoffel symbols of the
second kind (<code>ichr2</code>). In order to evaluate these, one should use
<code>ev(<var>expr</var>,ichr2)</code>.
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) entertensor()$
Enter tensor name: a;
Enter a list of the covariant indices: [i,j];
Enter a list of the contravariant indices: [k];
Enter a list of the derivative indices: [];
k
(%t2) a
i j
(%i3) ishow(covdiff(%,s))$
k %1 k %1 k k %1
(%t3) - a ichr2 - a ichr2 + a + ichr2 a
i %1 j s %1 j i s i j,s %1 s i j
(%i4) imetric:g;
(%o4) g
(%i5) ishow(ev(%th(2),ichr2))$
%1 %4 k
g a (g - g + g )
i %1 s %4,j j s,%4 j %4,s
(%t5) - ------------------------------------------
2
%1 %3 k
g a (g - g + g )
%1 j s %3,i i s,%3 i %3,s
- ------------------------------------------
2
k %2 %1
g a (g - g + g )
i j s %2,%1 %1 s,%2 %1 %2,s k
+ ------------------------------------------- + a
2 i j,s
(%i6)
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>lorentz_gauge</b><i> (<var>expr</var>)</i>
<a name="IDX907"></a>
</dt>
<dd><p>Imposes the Lorentz condition by substituting 0 for all
indexed objects in <var>expr</var> that have a derivative index identical to a
contravariant index.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>igeodesic_coords</b><i> (<var>expr</var>, <var>name</var>)</i>
<a name="IDX908"></a>
</dt>
<dd><p>Causes undifferentiated Christoffel symbols and
first derivatives of the metric tensor vanish in <var>expr</var>. The <var>name</var>
in the <code>igeodesic_coords</code> function refers to the metric <var>name</var>
(if it appears in <var>expr</var>) while the connection coefficients must be
called with the names <code>ichr1</code> and/or <code>ichr2</code>. The following example
demonstrates the verification of the cyclic identity satisfied by the Riemann
curvature tensor using the <code>igeodesic_coords</code> function.
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(icurvature([r,s,t],[u]))$
u u %1 u u %1
(%t2) - ichr2 - ichr2 ichr2 + ichr2 + ichr2 ichr2
r t,s %1 s r t r s,t %1 t r s
(%i3) ishow(igeodesic_coords(%,ichr2))$
u u
(%t3) ichr2 - ichr2
r s,t r t,s
(%i4) ishow(igeodesic_coords(icurvature([r,s,t],[u]),ichr2)+
igeodesic_coords(icurvature([s,t,r],[u]),ichr2)+
igeodesic_coords(icurvature([t,r,s],[u]),ichr2))$
u u u u u
(%t4) - ichr2 + ichr2 + ichr2 - ichr2 - ichr2
t s,r t r,s s t,r s r,t r t,s
u
+ ichr2
r s,t
(%i5) canform(%);
(%o5) 0
</pre></td></tr></table>
</dd></dl>
<hr size="6">
<a name="SEC102"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC101" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC103" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.5 Moving frames </h3>
<p>Maxima now has the ability to perform calculations using moving frames.
These can be orthonormal frames (tetrads, vielbeins) or an arbitrary frame.
</p>
<p>To use frames, you must first set <code>iframe_flag</code> to <code>true</code>. This
causes the Christoffel-symbols, <code>ichr1</code> and <code>ichr2</code>, to be replaced
by the more general frame connection coefficients <code>icc1</code> and <code>icc2</code>
in calculations. Speficially, the behavior of <code>covdiff</code> and
<code>icurvature</code> is changed.
</p>
<p>The frame is defined by two tensors: the inverse frame field (<code>ifri</code>,
the dual basis tetrad),
and the frame metric <code>ifg</code>. The frame metric is the identity matrix for
orthonormal frames, or the Lorentz metric for orthonormal frames in Minkowski
spacetime. The inverse frame field defines the frame base (unit vectors).
Contraction properties are defined for the frame field and the frame metric.
</p>
<p>When <code>iframe_flag</code> is true, many <code>itensor</code> expressions use the frame
metric <code>ifg</code> instead of the metric defined by <code>imetric</code> for
raising and lowerind indices.
</p>
<p>IMPORTANT: Setting the variable <code>iframe_flag</code> to <code>true</code> does NOT
undefine the contraction properties of a metric defined by a call to
<code>defcon</code> or <code>imetric</code>. If a frame field is used, it is best to
define the metric by assigning its name to the variable <code>imetric</code>
and NOT invoke the <code>imetric</code> function.
</p>
<p>Maxima uses these two tensors to define the frame coefficients (<code>ifc1</code>
and <code>ifc2</code>) which form part of the connection coefficients (<code>icc1</code>
and <code>icc2</code>), as the following example demonstrates:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) iframe_flag:true;
(%o2) true
(%i3) ishow(covdiff(v([],[i]),j))$
i i %1
(%t3) v + icc2 v
,j %1 j
(%i4) ishow(ev(%,icc2))$
%1 i i i
(%t4) v (ifc2 + ichr2 ) + v
%1 j %1 j ,j
(%i5) ishow(ev(%,ifc2))$
%1 i %2
v ifg (ifb - ifb + ifb )
j %2 %1 %2 %1 j %1 j %2 i
(%t5) -------------------------------------------------- + v
2 ,j
(%i6) ishow(ifb([a,b,c]))$
%5 %4
(%t6) ifr ifr (ifri - ifri )
a b c %4,%5 c %5,%4
</pre></td></tr></table>
<p>An alternate method is used to compute the frame bracket (<code>ifb</code>) if
the <code>iframe_bracket_form</code> flag is set to <code>false</code>:
</p>
<table><tr><td> </td><td><pre class="example">
(%i8) block([iframe_bracket_form:false],ishow(ifb([a,b,c])))$
%7 %6 %6 %7
(%t8) (ifr ifr - ifr ifr ) ifri
a b,%7 a,%7 b c %6
</pre></td></tr></table>
<dl>
<dt><u>Function:</u> <b>iframes</b><i> ()</i>
<a name="IDX909"></a>
</dt>
<dd><p>Since in this version of Maxima, contraction identities for <code>ifr</code> and
<code>ifri</code> are always defined, as is the frame bracket (<code>ifb</code>), this
function does nothing.
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifb</b>
<a name="IDX910"></a>
</dt>
<dd><p>The frame bracket. The contribution of the frame metric to the connection
coefficients is expressed using the frame bracket:
</p>
<table><tr><td> </td><td><pre class="example">
- ifb + ifb + ifb
c a b b c a a b c
ifc1 = --------------------------------
abc 2
</pre></td></tr></table>
<p>The frame bracket itself is defined in terms of the frame field and frame
metric. Two alternate methods of computation are used depending on the
value of <code>frame_bracket_form</code>. If true (the default) or if the
<code>itorsion_flag</code> is <code>true</code>:
</p>
<table><tr><td> </td><td><pre class="example">
d e f
ifb = ifr ifr (ifri - ifri - ifri itr )
abc b c a d,e a e,d a f d e
</pre></td></tr></table>
<p>Otherwise:
</p>
<table><tr><td> </td><td><pre class="example">
e d d e
ifb = (ifr ifr - ifr ifr ) ifri
abc b c,e b,e c a d
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>icc1</b>
<a name="IDX911"></a>
</dt>
<dd><p>Connection coefficients of the first kind. In <code>itensor</code>, defined as
</p>
<table><tr><td> </td><td><pre class="example">
icc1 = ichr1 - ikt1 - inmc1
abc abc abc abc
</pre></td></tr></table>
<p>In this expression, if <code>iframe_flag</code> is true, the Christoffel-symbol
<code>ichr1</code> is replaced with the frame connection coefficient <code>ifc1</code>.
If <code>itorsion_flag</code> is <code>false</code>, <code>ikt1</code>
will be omitted. It is also omitted if a frame base is used, as the
torsion is already calculated as part of the frame bracket.
Lastly, of <code>inonmet_flag</code> is <code>false</code>,
<code>inmc1</code> will not be present.
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>icc2</b>
<a name="IDX912"></a>
</dt>
<dd><p>Connection coefficients of the second kind. In <code>itensor</code>, defined as
</p>
<table><tr><td> </td><td><pre class="example">
c c c c
icc2 = ichr2 - ikt2 - inmc2
ab ab ab ab
</pre></td></tr></table>
<p>In this expression, if <code>iframe_flag</code> is true, the Christoffel-symbol
<code>ichr2</code> is replaced with the frame connection coefficient <code>ifc2</code>.
If <code>itorsion_flag</code> is <code>false</code>, <code>ikt2</code>
will be omitted. It is also omitted if a frame base is used, as the
torsion is already calculated as part of the frame bracket.
Lastly, of <code>inonmet_flag</code> is <code>false</code>,
<code>inmc2</code> will not be present.
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifc1</b>
<a name="IDX913"></a>
</dt>
<dd><p>Frame coefficient of the first kind (also known as Ricci-rotation
coefficients.) This tensor represents the contribution
of the frame metric to the connection coefficient of the first kind. Defined
as:
</p>
<table><tr><td> </td><td><pre class="example">
- ifb + ifb + ifb
c a b b c a a b c
ifc1 = --------------------------------
abc 2
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifc2</b>
<a name="IDX914"></a>
</dt>
<dd><p>Frame coefficient of the first kind. This tensor represents the contribution
of the frame metric to the connection coefficient of the first kind. Defined
as a permutation of the frame bracket (<code>ifb</code>) with the appropriate
indices raised and lowered as necessary:
</p>
<table><tr><td> </td><td><pre class="example">
c cd
ifc2 = ifg ifc1
ab abd
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifr</b>
<a name="IDX915"></a>
</dt>
<dd><p>The frame field. Contracts with the inverse frame field (<code>ifri</code>) to
form the frame metric (<code>ifg</code>).
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifri</b>
<a name="IDX916"></a>
</dt>
<dd><p>The inverse frame field. Specifies the frame base (dual basis vectors). Along
with the frame metric, it forms the basis of all calculations based on
frames.
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifg</b>
<a name="IDX917"></a>
</dt>
<dd><p>The frame metric. Defaults to <code>kdelta</code>, but can be changed using
<code>components</code>.
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ifgi</b>
<a name="IDX918"></a>
</dt>
<dd><p>The inverse frame metric. Contracts with the frame metric (<code>ifg</code>)
to <code>kdelta</code>.
</p>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>iframe_bracket_form</b>
<a name="IDX919"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>Specifies how the frame bracket (<code>ifb</code>) is computed.
</p>
</dd></dl>
<hr size="6">
<a name="SEC103"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC102" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC104" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.6 Torsion and nonmetricity </h3>
<p>Maxima can now take into account torsion and nonmetricity. When the flag
<code>itorsion_flag</code> is set to <code>true</code>, the contribution of torsion
is added to the connection coefficients. Similarly, when the flag
<code>inonmet_flag</code> is true, nonmetricity components are included.
</p>
<dl>
<dt><u>Variable:</u> <b>inm</b>
<a name="IDX920"></a>
</dt>
<dd><p>The nonmetricity vector. Conformal nonmetricity is defined through the
covariant derivative of the metric tensor. Normally zero, the metric
tensor's covariant derivative will evaluate to the following when
<code>inonmet_flag</code> is set to <code>true</code>:
</p>
<table><tr><td> </td><td><pre class="example">
g =- g inm
ij;k ij k
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>inmc1</b>
<a name="IDX921"></a>
</dt>
<dd><p>Covariant permutation of the nonmetricity vector components. Defined as
</p>
<table><tr><td> </td><td><pre class="example">
g inm - inm g - g inm
ab c a bc ac b
inmc1 = ------------------------------
abc 2
</pre></td></tr></table>
<p>(Substitute <code>ifg</code> in place of <code>g</code> if a frame metric is used.)
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>inmc2</b>
<a name="IDX922"></a>
</dt>
<dd><p>Contravariant permutation of the nonmetricity vector components. Used
in the connection coefficients if <code>inonmet_flag</code> is <code>true</code>. Defined
as:
</p>
<table><tr><td> </td><td><pre class="example">
c c cd
-inm kdelta - kdelta inm + g inm g
c a b a b d ab
inmc2 = -------------------------------------------
ab 2
</pre></td></tr></table>
<p>(Substitute <code>ifg</code> in place of <code>g</code> if a frame metric is used.)
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ikt1</b>
<a name="IDX923"></a>
</dt>
<dd><p>Covariant permutation of the torsion tensor (also known as contorsion).
Defined as:
</p>
<table><tr><td> </td><td><pre class="example">
d d d
-g itr - g itr - itr g
ad cb bd ca ab cd
ikt1 = ----------------------------------
abc 2
</pre></td></tr></table>
<p>(Substitute <code>ifg</code> in place of <code>g</code> if a frame metric is used.)
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>ikt2</b>
<a name="IDX924"></a>
</dt>
<dd><p>Contravariant permutation of the torsion tensor (also known as contorsion).
Defined as:
</p>
<table><tr><td> </td><td><pre class="example">
c cd
ikt2 = g ikt1
ab abd
</pre></td></tr></table>
<p>(Substitute <code>ifg</code> in place of <code>g</code> if a frame metric is used.)
</p>
</dd></dl>
<dl>
<dt><u>Variable:</u> <b>itr</b>
<a name="IDX925"></a>
</dt>
<dd><p>The torsion tensor. For a metric with torsion, repeated covariant
differentiation on a scalar function will not commute, as demonstrated
by the following example:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) imetric:g;
(%o2) g
(%i3) covdiff(covdiff(f([],[]),i),j)-covdiff(covdiff(f([],[]),j),i)$
(%i4) ishow(%)$
%4 %2
(%t4) f ichr2 - f ichr2
,%4 j i ,%2 i j
(%i5) canform(%);
(%o5) 0
(%i6) itorsion_flag:true;
(%o6) true
(%i7) covdiff(covdiff(f([],[]),i),j)-covdiff(covdiff(f([],[]),j),i)$
(%i8) ishow(%)$
%8 %6
(%t8) f icc2 - f icc2 - f + f
,%8 j i ,%6 i j ,j i ,i j
(%i9) ishow(canform(%))$
%1 %1
(%t9) f icc2 - f icc2
,%1 j i ,%1 i j
(%i10) ishow(canform(ev(%,icc2)))$
%1 %1
(%t10) f ikt2 - f ikt2
,%1 i j ,%1 j i
(%i11) ishow(canform(ev(%,ikt2)))$
%2 %1 %2 %1
(%t11) f g ikt1 - f g ikt1
,%2 i j %1 ,%2 j i %1
(%i12) ishow(factor(canform(rename(expand(ev(%,ikt1))))))$
%3 %2 %1 %1
f g g (itr - itr )
,%3 %2 %1 j i i j
(%t12) ------------------------------------
2
(%i13) decsym(itr,2,1,[anti(all)],[]);
(%o13) done
(%i14) defcon(g,g,kdelta);
(%o14) done
(%i15) subst(g,nounify(g),%th(3))$
(%i16) ishow(canform(contract(%)))$
%1
(%t16) - f itr
,%1 i j
</pre></td></tr></table>
</dd></dl>
<hr size="6">
<a name="SEC104"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC103" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC105" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.7 Exterior algebra </h3>
<p>The <code>itensor</code> package can perform operations on totally antisymmetric
covariant tensor fields. A totally antisymmetric tensor field of rank
(0,L) corresponds with a differential L-form. On these objects, a
multiplication operation known as the exterior product, or wedge product,
is defined.
</p>
<p>Unfortunately, not all authors agree on the definition of the wedge
product. Some authors prefer a definition that corresponds with the
notion of antisymmetrization: in these works, the wedge product of
two vector fields, for instance, would be defined as
</p>
<table><tr><td> </td><td><pre class="example"> a a - a a
i j j i
a /\ a = -----------
i j 2
</pre></td></tr></table>
<p>More generally, the product of a p-form and a q-form would be defined as
</p>
<table><tr><td> </td><td><pre class="example"> 1 k1..kp l1..lq
A /\ B = ------ D A B
i1..ip j1..jq (p+q)! i1..ip j1..jq k1..kp l1..lq
</pre></td></tr></table>
<p>where <code>D</code> stands for the Kronecker-delta.
</p>
<p>Other authors, however, prefer a "geometric" definition that corresponds
with the notion of the volume element:
</p>
<table><tr><td> </td><td><pre class="example">a /\ a = a a - a a
i j i j j i
</pre></td></tr></table>
<p>and, in the general case
</p>
<table><tr><td> </td><td><pre class="example"> 1 k1..kp l1..lq
A /\ B = ----- D A B
i1..ip j1..jq p! q! i1..ip j1..jq k1..kp l1..lq
</pre></td></tr></table>
<p>Since <code>itensor</code> is a tensor algebra package, the first of these two
definitions appears to be the more natural one. Many applications, however,
utilize the second definition. To resolve this dilemma, a flag has been
implemented that controls the behavior of the wedge product: if
<code>igeowedge_flag</code> is <code>false</code> (the default), the first, "tensorial"
definition is used, otherwise the second, "geometric" definition will
be applied.
</p>
<dl>
<dt><u>Operator:</u> <b>~</b>
<a name="IDX926"></a>
</dt>
<dd><p>The wedge product operator is denoted by the tilde <code>~</code>. This is
a binary operator. Its arguments should be expressions involving scalars,
covariant tensors of rank one, or covariant tensors of rank <code>l</code> that
have been declared antisymmetric in all covariant indices.
</p>
<p>The behavior of the wedge product operator is controlled by the
<code>igeowedge_flag</code> flag, as in the following example:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(a([i])~b([j]))$
a b - b a
i j i j
(%t2) -------------
2
(%i3) decsym(a,2,0,[anti(all)],[]);
(%o3) done
(%i4) ishow(a([i,j])~b([k]))$
a b + b a - a b
i j k i j k i k j
(%t4) ---------------------------
3
(%i5) igeowedge_flag:true;
(%o5) true
(%i6) ishow(a([i])~b([j]))$
(%t6) a b - b a
i j i j
(%i7) ishow(a([i,j])~b([k]))$
(%t7) a b + b a - a b
i j k i j k i k j
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Operator:</u> <b>|</b>
<a name="IDX927"></a>
</dt>
<dd><p>The vertical bar <code>|</code> denotes the "contraction with a vector" binary
operation. When a totally antisymmetric covariant tensor is contracted
with a contravariant vector, the result is the same regardless which index
was used for the contraction. Thus, it is possible to define the
contraction operation in an index-free manner.
</p>
<p>In the <code>itensor</code> package, contraction with a vector is always carried out
with respect to the first index in the literal sorting order. This ensures
better simplification of expressions involving the <code>|</code> operator. For instance:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) decsym(a,2,0,[anti(all)],[]);
(%o2) done
(%i3) ishow(a([i,j],[])|v)$
%1
(%t3) v a
%1 j
(%i4) ishow(a([j,i],[])|v)$
%1
(%t4) - v a
%1 j
</pre></td></tr></table>
<p>Note that it is essential that the tensors used with the <code>|</code> operator be
declared totally antisymmetric in their covariant indices. Otherwise,
the results will be incorrect.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>extdiff</b><i> (<var>expr</var>, <var>i</var>)</i>
<a name="IDX928"></a>
</dt>
<dd><p>Computes the exterior derivative of <var>expr</var> with respect to the index
<var>i</var>. The exterior derivative is formally defined as the wedge
product of the partial derivative operator and a differential form. As
such, this operation is also controlled by the setting of <code>igeowedge_flag</code>.
For instance:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) ishow(extdiff(v([i]),j))$
v - v
j,i i,j
(%t2) -----------
2
(%i3) decsym(a,2,0,[anti(all)],[]);
(%o3) done
(%i4) ishow(extdiff(a([i,j]),k))$
a - a + a
j k,i i k,j i j,k
(%t4) ------------------------
3
(%i5) igeowedge_flag:true;
(%o5) true
(%i6) ishow(extdiff(v([i]),j))$
(%t6) v - v
j,i i,j
(%i7) ishow(extdiff(a([i,j]),k))$
(%t7) a - a + a
j k,i i k,j i j,k
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>hodge</b><i> (<var>expr</var>)</i>
<a name="IDX929"></a>
</dt>
<dd><p>Compute the Hodge-dual of <var>expr</var>. For instance:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) imetric(g);
(%o2) done
(%i3) idim(4);
(%o3) done
(%i4) icounter:100;
(%o4) 100
(%i5) decsym(A,3,0,[anti(all)],[])$
(%i6) ishow(A([i,j,k],[]))$
(%t6) A
i j k
(%i7) ishow(canform(hodge(%)))$
%1 %2 %3 %4
levi_civita g A
%1 %102 %2 %3 %4
(%t7) -----------------------------------------
6
(%i8) ishow(canform(hodge(%)))$
%1 %2 %3 %8 %4 %5 %6 %7
(%t8) levi_civita levi_civita g g
%1 %106 %2 %107
g g A /6
%3 %108 %4 %8 %5 %6 %7
(%i9) lc2kdt(%)$
(%i10) %,kdelta$
(%i11) ishow(canform(contract(expand(%))))$
(%t11) - A
%106 %107 %108
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>igeowedge_flag</b>
<a name="IDX930"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>Controls the behavior of the wedge product and exterior derivative. When
set to <code>false</code> (the default), the notion of differential forms will
correspond with that of a totally antisymmetric covariant tensor field.
When set to <code>true</code>, differential forms will agree with the notion
of the volume element.
</p>
</dd></dl>
<hr size="6">
<a name="SEC105"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC104" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC106" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.8 Exporting TeX expressions </h3>
<p>The <code>itensor</code> package provides limited support for exporting tensor
expressions to TeX. Since <code>itensor</code> expressions appear as function calls,
the regular Maxima <code>tex</code> command will not produce the expected
output. You can try instead the <code>tentex</code> command, which attempts
to translate tensor expressions into appropriately indexed TeX objects.
</p>
<dl>
<dt><u>Function:</u> <b>tentex</b><i> (<var>expr</var>)</i>
<a name="IDX931"></a>
</dt>
<dd><p>To use the <code>tentex</code> function, you must first load <code>tentex</code>,
as in the following example:
</p>
<table><tr><td> </td><td><pre class="example">
(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) load(tentex);
(%o2) /share/tensor/tentex.lisp
(%i3) idummyx:m;
(%o3) m
(%i4) ishow(icurvature([j,k,l],[i]))$
m1 i m1 i i i
(%t4) ichr2 ichr2 - ichr2 ichr2 - ichr2 + ichr2
j k m1 l j l m1 k j l,k j k,l
(%i5) tentex(%)$
$$\Gamma_{j\,k}^{m_1}\,\Gamma_{l\,m_1}^{i}-\Gamma_{j\,l}^{m_1}\,
\Gamma_{k\,m_1}^{i}-\Gamma_{j\,l,k}^{i}+\Gamma_{j\,k,l}^{i}$$
</pre></td></tr></table>
<p>Note the use of the <code>idummyx</code> assignment, to avoid the appearance
of the percent sign in the TeX expression, which may lead to compile errors.
</p>
<p>NB: This version of the <code>tentex</code> function is somewhat experimental.
</p>
</dd></dl>
<hr size="6">
<a name="SEC106"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC105" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC107" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.9 Interfacing with ctensor </h3>
<p>The <code>itensor</code> package has the ability to generate Maxima code that can
then be executed in the context of the <code>ctensor</code> package. The function that performs
this task is <code>ic_convert</code>.
</p>
<dl>
<dt><u>Function:</u> <b>ic_convert</b><i> (<var>eqn</var>)</i>
<a name="IDX932"></a>
</dt>
<dd><p>Converts the <code>itensor</code> equation <var>eqn</var> to a <code>ctensor</code> assignment statement.
Implied sums over dummy indices are made explicit while indexed
objects are transformed into arrays (the array subscripts are in the
order of covariant followed by contravariant indices of the indexed
objects). The derivative of an indexed object will be replaced by the
noun form of <code>diff</code> taken with respect to <code>ct_coords</code> subscripted
by the derivative index. The Christoffel symbols <code>ichr1</code> and <code>ichr2</code>
will be translated to <code>lcs</code> and <code>mcs</code>, respectively and if
<code>metricconvert</code> is <code>true</code> then all occurrences of the metric
with two covariant (contravariant) indices will be renamed to <code>lg</code>
(<code>ug</code>). In addition, <code>do</code> loops will be introduced summing over
all free indices so that the
transformed assignment statement can be evaluated by just doing
<code>ev</code>. The following examples demonstrate the features of this
function.
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load(itensor);
(%o1) /share/tensor/itensor.lisp
(%i2) eqn:ishow(t([i,j],[k])=f([],[])*g([l,m],[])*a([],[m],j)*b([i],[l,k]))$
k m l k
(%t2) t = f a b g
i j ,j i l m
(%i3) ic_convert(eqn);
(%o3) for i thru dim do (for j thru dim
do (for k thru dim do t : f sum(sum(diff(a , ct_coords ) b
i, j, k m j i, l, k
g , l, 1, dim), m, 1, dim)))
l, m
(%i4) imetric(g);
(%o4) done
(%i5) metricconvert:true;
(%o5) true
(%i6) ic_convert(eqn);
(%o6) for i thru dim do (for j thru dim
do (for k thru dim do t : f sum(sum(diff(a , ct_coords ) b
i, j, k m j i, l, k
lg , l, 1, dim), m, 1, dim)))
l, m
</pre></td></tr></table>
</dd></dl>
<hr size="6">
<a name="SEC107"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC106" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC97" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 28.2.10 Reserved words </h3>
<p>The following Maxima words are used by the <code>itensor</code> package internally and
should not be redefined:
</p>
<table><tr><td> </td><td><pre class="example"> Keyword Comments
------------------------------------------
indices2() Internal version of indices()
conti Lists contravariant indices
covi Lists covariant indices of a indexed object
deri Lists derivative indices of an indexed object
name Returns the name of an indexed object
concan
irpmon
lc0
_lc2kdt0
_lcprod
_extlc
</pre></td></tr></table>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC93" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima_29.html#SEC108" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>Robert Dodier</em> on <em>September, 20 2006</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
</font>
<br>
</p>
</body>
</html>
|