Datasets:
Download benchmarks/tutorial/tutorial_test_v2.jsonl from rakab/FORM-bench: direct link, hf CLI and curl.
- Browser
- Download file 75.6 kB
-
https://huggingface.co/datasets/rakab/FORM-bench/resolve/main/benchmarks/tutorial/tutorial_test_v2.jsonl
- Command line
-
hf download hf://datasets/rakab/FORM-bench/benchmarks/tutorial/tutorial_test_v2.jsonl
-
curl -L -o tutorial_test_v2.jsonl https://huggingface.co/datasets/rakab/FORM-bench/resolve/main/benchmarks/tutorial/tutorial_test_v2.jsonl
75.6 kB
| {"task_id": "tut-0", "messages": [{"role": "user", "content": "Repeatedly replace each occurrence of the product x times y squared with z in the expression x cubed times y to the fifth, until no such product remains, then print the resulting expression."}, {"role": "assistant", "content": "Symbols x,y,z;\nLocal F = x^3 * y^5;\nwhile ( match(x*y^2) );\nid x*y^2 = z;\nendwhile;\nprint;\n.end"}], "instruction": "Repeatedly replace each occurrence of the product x times y squared with z in the expression x cubed times y to the fifth, until no such product remains, then print the resulting expression.", "code": "Symbols x,y,z;\nLocal F = x^3 * y^5;\nwhile ( match(x*y^2) );\nid x*y^2 = z;\nendwhile;\nprint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols x,y,z;\n Local F = x^3 * y^5;\n while ( match(x*y^2) );\n id x*y^2 = z;\n endwhile;\n print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 52\n\n F =\n x*y*z^2;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-1", "messages": [{"role": "user", "content": "Compute the product of x multiplied by itself ten times, starting from 1, and display the result."}, {"role": "assistant", "content": "Symbols x;\nLocal F = 1;\nLabel 1;\nMultiply x;\nif (count(x,1)<10);\ngoto 1;\nendif;\nprint;\n.end;"}], "instruction": "Compute the product of x multiplied by itself ten times, starting from 1, and display the result.", "code": "Symbols x;\nLocal F = 1;\nLabel 1;\nMultiply x;\nif (count(x,1)<10);\ngoto 1;\nendif;\nprint;\n.end;", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols x;\n Local F = 1;\n Label 1;\n Multiply x;\n if (count(x,1)<10);\n goto 1;\n endif;\n print;\n .end;\n\nTime = 0.00 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 36\n\n F =\n x^10;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-2", "messages": [{"role": "user", "content": "Compute the sum of all terms in the expression 1 + y\u00b2x\u2074 + y\u00b3x\u2075 + y\u2074x\u2076 + y\u2075x\u2077 for which the exponent of y minus twice the exponent of x is greater than 7, and discard the rest."}, {"role": "assistant", "content": "Symbols x,y;\nLocal F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\nif (count(y,1,x,-2) > 7);\ndiscard;\nendif;\nPrint;\n.end\n"}], "instruction": "Compute the sum of all terms in the expression 1 + y\u00b2x\u2074 + y\u00b3x\u2075 + y\u2074x\u2076 + y\u2075x\u2077 for which the exponent of y minus twice the exponent of x is greater than 7, and discard the rest.", "code": "Symbols x,y;\nLocal F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\nif (count(y,1,x,-2) > 7);\ndiscard;\nendif;\nPrint;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols x,y;\n Local F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\n if (count(y,1,x,-2) > 7);\n discard;\n endif;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 5\n F Terms in output = 5\n Bytes used = 156\n\n F =\n 1 + x^4*y^2 + x^5*y^3 + x^6*y^4 + x^7*y^5;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-3", "messages": [{"role": "user", "content": "Compute the square of the sum of the symbolic variables a and b, and display the result."}, {"role": "assistant", "content": "Symbols a,b;\nLocal [(a+b)^2] = (a+b)^2;\nPrint;\n.end"}], "instruction": "Compute the square of the sum of the symbolic variables a and b, and display the result.", "code": "Symbols a,b;\nLocal [(a+b)^2] = (a+b)^2;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols a,b;\n Local [(a+b)^2] = (a+b)^2;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n [(a+b)^2] Terms in output = 3\n Bytes used = 108\n\n [(a+b)^2] =\n b^2 + 2*a*b + a^2;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-4", "messages": [{"role": "user", "content": "Compute the squares of the two expressions (a+b+c)^2 and (a+(b+c))^2, and display the resulting expanded terms for each."}, {"role": "assistant", "content": "Symbol a;\nFunctions b, c;\nLocal F1 = (a+b+c)^2;\nLocal F2 = (a+(b+c))^2;\nPrint;\n.end;"}], "instruction": "Compute the squares of the two expressions (a+b+c)^2 and (a+(b+c))^2, and display the resulting expanded terms for each.", "code": "Symbol a;\nFunctions b, c;\nLocal F1 = (a+b+c)^2;\nLocal F2 = (a+(b+c))^2;\nPrint;\n.end;", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbol a;\n Functions b, c;\n Local F1 = (a+b+c)^2;\n Local F2 = (a+(b+c))^2;\n Print;\n .end;\n\nTime = 0.00 sec Generated terms = 9\n F1 Terms in output = 7\n Bytes used = 252\n\nTime = 0.00 sec Generated terms = 7\n F2 Terms in output = 7\n Bytes used = 252\n\n F1 =\n a^2 + 2*b*a + b*b + b*c + 2*c*a + c*b + c*c;\n\n F2 =\n a^2 + 2*b*a + b*b + b*c + 2*c*a + c*b + c*c;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-5", "messages": [{"role": "user", "content": "Compute the expanded forms of (a+b+c)^2 and (a+(b+c))^2, and compare the results to see how the grouping of the noncommuting functions b and c affects the expansion."}, {"role": "assistant", "content": "Symbol a;\nFunctions B, C;\nLocal F1 = (a+B+C)^3;\nLocal F2 = (a+(B+C))^3;\nPrint;\n.end;"}], "instruction": "Compute the expanded forms of (a+b+c)^2 and (a+(b+c))^2, and compare the results to see how the grouping of the noncommuting functions b and c affects the expansion.", "code": "Symbol a;\nFunctions B, C;\nLocal F1 = (a+B+C)^3;\nLocal F2 = (a+(B+C))^3;\nPrint;\n.end;", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbol a;\n Functions B, C;\n Local F1 = (a+B+C)^3;\n Local F2 = (a+(B+C))^3;\n Print;\n .end;\n\nTime = 0.00 sec Generated terms = 27\n F1 Terms in output = 15\n Bytes used = 572\n\nTime = 0.00 sec Generated terms = 15\n F2 Terms in output = 15\n Bytes used = 572\n\n F1 =\n a^3 + 3*B*a^2 + 3*B*B*a + B*B*B + B*B*C + 3*B*C*a + B*C*B + B*C*C + 3*C*\n a^2 + 3*C*B*a + C*B*B + C*B*C + 3*C*C*a + C*C*B + C*C*C;\n\n F2 =\n a^3 + 3*B*a^2 + 3*B*B*a + B*B*B + B*B*C + 3*B*C*a + B*C*B + B*C*C + 3*C*\n a^2 + 3*C*B*a + C*B*B + C*B*C + 3*C*C*a + C*C*B + C*C*C;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-6", "messages": [{"role": "user", "content": "Compute the four expressions involving tensors, vectors, and the Kronecker delta, and verify how the Einstein summation convention is applied in each case."}, {"role": "assistant", "content": "Vectors x,y;\nTensor a;\nIndices i,j;\nLocal F1 = a(i,j)*x(j);\nLocal F2 = a(i,i)*x(j);\nLocal F3 = a(i,j)*x(i)*y(j);\nLocal F4 = d_(i,j)*x(i)*x(j);\nPrint;\n.end"}], "instruction": "Compute the four expressions involving tensors, vectors, and the Kronecker delta, and verify how the Einstein summation convention is applied in each case.", "code": "Vectors x,y;\nTensor a;\nIndices i,j;\nLocal F1 = a(i,j)*x(j);\nLocal F2 = a(i,i)*x(j);\nLocal F3 = a(i,j)*x(i)*y(j);\nLocal F4 = d_(i,j)*x(i)*x(j);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Vectors x,y;\n Tensor a;\n Indices i,j;\n Local F1 = a(i,j)*x(j);\n Local F2 = a(i,i)*x(j);\n Local F3 = a(i,j)*x(i)*y(j);\n Local F4 = d_(i,j)*x(i)*x(j);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n F1 Terms in output = 1\n Bytes used = 40\n\nTime = 0.00 sec Generated terms = 1\n F2 Terms in output = 1\n Bytes used = 56\n\nTime = 0.00 sec Generated terms = 1\n F3 Terms in output = 1\n Bytes used = 40\n\nTime = 0.00 sec Generated terms = 1\n F4 Terms in output = 1\n Bytes used = 40\n\n F1 =\n a(i,x);\n\n F2 =\n a(i,i)*x(j);\n\n F3 =\n a(x,y);\n\n F4 =\n x.x;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-7", "messages": [{"role": "user", "content": "Verify that the given tensor expressions are equal by showing their differences are zero."}, {"role": "assistant", "content": "Vectors x,y;\nTensor a;\nIndices i,j;\nLocal F1 = a(i,j)*x(i)*y(j) - a(j,i)*x(j)*y(i);\nLocal F2 = (a(i,j) + a(j,i))*x(i)*x(j) - 2*a(i,j)*x(i)*x(j);\nPrint;\n.end"}], "instruction": "Verify that the given tensor expressions are equal by showing their differences are zero.", "code": "Vectors x,y;\nTensor a;\nIndices i,j;\nLocal F1 = a(i,j)*x(i)*y(j) - a(j,i)*x(j)*y(i);\nLocal F2 = (a(i,j) + a(j,i))*x(i)*x(j) - 2*a(i,j)*x(i)*x(j);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Vectors x,y;\n Tensor a;\n Indices i,j;\n Local F1 = a(i,j)*x(i)*y(j) - a(j,i)*x(j)*y(i);\n Local F2 = (a(i,j) + a(j,i))*x(i)*x(j) - 2*a(i,j)*x(i)*x(j);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 2\n F1 Terms in output = 0\n Bytes used = 4\n\nTime = 0.00 sec Generated terms = 3\n F2 Terms in output = 0\n Bytes used = 4\n\n F1 = 0;\n\n F2 = 0;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-8", "messages": [{"role": "user", "content": "Verify that for an antisymmetric rank-two tensor A, the expression A(i,j)x(i)x(j) equals zero for any vector x, and that the tensor B defined by B(i,j)=A(i,k)A(k,j) is symmetric by showing B(i,j)-B(j,i)=0."}, {"role": "assistant", "content": "Tensor A(antisymmetric);\nVectors x;\nIndices i,j,k;\nLocal F1 = A(i,j)*x(i)*x(j);\nLocal F2 = A(i,k)*A(k,j) - A(j,k)*A(k,i);\nPrint;\n.end"}], "instruction": "Verify that for an antisymmetric rank-two tensor A, the expression A(i,j)x(i)x(j) equals zero for any vector x, and that the tensor B defined by B(i,j)=A(i,k)A(k,j) is symmetric by showing B(i,j)-B(j,i)=0.", "code": "Tensor A(antisymmetric);\nVectors x;\nIndices i,j,k;\nLocal F1 = A(i,j)*x(i)*x(j);\nLocal F2 = A(i,k)*A(k,j) - A(j,k)*A(k,i);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Tensor A(antisymmetric);\n Vectors x;\n Indices i,j,k;\n Local F1 = A(i,j)*x(i)*x(j);\n Local F2 = A(i,k)*A(k,j) - A(j,k)*A(k,i);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 0\n F1 Terms in output = 0\n Bytes used = 4\n\nTime = 0.00 sec Generated terms = 2\n F2 Terms in output = 0\n Bytes used = 4\n\n F1 = 0;\n\n F2 = 0;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-9", "messages": [{"role": "user", "content": "Compute the product of the two truncated series expansions for e^x and e^y, each up to order 3, and express the result as a polynomial in x, showing the coefficients for each power of x."}, {"role": "assistant", "content": "Symbols x,y,i,j;\nLocal F=sump_(i,0,3,x/i)*sump_(j,0,3,y/j);\nBracket x;\nPrint;\n.end"}], "instruction": "Compute the product of the two truncated series expansions for e^x and e^y, each up to order 3, and express the result as a polynomial in x, showing the coefficients for each power of x.", "code": "Symbols x,y,i,j;\nLocal F=sump_(i,0,3,x/i)*sump_(j,0,3,y/j);\nBracket x;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols x,y,i,j;\n Local F=sump_(i,0,3,x/i)*sump_(j,0,3,y/j);\n Bracket x;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 16\n F Terms in output = 16\n Bytes used = 484\n\n F =\n + x * ( 1 + y + 1/2*y^2 + 1/6*y^3 )\n\n + x^2 * ( 1/2 + 1/2*y + 1/4*y^2 + 1/12*y^3 )\n\n + x^3 * ( 1/6 + 1/6*y + 1/12*y^2 + 1/36*y^3 )\n\n + 1 + y + 1/2*y^2 + 1/6*y^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-10", "messages": [{"role": "user", "content": "Compute the sum of (x+1) raised to each integer power from 0 to 10, but keep only terms where the power of x is at most 3, and express the result as a polynomial in x."}, {"role": "assistant", "content": "Symbol i, x(:3);\nLocal F = sum_(i,0,10,(x+1)^i);\nPrint;\n.end"}], "instruction": "Compute the sum of (x+1) raised to each integer power from 0 to 10, but keep only terms where the power of x is at most 3, and express the result as a polynomial in x.", "code": "Symbol i, x(:3);\nLocal F = sum_(i,0,10,(x+1)^i);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbol i, x(:3);\n Local F = sum_(i,0,10,(x+1)^i);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 38\n F Terms in output = 4\n Bytes used = 100\n\n F =\n 11 + 55*x + 165*x^2 + 330*x^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-11", "messages": [{"role": "user", "content": "Compute the dot product of the four-vectors p and P, where p = (ct, x, y, z) and P = (\u2212ct, x, y, z), and simplify the result."}, {"role": "assistant", "content": "Vectors p,P;\nIndices mu=0;\nSymbols c,t,x,y,z;\nLocal F = p(mu)*P(mu);\nsum mu,0,1,2,3;\nid p(0) = c*t;\nid p(1) = x;\nid p(2) = y;\nid p(3) = z;\nid P(0) = -c*t;\nid P(1) = x;\nid P(2) = y;\nid P(3) = z;\nPrint;\n.end"}], "instruction": "Compute the dot product of the four-vectors p and P, where p = (ct, x, y, z) and P = (\u2212ct, x, y, z), and simplify the result.", "code": "Vectors p,P;\nIndices mu=0;\nSymbols c,t,x,y,z;\nLocal F = p(mu)*P(mu);\nsum mu,0,1,2,3;\nid p(0) = c*t;\nid p(1) = x;\nid p(2) = y;\nid p(3) = z;\nid P(0) = -c*t;\nid P(1) = x;\nid P(2) = y;\nid P(3) = z;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Vectors p,P;\n Indices mu=0;\n Symbols c,t,x,y,z;\n Local F = p(mu)*P(mu);\n sum mu,0,1,2,3;\n id p(0) = c*t;\n id p(1) = x;\n id p(2) = y;\n id p(3) = z;\n id P(0) = -c*t;\n id P(1) = x;\n id P(2) = y;\n id P(3) = z;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 4\n F Terms in output = 4\n Bytes used = 132\n\n F =\n z^2 + y^2 + x^2 - c^2*t^2;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-12", "messages": [{"role": "user", "content": "Verify the six vector identities from vector analysis using the Levi-Civita tensor in three dimensions, as expressed in the given FORM program."}, {"role": "assistant", "content": "Dimension 3;\nVectors A,B,C,D;\nIndices i,j,k,l,m,n,p,q;\nLocal F1 = e_(i,j,k)*A(i)*B(j) * e_(m,n,k)*A(m)*B(n);\nLocal F2 = e_(i,j,k) * (e_(m,n,i)*A(m)*B(n)) * C(j) -\ne_(i,j,k) * A(i) * (e_(m,n,j)*B(m)*C(n));\nLocal F3 = e_(i,j,k) * A(i) * (e_(m,n,j)*B(m)*C(n)) +\ne_(i,j,k) * B(i) * (e_(m,n,j)*C(m)*A(n)) +\ne_(i,j,k) * C(i) * (e_(m,n,j)*A(m)*B(n));\nLocal F4 = e_(i,j,k) * (e_(m,n,i)*A(m)*B(n)) * (e_(p,q,j)*C(p)*D(q));\nLocal F5 = e_(i,j,k)*(A(i)-B(i))*(A(j)+B(j));\nLocal F6 = e_(i,j,k)*A(i)*B(j) * e_(m,n,k)*C(m)*D(n) +\ne_(i,j,k)*B(i)*C(j) * e_(m,n,k)*A(m)*D(n) +\ne_(i,j,k)*C(i)*A(j) * e_(m,n,k)*B(m)*D(n);\ncontract;\nPrint;\n.end"}], "instruction": "Verify the six vector identities from vector analysis using the Levi-Civita tensor in three dimensions, as expressed in the given FORM program.", "code": "Dimension 3;\nVectors A,B,C,D;\nIndices i,j,k,l,m,n,p,q;\nLocal F1 = e_(i,j,k)*A(i)*B(j) * e_(m,n,k)*A(m)*B(n);\nLocal F2 = e_(i,j,k) * (e_(m,n,i)*A(m)*B(n)) * C(j) -\ne_(i,j,k) * A(i) * (e_(m,n,j)*B(m)*C(n));\nLocal F3 = e_(i,j,k) * A(i) * (e_(m,n,j)*B(m)*C(n)) +\ne_(i,j,k) * B(i) * (e_(m,n,j)*C(m)*A(n)) +\ne_(i,j,k) * C(i) * (e_(m,n,j)*A(m)*B(n));\nLocal F4 = e_(i,j,k) * (e_(m,n,i)*A(m)*B(n)) * (e_(p,q,j)*C(p)*D(q));\nLocal F5 = e_(i,j,k)*(A(i)-B(i))*(A(j)+B(j));\nLocal F6 = e_(i,j,k)*A(i)*B(j) * e_(m,n,k)*C(m)*D(n) +\ne_(i,j,k)*B(i)*C(j) * e_(m,n,k)*A(m)*D(n) +\ne_(i,j,k)*C(i)*A(j) * e_(m,n,k)*B(m)*D(n);\ncontract;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Dimension 3;\n Vectors A,B,C,D;\n Indices i,j,k,l,m,n,p,q;\n Local F1 = e_(i,j,k)*A(i)*B(j) * e_(m,n,k)*A(m)*B(n);\n Local F2 = e_(i,j,k) * (e_(m,n,i)*A(m)*B(n)) * C(j) -\n e_(i,j,k) * A(i) * (e_(m,n,j)*B(m)*C(n));\n Local F3 = e_(i,j,k) * A(i) * (e_(m,n,j)*B(m)*C(n)) +\n e_(i,j,k) * B(i) * (e_(m,n,j)*C(m)*A(n)) +\n e_(i,j,k) * C(i) * (e_(m,n,j)*A(m)*B(n));\n Local F4 = e_(i,j,k) * (e_(m,n,i)*A(m)*B(n)) * (e_(p,q,j)*C(p)*D(q));\n Local F5 = e_(i,j,k)*(A(i)-B(i))*(A(j)+B(j));\n Local F6 = e_(i,j,k)*A(i)*B(j) * e_(m,n,k)*C(m)*D(n) +\n e_(i,j,k)*B(i)*C(j) * e_(m,n,k)*A(m)*D(n) +\n e_(i,j,k)*C(i)*A(j) * e_(m,n,k)*B(m)*D(n);\n contract;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 2\n F1 Terms in output = 2\n Bytes used = 88\n\nTime = 0.00 sec Generated terms = 4\n F2 Terms in output = 2\n Bytes used = 104\n\nTime = 0.00 sec Generated terms = 6\n F3 Terms in output = 0\n Bytes used = 4\n\nTime = 0.00 sec Generated terms = 2\n F4 Terms in output = 2\n Bytes used = 108\n\nTime = 0.00 sec Generated terms = 2\n F5 Terms in output = 1\n Bytes used = 44\n\nTime = 0.00 sec Generated terms = 6\n F6 Terms in output = 0\n Bytes used = 4\n\n F1 =\n A.A*B.B - A.B^2;\n\n F2 =\n - A(k)*B.C + C(k)*A.B;\n\n F3 = 0;\n\n F4 =\n e_(A,C,D)*B(k) - e_(B,C,D)*A(k);\n\n F5 =\n 2*e_(A,B,k);\n\n F6 = 0;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-13", "messages": [{"role": "user", "content": "Compute the resultant of the quadratic polynomial f = ax\u00b2 + bx + c and its derivative f\u2032 = 2ax + b, using the determinant formula for the resultant of two polynomials."}, {"role": "assistant", "content": "Symbols a,b,c,x;\nCFunction M;\nIndices i1,i2,i3;\nLocal R = e_(1,2,3)*e_(i1,i2,i3)*M(1,i1)*M(2,i2)*M(3,i3);\ncontract;\nid M(1,1) = a;\nid M(1,2) = b;\nid M(1,3) = c;\nid M(2,1) = 2*a;\nid M(2,2) = b;\nid M(2,3) = 0;\nid M(3,1) = 0;\nid M(3,2) = 2*a;\nid M(3,3) = b;\nPrint;\n.end"}], "instruction": "Compute the resultant of the quadratic polynomial f = ax\u00b2 + bx + c and its derivative f\u2032 = 2ax + b, using the determinant formula for the resultant of two polynomials.", "code": "Symbols a,b,c,x;\nCFunction M;\nIndices i1,i2,i3;\nLocal R = e_(1,2,3)*e_(i1,i2,i3)*M(1,i1)*M(2,i2)*M(3,i3);\ncontract;\nid M(1,1) = a;\nid M(1,2) = b;\nid M(1,3) = c;\nid M(2,1) = 2*a;\nid M(2,2) = b;\nid M(2,3) = 0;\nid M(3,1) = 0;\nid M(3,2) = 2*a;\nid M(3,3) = b;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols a,b,c,x;\n CFunction M;\n Indices i1,i2,i3;\n Local R = e_(1,2,3)*e_(i1,i2,i3)*M(1,i1)*M(2,i2)*M(3,i3);\n contract;\n id M(1,1) = a;\n id M(1,2) = b;\n id M(1,3) = c;\n id M(2,1) = 2*a;\n id M(2,2) = b;\n id M(2,3) = 0;\n id M(3,1) = 0;\n id M(3,2) = 2*a;\n id M(3,3) = b;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n R Terms in output = 2\n Bytes used = 76\n\n R =\n - a*b^2 + 4*a^2*c;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-14", "messages": [{"role": "user", "content": "Compute the discriminant of the cubic polynomial f = ax\u00b3 + bx\u00b2 + cx + d using the resultant of f and its derivative."}, {"role": "assistant", "content": "Symbols a,b,c,d,x;\nCFunction M;\nAutoDeclare Indices i;\nLocal D = - e_(1,2,3,4,5)*e_(i1,i2,i3,i4,i5)*\nM(1,i1)*M(2,i2)*M(3,i3)*M(4,i4)*M(5,i5) / a;\ncontract;\nid M(1,1) = a;\nid M(1,2) = b;\nid M(1,3) = c;\nid M(1,4) = d;\nid M(1,5) = 0;\nid M(2,1) = 0;\nid M(2,2) = a;\nid M(2,3) = b;\nid M(2,4) = c;\nid M(2,5) = d;\nid M(3,1) = 3*a;\nid M(3,2) = 2*b;\nid M(3,3) = c;\nid M(3,4) = 0;\nid M(3,5) = 0;\nid M(4,1) = 0;\nid M(4,2) = 3*a;\nid M(4,3) = 2*b;\nid M(4,4) = c;\nid M(4,5) = 0;\nid M(5,1) = 0;\nid M(5,2) = 0;\nid M(5,3) = 3*a;\nid M(5,4) = 2*b;\nid M(5,5) = c;\nPrint;\n.end"}], "instruction": "Compute the discriminant of the cubic polynomial f = ax\u00b3 + bx\u00b2 + cx + d using the resultant of f and its derivative.", "code": "Symbols a,b,c,d,x;\nCFunction M;\nAutoDeclare Indices i;\nLocal D = - e_(1,2,3,4,5)*e_(i1,i2,i3,i4,i5)*\nM(1,i1)*M(2,i2)*M(3,i3)*M(4,i4)*M(5,i5) / a;\ncontract;\nid M(1,1) = a;\nid M(1,2) = b;\nid M(1,3) = c;\nid M(1,4) = d;\nid M(1,5) = 0;\nid M(2,1) = 0;\nid M(2,2) = a;\nid M(2,3) = b;\nid M(2,4) = c;\nid M(2,5) = d;\nid M(3,1) = 3*a;\nid M(3,2) = 2*b;\nid M(3,3) = c;\nid M(3,4) = 0;\nid M(3,5) = 0;\nid M(4,1) = 0;\nid M(4,2) = 3*a;\nid M(4,3) = 2*b;\nid M(4,4) = c;\nid M(4,5) = 0;\nid M(5,1) = 0;\nid M(5,2) = 0;\nid M(5,3) = 3*a;\nid M(5,4) = 2*b;\nid M(5,5) = c;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n Symbols a,b,c,d,x;\n CFunction M;\n AutoDeclare Indices i;\n Local D = - e_(1,2,3,4,5)*e_(i1,i2,i3,i4,i5)*\n M(1,i1)*M(2,i2)*M(3,i3)*M(4,i4)*M(5,i5) / a;\n contract;\n id M(1,1) = a;\n id M(1,2) = b;\n id M(1,3) = c;\n id M(1,4) = d;\n id M(1,5) = 0;\n id M(2,1) = 0;\n id M(2,2) = a;\n id M(2,3) = b;\n id M(2,4) = c;\n id M(2,5) = d;\n id M(3,1) = 3*a;\n id M(3,2) = 2*b;\n id M(3,3) = c;\n id M(3,4) = 0;\n id M(3,5) = 0;\n id M(4,1) = 0;\n id M(4,2) = 3*a;\n id M(4,3) = 2*b;\n id M(4,4) = c;\n id M(4,5) = 0;\n id M(5,1) = 0;\n id M(5,2) = 0;\n id M(5,3) = 3*a;\n id M(5,4) = 2*b;\n id M(5,5) = c;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 17\n D Terms in output = 5\n Bytes used = 208\n\n D =\n b^2*c^2 - 4*b^3*d - 4*a*c^3 + 18*a*b*c*d - 27*a^2*d^2;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-15", "messages": [{"role": "user", "content": "Compute the determinant of the 2x2 matrix with entries a, b, c, d using the contraction of two Levi-Civita tensors with vectors u and v."}, {"role": "assistant", "content": "AutoDeclare Vectors u,v;\nSymbol a,b,c,d;\nLocal det = e_(u1,u2)*e_(v1,v2);\ncontract;\nid u1.v1 = a;\nid u1.v2 = b;\nid u2.v1 = c;\nid u2.v2 = d;\nPrint;\n.end"}], "instruction": "Compute the determinant of the 2x2 matrix with entries a, b, c, d using the contraction of two Levi-Civita tensors with vectors u and v.", "code": "AutoDeclare Vectors u,v;\nSymbol a,b,c,d;\nLocal det = e_(u1,u2)*e_(v1,v2);\ncontract;\nid u1.v1 = a;\nid u1.v2 = b;\nid u2.v1 = c;\nid u2.v2 = d;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n AutoDeclare Vectors u,v;\n Symbol a,b,c,d;\n Local det = e_(u1,u2)*e_(v1,v2);\n contract;\n id u1.v1 = a;\n id u1.v2 = b;\n id u2.v1 = c;\n id u2.v2 = d;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 2\n det Terms in output = 2\n Bytes used = 80\n\n det =\n - b*c + a*d;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-16", "messages": [{"role": "user", "content": "Compute the determinant of a general 10\u00d710 matrix using the Levi-Civita tensor contraction method."}, {"role": "assistant", "content": "* Method with functions\n*\nAutoDeclare Indices i;\nCFunction M;\nOn statistics;\nLocal detF = e_(1,...,10)*\ne_(i1,...,i10)*\nM(1,i1)*M(2,i2)*M(3,i3)*M(4,i4)*M(5,i5)*\nM(6,i6)*M(7,i7)*M(8,i8)*M(9,i9)*M(10,i10);\ncontract;\n.end;"}], "instruction": "Compute the determinant of a general 10\u00d710 matrix using the Levi-Civita tensor contraction method.", "code": "* Method with functions\n*\nAutoDeclare Indices i;\nCFunction M;\nOn statistics;\nLocal detF = e_(1,...,10)*\ne_(i1,...,i10)*\nM(1,i1)*M(2,i2)*M(3,i3)*M(4,i4)*M(5,i5)*\nM(6,i6)*M(7,i7)*M(8,i8)*M(9,i9)*M(10,i10);\ncontract;\n.end;", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:26 2026\n * Method with functions\n *\n AutoDeclare Indices i;\n CFunction M;\n On statistics;\n Local detF = e_(1,...,10)*\n e_(i1,...,i10)*\n M(1,i1)*M(2,i2)*M(3,i3)*M(4,i4)*M(5,i5)*\n M(6,i6)*M(7,i7)*M(8,i8)*M(9,i9)*M(10,i10);\n contract;\n .end;\n\nTime = 16.58 sec Generated terms = 3628800\n detF Terms in output = 3628800\n Bytes used = 261679624\n 16.58 sec out of 16.74 sec\n", "form_rc": 0} | |
| {"task_id": "tut-17", "messages": [{"role": "user", "content": "Compute the determinant of a 10x10 matrix using the Levi-Civita tensor contraction method, where the matrix elements are represented by the vectors u and v."}, {"role": "assistant", "content": "* Method with vectors\n*\nAutoDeclare Vectors u,v;\nOn statistics;\nLocal detV = e_(u1,...,u10)*\ne_(v1,...,v10);\ncontract;\n.end"}], "instruction": "Compute the determinant of a 10x10 matrix using the Levi-Civita tensor contraction method, where the matrix elements are represented by the vectors u and v.", "code": "* Method with vectors\n*\nAutoDeclare Vectors u,v;\nOn statistics;\nLocal detV = e_(u1,...,u10)*\ne_(v1,...,v10);\ncontract;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:43 2026\n * Method with vectors\n *\n AutoDeclare Vectors u,v;\n On statistics;\n Local detV = e_(u1,...,u10)*\n e_(v1,...,v10);\n contract;\n .end\n\nTime = 3.37 sec Generated terms = 3628800\n detV Terms in output = 3628800\n Bytes used = 176430012\n 3.37 sec out of 3.41 sec\n", "form_rc": 0} | |
| {"task_id": "tut-18", "messages": [{"role": "user", "content": "Use the generalized metric dd_ to count the loop-free pairings of the multiset (v1, v1, v1, v1, v2, v2, v2, v3, v3, v4): expand dd_(v1,v1,v1,v1,v2,v2,v2,v3,v3,v4) with a .sort, discard every term that contains a self-pairing (v_i . v_i), then replace each remaining dot product by 1 and print the result. Then repeat the same computation with the additional step of discarding every term that contains a squared dot product (a repeated edge type), and print that result as well; it must be zero, confirming that every loop-free pairing uses a repeated edge."}, {"role": "assistant", "content": "AutoDeclare Vectors v;\nLocal F = dd_(v1,v1,v1,v1,\nv2,v2,v2,\nv3,v3,\nv4);\n.sort\nid v1?.v1? = 0;\nid v1?.v2? = 1;\n.sort\nLocal G = dd_(v1,v1,v1,v1,\nv2,v2,v2,\nv3,v3,\nv4);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1?.v2? = 1;\n.sort\nPrint F, G;\n.end\n"}], "instruction": "Use the generalized metric dd_ to count the loop-free pairings of the multiset (v1, v1, v1, v1, v2, v2, v2, v3, v3, v4): expand dd_(v1,v1,v1,v1,v2,v2,v2,v3,v3,v4) with a .sort, discard every term that contains a self-pairing (v_i . v_i), then replace each remaining dot product by 1 and print the result. Then repeat the same computation with the additional step of discarding every term that contains a squared dot product (a repeated edge type), and print that result as well; it must be zero, confirming that every loop-free pairing uses a repeated edge.", "code": "AutoDeclare Vectors v;\nLocal F = dd_(v1,v1,v1,v1,\nv2,v2,v2,\nv3,v3,\nv4);\n.sort\nid v1?.v1? = 0;\nid v1?.v2? = 1;\n.sort\nLocal G = dd_(v1,v1,v1,v1,\nv2,v2,v2,\nv3,v3,\nv4);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1?.v2? = 1;\n.sort\nPrint F, G;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n AutoDeclare Vectors v;\n Local F = dd_(v1,v1,v1,v1,\n v2,v2,v2,\n v3,v3,\n v4);\n .sort\n\nTime = 0.00 sec Generated terms = 16\n F Terms in output = 16\n Bytes used = 936\n id v1?.v1? = 0;\n id v1?.v2? = 1;\n .sort\n\nTime = 0.00 sec Generated terms = 3\n F Terms in output = 1\n Bytes used = 20\n Local G = dd_(v1,v1,v1,v1,\n v2,v2,v2,\n v3,v3,\n v4);\n .sort\n\nTime = 0.00 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 20\n\nTime = 0.00 sec Generated terms = 16\n G Terms in output = 16\n Bytes used = 936\n id v1?.v1? = 0;\n id v1?.v2?^2 = 0;\n id v1?.v2? = 1;\n .sort\n\nTime = 0.00 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 20\n\nTime = 0.00 sec Generated terms = 0\n G Terms in output = 0\n Bytes used = 4\n Print F, G;\n .end\n\nTime = 0.00 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 20\n\nTime = 0.00 sec Generated terms = 0\n G Terms in output = 0\n Bytes used = 4\n\n F =\n 264;\n\n G = 0;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-19", "messages": [{"role": "user", "content": "Use the generalized metric dd_ to test whether a loop-free pairing without repeated edge types exists for the multiset (v1 x7, v2 x5, v3 x4, v4 x3, v5 x2, v6, v7, v8): expand dd_(v1,v1,v1,v1,v1,v1,v1,v2,v2,v2,v2,v2,v3,v3,v3,v3,v4,v4,v4,v5,v5,v6,v7,v8) with a .sort, discard every term that contains a self-pairing or a squared dot product, replace each remaining dot product by 1, and print the result; it must be zero, confirming that no such pairing exists."}, {"role": "assistant", "content": "AutoDeclare Vectors v;\nLocal F = dd_(v1,v1,v1,v1,v1,v1,v1,\nv2,v2,v2,v2,v2,\nv3,v3,v3,v3,\nv4,v4,v4,\nv5,v5,\nv6,v7,v8);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1?.v2? = 1;\nPrint F;\n.end\n"}], "instruction": "Use the generalized metric dd_ to test whether a loop-free pairing without repeated edge types exists for the multiset (v1 x7, v2 x5, v3 x4, v4 x3, v5 x2, v6, v7, v8): expand dd_(v1,v1,v1,v1,v1,v1,v1,v2,v2,v2,v2,v2,v3,v3,v3,v3,v4,v4,v4,v5,v5,v6,v7,v8) with a .sort, discard every term that contains a self-pairing or a squared dot product, replace each remaining dot product by 1, and print the result; it must be zero, confirming that no such pairing exists.", "code": "AutoDeclare Vectors v;\nLocal F = dd_(v1,v1,v1,v1,v1,v1,v1,\nv2,v2,v2,v2,v2,\nv3,v3,v3,v3,\nv4,v4,v4,\nv5,v5,\nv6,v7,v8);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1?.v2? = 1;\nPrint F;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n AutoDeclare Vectors v;\n Local F = dd_(v1,v1,v1,v1,v1,v1,v1,\n v2,v2,v2,v2,v2,\n v3,v3,v3,v3,\n v4,v4,v4,\n v5,v5,\n v6,v7,v8);\n .sort\n\nTime = 0.09 sec Generated terms = 57264\n F Terms in output = 57264\n Bytes used = 4047124\n id v1?.v1? = 0;\n id v1?.v2?^2 = 0;\n id v1?.v2? = 1;\n Print F;\n .end\n\nTime = 0.14 sec Generated terms = 0\n F Terms in output = 0\n Bytes used = 4\n\n F = 0;\n\n 0.14 sec out of 0.16 sec\n", "form_rc": 0} | |
| {"task_id": "tut-20", "messages": [{"role": "user", "content": "Use the generalized metric dd_ to count the loop-free pairings without repeated edge types of the multiset (v1 x7, v2 x4, v3 x3, v4 x3, v5 x2, v6, v7, v8): expand dd_(v1,v1,v1,v1,v1,v1,v1,v2,v2,v2,v2,v3,v3,v3,v4,v4,v4,v5,v5,v6,v7,v8) with a .sort, discard every term that contains a self-pairing or a squared dot product, replace each remaining dot product by 1, and print the result."}, {"role": "assistant", "content": "AutoDeclare Vectors v;\nLocal F = dd_(v1,v1,v1,v1,v1,v1,v1,\nv2,v2,v2,v2,\nv3,v3,v3,\nv4,v4,v4,\nv5,v5,\nv6,v7,v8);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1?.v2? = 1;\nPrint F;\n.end\n"}], "instruction": "Use the generalized metric dd_ to count the loop-free pairings without repeated edge types of the multiset (v1 x7, v2 x4, v3 x3, v4 x3, v5 x2, v6, v7, v8): expand dd_(v1,v1,v1,v1,v1,v1,v1,v2,v2,v2,v2,v3,v3,v3,v4,v4,v4,v5,v5,v6,v7,v8) with a .sort, discard every term that contains a self-pairing or a squared dot product, replace each remaining dot product by 1, and print the result.", "code": "AutoDeclare Vectors v;\nLocal F = dd_(v1,v1,v1,v1,v1,v1,v1,\nv2,v2,v2,v2,\nv3,v3,v3,\nv4,v4,v4,\nv5,v5,\nv6,v7,v8);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1?.v2? = 1;\nPrint F;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n AutoDeclare Vectors v;\n Local F = dd_(v1,v1,v1,v1,v1,v1,v1,\n v2,v2,v2,v2,\n v3,v3,v3,\n v4,v4,v4,\n v5,v5,\n v6,v7,v8);\n .sort\n\nTime = 0.04 sec Generated terms = 29062\n F Terms in output = 29062\n Bytes used = 1923452\n id v1?.v1? = 0;\n id v1?.v2?^2 = 0;\n id v1?.v2? = 1;\n Print F;\n .end\n\nTime = 0.06 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 20\n\n F =\n 8709120;\n\n 0.06 sec out of 0.06 sec\n", "form_rc": 0} | |
| {"task_id": "tut-21", "messages": [{"role": "user", "content": "Use the generalized metric dd_ to count the loop-free pairings without repeated edge types of the multiset (u, u, u, v, v, w, w, v1, v2, v3), subject to the constraint that there are no pairings among the three singleton vertices v1, v2, v3: expand dd_(u,u,u,v,v,w,w,v1,v2,v3) with a .sort, discard every term that contains a self-pairing, a squared dot product, or one of the forbidden dot products v1.v2, v1.v3, v2.v3, then replace each remaining dot product by 1 and print the result."}, {"role": "assistant", "content": "AutoDeclare Vectors u, v, w, v1, v2, v3;\nLocal F = dd_(u,u,u,v,v,w,w,v1,v2,v3);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1.v2 = 0;\nid v1.v3 = 0;\nid v2.v3 = 0;\nid v1?.v2? = 1;\nPrint F;\n.end\n"}], "instruction": "Use the generalized metric dd_ to count the loop-free pairings without repeated edge types of the multiset (u, u, u, v, v, w, w, v1, v2, v3), subject to the constraint that there are no pairings among the three singleton vertices v1, v2, v3: expand dd_(u,u,u,v,v,w,w,v1,v2,v3) with a .sort, discard every term that contains a self-pairing, a squared dot product, or one of the forbidden dot products v1.v2, v1.v3, v2.v3, then replace each remaining dot product by 1 and print the result.", "code": "AutoDeclare Vectors u, v, w, v1, v2, v3;\nLocal F = dd_(u,u,u,v,v,w,w,v1,v2,v3);\n.sort\nid v1?.v1? = 0;\nid v1?.v2?^2 = 0;\nid v1.v2 = 0;\nid v1.v3 = 0;\nid v2.v3 = 0;\nid v1?.v2? = 1;\nPrint F;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n AutoDeclare Vectors u, v, w, v1, v2, v3;\n Local F = dd_(u,u,u,v,v,w,w,v1,v2,v3);\n .sort\n\nTime = 0.00 sec Generated terms = 77\n F Terms in output = 77\n Bytes used = 4012\n id v1?.v1? = 0;\n id v1?.v2?^2 = 0;\n id v1.v2 = 0;\n id v1.v3 = 0;\n id v2.v3 = 0;\n id v1?.v2? = 1;\n Print F;\n .end\n\nTime = 0.00 sec Generated terms = 12\n F Terms in output = 1\n Bytes used = 20\n\n F =\n 288;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-22", "messages": [{"role": "user", "content": "Compute the expression a + b + c, then replace a with d - b and simplify to show the result is d + c."}, {"role": "assistant", "content": "Symbols a,b,c,d;\nLocal F = a + b + c;\nid a = d - b;\nPrint;\n.end"}], "instruction": "Compute the expression a + b + c, then replace a with d - b and simplify to show the result is d + c.", "code": "Symbols a,b,c,d;\nLocal F = a + b + c;\nid a = d - b;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols a,b,c,d;\n Local F = a + b + c;\n id a = d - b;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 4\n F Terms in output = 2\n Bytes used = 64\n\n F =\n d + c;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-23", "messages": [{"role": "user", "content": "Simplify the expression (x^2+1)^2 + x^2 + 2 by substituting x^2 with y-1, and then rewrite the result in terms of y."}, {"role": "assistant", "content": "Symbols x,y;\nLocal F = (x^2+1)^2 + x^2 + 2;\nid x^2 = y - 1;\nPrint;\n.end"}], "instruction": "Simplify the expression (x^2+1)^2 + x^2 + 2 by substituting x^2 with y-1, and then rewrite the result in terms of y.", "code": "Symbols x,y;\nLocal F = (x^2+1)^2 + x^2 + 2;\nid x^2 = y - 1;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols x,y;\n Local F = (x^2+1)^2 + x^2 + 2;\n id x^2 = y - 1;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 9\n F Terms in output = 3\n Bytes used = 76\n\n F =\n 1 + y + y^2;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-24", "messages": [{"role": "user", "content": "Compute the quaternion product (u + 3i \u2212 k)\u00b3(\u22121 + tj), where u and t are unknowns, and simplify the result to canonical form using the quaternion multiplication rules (i\u00b2 = j\u00b2 = k\u00b2 = \u22121, ij = k, jk = i, ki = j, and the anticommutation relations for distinct basis elements)."}, {"role": "assistant", "content": "Functions i,j,k;\nSymbols t,u;\nLocal F = (u+3*i-k)^3*(-1+t*j);\nrepeat;\nid i*j = k;\nid j*k = i;\nid k*i = j;\nid j*i = -k;\nid i*k = -j;\nid k*j = -i;\nid i*i = -1;\nid j*j = -1;\nid k*k = -1;\nendrepeat;\nBracket i,j,k;\nPrint;\n.end"}], "instruction": "Compute the quaternion product (u + 3i \u2212 k)\u00b3(\u22121 + tj), where u and t are unknowns, and simplify the result to canonical form using the quaternion multiplication rules (i\u00b2 = j\u00b2 = k\u00b2 = \u22121, ij = k, jk = i, ki = j, and the anticommutation relations for distinct basis elements).", "code": "Functions i,j,k;\nSymbols t,u;\nLocal F = (u+3*i-k)^3*(-1+t*j);\nrepeat;\nid i*j = k;\nid j*k = i;\nid k*i = j;\nid j*i = -k;\nid i*k = -j;\nid k*j = -i;\nid i*i = -1;\nid j*j = -1;\nid k*k = -1;\nendrepeat;\nBracket i,j,k;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Functions i,j,k;\n Symbols t,u;\n Local F = (u+3*i-k)^3*(-1+t*j);\n repeat;\n id i*j = k;\n id j*k = i;\n id k*i = j;\n id j*i = -k;\n id i*k = -j;\n id k*j = -i;\n id i*i = -1;\n id j*j = -1;\n id k*k = -1;\n endrepeat;\n Bracket i,j,k;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 54\n F Terms in output = 12\n Bytes used = 448\n\n F =\n + i * ( 30 - 9*u^2 - 10*t + 3*t*u^2 )\n\n + j * ( - 30*t*u + t*u^3 )\n\n + k * ( - 10 + 3*u^2 - 30*t + 9*t*u^2 )\n\n + 30*u - u^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-25", "messages": [{"role": "user", "content": "Compute the Poincar\u00e9-Birkhoff-Witt basis expansion of the product f\u00b3e\u00b2h, and also compute the commutator between h and he\u00b2f\u00b3, using the given commutation relations for the Lie algebra generated by h, e, and f."}, {"role": "assistant", "content": "Functions h,e,f;\nFunPowers allfunpowers;\nLocal F1 = f^3*e^2*h;\nLocal F2 = h * h*e^2*f^3 - h*e^2*f^3 * h;\nrepeat;\nid e*h = h*e - 2*e;\nid f*h = h*f + 2*f;\nid f*e = e*f - h;\nendrepeat;\nPrint;\n.end"}], "instruction": "Compute the Poincar\u00e9-Birkhoff-Witt basis expansion of the product f\u00b3e\u00b2h, and also compute the commutator between h and he\u00b2f\u00b3, using the given commutation relations for the Lie algebra generated by h, e, and f.", "code": "Functions h,e,f;\nFunPowers allfunpowers;\nLocal F1 = f^3*e^2*h;\nLocal F2 = h * h*e^2*f^3 - h*e^2*f^3 * h;\nrepeat;\nid e*h = h*e - 2*e;\nid f*h = h*f + 2*f;\nid f*e = e*f - h;\nendrepeat;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Functions h,e,f;\n FunPowers allfunpowers;\n Local F1 = f^3*e^2*h;\n Local F2 = h * h*e^2*f^3 - h*e^2*f^3 * h;\n repeat;\n id e*h = h*e - 2*e;\n id f*h = h*f + 2*f;\n id f*e = e*f - h;\n endrepeat;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 156\n F1 Terms in output = 9\n Bytes used = 460\n\nTime = 0.00 sec Generated terms = 7\n F2 Terms in output = 1\n Bytes used = 92\n\n F1 =\n 6*h^3*f - 6*h^2*e*f^2 + 30*h^2*f + h*e^2*f^3 - 18*h*e*f^2 + 48*h*f + 2*e\n ^2*f^3 - 12*e*f^2 + 24*f;\n\n F2 =\n - 2*h*e^2*f^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-26", "messages": [{"role": "user", "content": "Compute the simplified forms of the given expressions involving odd and even functions, applying the rules that odd functions change sign under negation of their argument while even functions remain unchanged."}, {"role": "assistant", "content": "Symbol x,y;\nFunctions odd, even;\nLocal ODD = odd(-x);\nLocal EVEN = even(-x);\nLocal F = odd(-x-y) + even(-x-y) + odd(x-y) + odd(-x+y);\nid odd(-x?) = - odd(x);\nid even(-x?) = even(x);\nPrint;\n.end"}], "instruction": "Compute the simplified forms of the given expressions involving odd and even functions, applying the rules that odd functions change sign under negation of their argument while even functions remain unchanged.", "code": "Symbol x,y;\nFunctions odd, even;\nLocal ODD = odd(-x);\nLocal EVEN = even(-x);\nLocal F = odd(-x-y) + even(-x-y) + odd(x-y) + odd(-x+y);\nid odd(-x?) = - odd(x);\nid even(-x?) = even(x);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbol x,y;\n Functions odd, even;\n Local ODD = odd(-x);\n Local EVEN = even(-x);\n Local F = odd(-x-y) + even(-x-y) + odd(x-y) + odd(-x+y);\n id odd(-x?) = - odd(x);\n id even(-x?) = even(x);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n ODD Terms in output = 1\n Bytes used = 40\n\nTime = 0.00 sec Generated terms = 1\n EVEN Terms in output = 1\n Bytes used = 40\n\nTime = 0.00 sec Generated terms = 4\n F Terms in output = 4\n Bytes used = 284\n\n ODD =\n - odd(x);\n\n EVEN =\n even(x);\n\n F =\n odd( - y - x) + odd( - y + x) + odd(y - x) + even( - y - x);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-27", "messages": [{"role": "user", "content": "Simplify the expressions sin\u00b2a \u2212 1 and sin\u00b3a by replacing sin\u00b2a with 1 \u2212 cos\u00b2a, and show the resulting simplified forms."}, {"role": "assistant", "content": "CFunctions sin, cos;\nSymbols a,x;\nLocal F1 = sin(a)^2 - 1;\nLocal F2 = sin(a)^3;\nid sin(x?)^2 = 1 - cos(x)^2;\nBracket sin;\nPrint;\n.end"}], "instruction": "Simplify the expressions sin\u00b2a \u2212 1 and sin\u00b3a by replacing sin\u00b2a with 1 \u2212 cos\u00b2a, and show the resulting simplified forms.", "code": "CFunctions sin, cos;\nSymbols a,x;\nLocal F1 = sin(a)^2 - 1;\nLocal F2 = sin(a)^3;\nid sin(x?)^2 = 1 - cos(x)^2;\nBracket sin;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n CFunctions sin, cos;\n Symbols a,x;\n Local F1 = sin(a)^2 - 1;\n Local F2 = sin(a)^3;\n id sin(x?)^2 = 1 - cos(x)^2;\n Bracket sin;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n F1 Terms in output = 1\n Bytes used = 72\n\nTime = 0.00 sec Generated terms = 2\n F2 Terms in output = 2\n Bytes used = 112\n\n F1 =\n - cos(a)^2;\n\n F2 =\n + sin(a) * ( 1 - cos(a)^2 );\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-28", "messages": [{"role": "user", "content": "Compute the Laguerre polynomial L(8,a,x) using the recursive definition, starting from L(0,a,x)=1 and L(1,a,x)=1+a\u2212x, and applying the recurrence relation for n>1."}, {"role": "assistant", "content": "* easy, but inefficient program\n*\nSymbols a,x,n;\nCFunction L;\nOn statistics;\nLocal Laguerre8 = L(8,a,x);\nrepeat;\nid L(0,a,x) = 1;\nid L(1,a,x) = 1+a-x;\nid L(n?,a,x) = (2*n+a-1-x)/n*L(n-1,a,x) - (n+a-1)/n*L(n-2,a,x);\nendrepeat;\nPrint;\n.end\n"}], "instruction": "Compute the Laguerre polynomial L(8,a,x) using the recursive definition, starting from L(0,a,x)=1 and L(1,a,x)=1+a\u2212x, and applying the recurrence relation for n>1.", "code": "* easy, but inefficient program\n*\nSymbols a,x,n;\nCFunction L;\nOn statistics;\nLocal Laguerre8 = L(8,a,x);\nrepeat;\nid L(0,a,x) = 1;\nid L(1,a,x) = 1+a-x;\nid L(n?,a,x) = (2*n+a-1-x)/n*L(n-1,a,x) - (n+a-1)/n*L(n-2,a,x);\nendrepeat;\nPrint;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n * easy, but inefficient program\n *\n Symbols a,x,n;\n CFunction L;\n On statistics;\n Local Laguerre8 = L(8,a,x);\n repeat;\n id L(0,a,x) = 1;\n id L(1,a,x) = 1+a-x;\n id L(n?,a,x) = (2*n+a-1-x)/n*L(n-1,a,x) - (n+a-1)/n*L(n-2,a,x);\n endrepeat;\n Print;\n .end\n\nTime = 0.17 sec Generated terms = 149505\n Laguerre8 Terms in output = 45\n Bytes used = 1256\n\n Laguerre8 =\n 1 - 8*x + 14*x^2 - 28/3*x^3 + 35/12*x^4 - 7/15*x^5 + 7/180*x^6 - 1/630*\n x^7 + 1/40320*x^8 + 761/280*a - 481/35*a*x + 341/20*a*x^2 - 743/90*a*x^3\n + 533/288*a*x^4 - 73/360*a*x^5 + 1/96*a*x^6 - 1/5040*a*x^7 + 29531/\n 10080*a^2 - 349/36*a^2*x + 6077/720*a^2*x^2 - 23/8*a^2*x^3 + 251/576*a^2\n *x^4 - 7/240*a^2*x^5 + 1/1440*a^2*x^6 + 267/160*a^3 - 329/90*a^3*x + 209/\n 96*a^3*x^2 - 71/144*a^3*x^3 + 13/288*a^3*x^4 - 1/720*a^3*x^5 + 1069/1920\n *a^4 - 115/144*a^4*x + 89/288*a^4*x^2 - 1/24*a^4*x^3 + 1/576*a^4*x^4 + 9/\n 80*a^5 - 73/720*a^5*x + 11/480*a^5*x^2 - 1/720*a^5*x^3 + 13/960*a^6 - 1/\n 144*a^6*x + 1/1440*a^6*x^2 + 1/1120*a^7 - 1/5040*a^7*x + 1/40320*a^8;\n\n 0.17 sec out of 0.17 sec\n", "form_rc": 0} | |
| {"task_id": "tut-29", "messages": [{"role": "user", "content": "Compute the Laguerre polynomial of degree 8 in the variable x, with parameter a, using the recurrence relation for Laguerre polynomials, and output the resulting polynomial expression."}, {"role": "assistant", "content": "* less obvious, but efficient program\n*\nSymbols a, x, n, last, secondlast, dummy;\nCFunction L;\nOn statistics;\nLocal Laguerre8 = L(2,1+a-x,1)*dummy^6;\nrepeat;\nid L( n?, last?, secondlast?) * dummy =\nL( n+1, (2*n+a+1-x)/(n+1)*last - (n+a)/(n+1)*secondlast, last );\nendrepeat;\nid L( n?, last?, secondlast? ) = last;\n.end"}], "instruction": "Compute the Laguerre polynomial of degree 8 in the variable x, with parameter a, using the recurrence relation for Laguerre polynomials, and output the resulting polynomial expression.", "code": "* less obvious, but efficient program\n*\nSymbols a, x, n, last, secondlast, dummy;\nCFunction L;\nOn statistics;\nLocal Laguerre8 = L(2,1+a-x,1)*dummy^6;\nrepeat;\nid L( n?, last?, secondlast?) * dummy =\nL( n+1, (2*n+a+1-x)/(n+1)*last - (n+a)/(n+1)*secondlast, last );\nendrepeat;\nid L( n?, last?, secondlast? ) = last;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n * less obvious, but efficient program\n *\n Symbols a, x, n, last, secondlast, dummy;\n CFunction L;\n On statistics;\n Local Laguerre8 = L(2,1+a-x,1)*dummy^6;\n repeat;\n id L( n?, last?, secondlast?) * dummy =\n L( n+1, (2*n+a+1-x)/(n+1)*last - (n+a)/(n+1)*secondlast, last );\n endrepeat;\n id L( n?, last?, secondlast? ) = last;\n .end\n\nTime = 0.00 sec Generated terms = 36\n Laguerre8 Terms in output = 36\n Bytes used = 1016\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-30", "messages": [{"role": "user", "content": "Compute the indefinite integral of the polynomial 1 + x + x^3 with respect to x."}, {"role": "assistant", "content": "Symbols x,dx,n;\n*\n* Next could be any polynomial in x\n*\nLocal P = 1+x+x^3;\n*\n* Tag the expression and apply differentiation rule\n*\nmultiply dx;\nid dx*x^n? = 1/(n+1)*x^(n+1);\nPrint;\n.end"}], "instruction": "Compute the indefinite integral of the polynomial 1 + x + x^3 with respect to x.", "code": "Symbols x,dx,n;\n*\n* Next could be any polynomial in x\n*\nLocal P = 1+x+x^3;\n*\n* Tag the expression and apply differentiation rule\n*\nmultiply dx;\nid dx*x^n? = 1/(n+1)*x^(n+1);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols x,dx,n;\n *\n * Next could be any polynomial in x\n *\n Local P = 1+x+x^3;\n *\n * Tag the expression and apply differentiation rule\n *\n multiply dx;\n id dx*x^n? = 1/(n+1)*x^(n+1);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n P Terms in output = 3\n Bytes used = 84\n\n P =\n x + 1/2*x^2 + 1/4*x^4;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-31", "messages": [{"role": "user", "content": "Compute the expression X\u00b2 + Y\u00b2 + Z\u00b2 \u2212 T\u00b2, where X, Y, Z, and T are defined as the Lorentz-transformed coordinates, and simplify it to show that it equals x\u00b2 + y\u00b2 + z\u00b2 \u2212 c\u00b2t\u00b2."}, {"role": "assistant", "content": "Symbols t, x, y, z, v, c, gamma, [c^2-v^2];\nLocal X = gamma*(x-v*t);\nLocal Y = y;\nLocal Z = z;\nLocal T = c*gamma*(t-v*x/c^2);\nLocal S = X^2 + Y^2 + Z^2 - T^2;\nid gamma^2 = c^2/[c^2-v^2];\nrepeat;\nid c^2/[c^2-v^2] = 1 + v^2/[c^2-v^2];\nendrepeat;\nPrint S;\n.end"}], "instruction": "Compute the expression X\u00b2 + Y\u00b2 + Z\u00b2 \u2212 T\u00b2, where X, Y, Z, and T are defined as the Lorentz-transformed coordinates, and simplify it to show that it equals x\u00b2 + y\u00b2 + z\u00b2 \u2212 c\u00b2t\u00b2.", "code": "Symbols t, x, y, z, v, c, gamma, [c^2-v^2];\nLocal X = gamma*(x-v*t);\nLocal Y = y;\nLocal Z = z;\nLocal T = c*gamma*(t-v*x/c^2);\nLocal S = X^2 + Y^2 + Z^2 - T^2;\nid gamma^2 = c^2/[c^2-v^2];\nrepeat;\nid c^2/[c^2-v^2] = 1 + v^2/[c^2-v^2];\nendrepeat;\nPrint S;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols t, x, y, z, v, c, gamma, [c^2-v^2];\n Local X = gamma*(x-v*t);\n Local Y = y;\n Local Z = z;\n Local T = c*gamma*(t-v*x/c^2);\n Local S = X^2 + Y^2 + Z^2 - T^2;\n id gamma^2 = c^2/[c^2-v^2];\n repeat;\n id c^2/[c^2-v^2] = 1 + v^2/[c^2-v^2];\n endrepeat;\n Print S;\n .end\n\nTime = 0.00 sec Generated terms = 2\n X Terms in output = 2\n Bytes used = 92\n\nTime = 0.00 sec Generated terms = 1\n Y Terms in output = 1\n Bytes used = 36\n\nTime = 0.00 sec Generated terms = 1\n Z Terms in output = 1\n Bytes used = 36\n\nTime = 0.00 sec Generated terms = 2\n T Terms in output = 2\n Bytes used = 108\n\nTime = 0.00 sec Generated terms = 14\n S Terms in output = 4\n Bytes used = 132\n\n S =\n z^2 + y^2 + x^2 - t^2*c^2;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-32", "messages": [{"role": "user", "content": "Simplify the determinant expressions det(M^5) and det(A*B*C) into factored forms, showing that det(M^5) becomes det(M)^5 and det(A*B*C) becomes det(A)*det(B)*det(C)."}, {"role": "assistant", "content": "Symbol M,A,B,C,n;\nCFunction det;\nFunPowers allfunpowers;\nLocal F5 = det(M^5);\nLocal F3 = det(A*B*C);\nid det(M?)=M;\nrepeat;\nid M?=det(M);\nendrepeat;\nPrint;\n.end"}], "instruction": "Simplify the determinant expressions det(M^5) and det(A*B*C) into factored forms, showing that det(M^5) becomes det(M)^5 and det(A*B*C) becomes det(A)*det(B)*det(C).", "code": "Symbol M,A,B,C,n;\nCFunction det;\nFunPowers allfunpowers;\nLocal F5 = det(M^5);\nLocal F3 = det(A*B*C);\nid det(M?)=M;\nrepeat;\nid M?=det(M);\nendrepeat;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbol M,A,B,C,n;\n CFunction det;\n FunPowers allfunpowers;\n Local F5 = det(M^5);\n Local F3 = det(A*B*C);\n id det(M?)=M;\n repeat;\n id M?=det(M);\n endrepeat;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n F5 Terms in output = 1\n Bytes used = 120\n\nTime = 0.00 sec Generated terms = 1\n F3 Terms in output = 1\n Bytes used = 80\n\n F5 =\n det(M)^5;\n\n F3 =\n det(A)*det(B)*det(C);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-33", "messages": [{"role": "user", "content": "Show that the tensor T\u0304_ij, defined as U_i V_j \u2212 V_i U_j, transforms covariantly under coordinate changes by expressing it in terms of the original tensor T_kl."}, {"role": "assistant", "content": "Tensors [T_kl],U,V,t;\nIndices i,j,k,l,low,up,dx,dxbar;\nLocal [Tbar_ij] = U(i,low)*V(j,low) - V(i,low)*U(j,low);\nid U?(i,low) = t(dx,k,up,dxbar,i,low) * U(k,low);\nid U?(j,low) = t(dx,l,up,dxbar,j,low) * U(l,low);\nid U(k,low) * V(l,low) = [T_kl] + V(k,low)*U(l,low);\nPrint;\n.end"}], "instruction": "Show that the tensor T\u0304_ij, defined as U_i V_j \u2212 V_i U_j, transforms covariantly under coordinate changes by expressing it in terms of the original tensor T_kl.", "code": "Tensors [T_kl],U,V,t;\nIndices i,j,k,l,low,up,dx,dxbar;\nLocal [Tbar_ij] = U(i,low)*V(j,low) - V(i,low)*U(j,low);\nid U?(i,low) = t(dx,k,up,dxbar,i,low) * U(k,low);\nid U?(j,low) = t(dx,l,up,dxbar,j,low) * U(l,low);\nid U(k,low) * V(l,low) = [T_kl] + V(k,low)*U(l,low);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Tensors [T_kl],U,V,t;\n Indices i,j,k,l,low,up,dx,dxbar;\n Local [Tbar_ij] = U(i,low)*V(j,low) - V(i,low)*U(j,low);\n id U?(i,low) = t(dx,k,up,dxbar,i,low) * U(k,low);\n id U?(j,low) = t(dx,l,up,dxbar,j,low) * U(l,low);\n id U(k,low) * V(l,low) = [T_kl] + V(k,low)*U(l,low);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n [Tbar_ij] Terms in output = 1\n Bytes used = 104\n\n [Tbar_ij] =\n [T_kl]*t(dx,k,up,dxbar,i,low)*t(dx,l,up,dxbar,j,low);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-34", "messages": [{"role": "user", "content": "Compute the explicit expansion of the triple sum over indices r, s, and t of the product a(r,s,t) x_r y_s z_t for the case where each index runs from 1 to 2, writing out all terms."}, {"role": "assistant", "content": "Tensor a,dummy;\nVectors x,y,z;\nIndices r,s,t;\nLocal expr = a(r,s,t)*x(r)*y(s)*z(t);\nmultiply dummy();\nrepeat;\nid a(?p,z?)*dummy(?q)=a(?p)*dummy(1,?q)*z(1)+a(?p)*dummy(2,?q)*z(2);\nendrepeat;\nid a()*dummy(?p)=a(?p);\nFormat 65;\nPrint;\n.end"}], "instruction": "Compute the explicit expansion of the triple sum over indices r, s, and t of the product a(r,s,t) x_r y_s z_t for the case where each index runs from 1 to 2, writing out all terms.", "code": "Tensor a,dummy;\nVectors x,y,z;\nIndices r,s,t;\nLocal expr = a(r,s,t)*x(r)*y(s)*z(t);\nmultiply dummy();\nrepeat;\nid a(?p,z?)*dummy(?q)=a(?p)*dummy(1,?q)*z(1)+a(?p)*dummy(2,?q)*z(2);\nendrepeat;\nid a()*dummy(?p)=a(?p);\nFormat 65;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Tensor a,dummy;\n Vectors x,y,z;\n Indices r,s,t;\n Local expr = a(r,s,t)*x(r)*y(s)*z(t);\n multiply dummy();\n repeat;\n id a(?p,z?)*dummy(?q)=a(?p)*dummy(1,?q)*z(1)+a(?p)*dummy(2,?q)*z(2);\n endrepeat;\n id a()*dummy(?p)=a(?p);\n Format 65;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 8\n expr Terms in output = 8\n Bytes used = 484\n\n expr =\n a(1,1,1)*x(1)*y(1)*z(1) + a(1,1,2)*x(1)*y(1)*z(2) + a(1,2,\n 1)*x(1)*y(2)*z(1) + a(1,2,2)*x(1)*y(2)*z(2) + a(2,1,1)*\n x(2)*y(1)*z(1) + a(2,1,2)*x(2)*y(1)*z(2) + a(2,2,1)*x(2)*\n y(2)*z(1) + a(2,2,2)*x(2)*y(2)*z(2);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-35", "messages": [{"role": "user", "content": "Expand the tensor t(m1,m2,m3) into a product of vector components v(m1)*v(m2)*v(m3) using recursive wildcard substitution, and print the result."}, {"role": "assistant", "content": "Tensor t;\nVector v;\nIndices m1,m2,m3;\nLocal F = t(m1,m2,m3);\nrepeat;\nid t(m1?,?m) = v(m1)*t(?m);\nendrepeat;\nid t() = 1;\nPrint;\n.end\n"}], "instruction": "Expand the tensor t(m1,m2,m3) into a product of vector components v(m1)*v(m2)*v(m3) using recursive wildcard substitution, and print the result.", "code": "Tensor t;\nVector v;\nIndices m1,m2,m3;\nLocal F = t(m1,m2,m3);\nrepeat;\nid t(m1?,?m) = v(m1)*t(?m);\nendrepeat;\nid t() = 1;\nPrint;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Tensor t;\n Vector v;\n Indices m1,m2,m3;\n Local F = t(m1,m2,m3);\n repeat;\n id t(m1?,?m) = v(m1)*t(?m);\n endrepeat;\n id t() = 1;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n F Terms in output = 1\n Bytes used = 52\n\n F =\n v(m1)*v(m2)*v(m3);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-36", "messages": [{"role": "user", "content": "Compute the expression J(n, z) = (-1)^n J(-n, z) for n = -3, -4, and a general negative n, and also for n = 4, to verify the rule for natural numbers."}, {"role": "assistant", "content": "Symbols z,n;\nFunction J;\nLocal [J(-3,z)] = J(-3,z);\nLocal [J(-4,z)] = J(-4,z);\nLocal [J(-n,z)] = J(-n,z);\nLocal [J( 4,z)] = J( 4,z);\nid J(n?neg_, ?z) = (-1)^(-n) * J(-n, ?z);\nPrint;\n.end"}], "instruction": "Compute the expression J(n, z) = (-1)^n J(-n, z) for n = -3, -4, and a general negative n, and also for n = 4, to verify the rule for natural numbers.", "code": "Symbols z,n;\nFunction J;\nLocal [J(-3,z)] = J(-3,z);\nLocal [J(-4,z)] = J(-4,z);\nLocal [J(-n,z)] = J(-n,z);\nLocal [J( 4,z)] = J( 4,z);\nid J(n?neg_, ?z) = (-1)^(-n) * J(-n, ?z);\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols z,n;\n Function J;\n Local [J(-3,z)] = J(-3,z);\n Local [J(-4,z)] = J(-4,z);\n Local [J(-n,z)] = J(-n,z);\n Local [J( 4,z)] = J( 4,z);\n id J(n?neg_, ?z) = (-1)^(-n) * J(-n, ?z);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n [J(-3,z)] Terms in output = 1\n Bytes used = 48\n\nTime = 0.00 sec Generated terms = 1\n [J(-4,z)] Terms in output = 1\n Bytes used = 48\n\nTime = 0.00 sec Generated terms = 1\n [J(-n,z)] Terms in output = 1\n Bytes used = 80\n\nTime = 0.00 sec Generated terms = 1\n [J(4,z)] Terms in output = 1\n Bytes used = 48\n\n [J(-3,z)] =\n - J(3,z);\n\n [J(-4,z)] =\n J(4,z);\n\n [J(-n,z)] =\n J( - n,z);\n\n [J(4,z)] =\n J(4,z);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-37", "messages": [{"role": "user", "content": "Compute the derivative of the inverse cube of a matrix M with respect to t, using the given rule for the derivative of the inverse of M."}, {"role": "assistant", "content": "Functions M, [dM/dt], dt;\nFunPowers allfunpowers;\nLocal F = 1/M * 1/M * 1/M;\nmultiply left dt;\nrepeat;\nid dt*1/M = -1/M*[dM/dt]*1/M + 1/M*dt;\nendrepeat;\nid dt=0;\nPrint;\n.end"}], "instruction": "Compute the derivative of the inverse cube of a matrix M with respect to t, using the given rule for the derivative of the inverse of M.", "code": "Functions M, [dM/dt], dt;\nFunPowers allfunpowers;\nLocal F = 1/M * 1/M * 1/M;\nmultiply left dt;\nrepeat;\nid dt*1/M = -1/M*[dM/dt]*1/M + 1/M*dt;\nendrepeat;\nid dt=0;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Functions M, [dM/dt], dt;\n FunPowers allfunpowers;\n Local F = 1/M * 1/M * 1/M;\n multiply left dt;\n repeat;\n id dt*1/M = -1/M*[dM/dt]*1/M + 1/M*dt;\n endrepeat;\n id dt=0;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n F Terms in output = 3\n Bytes used = 240\n\n F =\n - 1/(M)^3*[dM/dt]/(M) - 1/(M)^2*[dM/dt]/(M)^2 - 1/(M)*[dM/dt]/(M)^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-38", "messages": [{"role": "user", "content": "Compute the derivative of x\u2074 ln\u00b2(x) with respect to x."}, {"role": "assistant", "content": "Symbols x,y,n;\nCFunctions log,g;\nFunctions [log],[1/x],f,dx;\nSet commuting:log;\nSet noncommuting:[log];\nSet derivative:[1/x];\n*\nLocal expr = x^4*log(x)^2;\nid g?commuting?noncommuting(x) = g(x);\nMultiply left dx;\nrepeat;\nid dx*g?noncommuting[n](x) = derivative[n](x)+g(x)*dx;\nendrepeat;\nid dx*x^n? = n*x^(n-1);\nid [1/x](x) = 1/x;\nid f?noncommuting?commuting(x) = f(x);\n*\nPrint;\n.end"}], "instruction": "Compute the derivative of x\u2074 ln\u00b2(x) with respect to x.", "code": "Symbols x,y,n;\nCFunctions log,g;\nFunctions [log],[1/x],f,dx;\nSet commuting:log;\nSet noncommuting:[log];\nSet derivative:[1/x];\n*\nLocal expr = x^4*log(x)^2;\nid g?commuting?noncommuting(x) = g(x);\nMultiply left dx;\nrepeat;\nid dx*g?noncommuting[n](x) = derivative[n](x)+g(x)*dx;\nendrepeat;\nid dx*x^n? = n*x^(n-1);\nid [1/x](x) = 1/x;\nid f?noncommuting?commuting(x) = f(x);\n*\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols x,y,n;\n CFunctions log,g;\n Functions [log],[1/x],f,dx;\n Set commuting:log;\n Set noncommuting:[log];\n Set derivative:[1/x];\n *\n Local expr = x^4*log(x)^2;\n id g?commuting?noncommuting(x) = g(x);\n Multiply left dx;\n repeat;\n id dx*g?noncommuting[n](x) = derivative[n](x)+g(x)*dx;\n endrepeat;\n id dx*x^n? = n*x^(n-1);\n id [1/x](x) = 1/x;\n id f?noncommuting?commuting(x) = f(x);\n *\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n expr Terms in output = 2\n Bytes used = 112\n\n expr =\n 2*log(x)*x^3 + 4*log(x)^2*x^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-39", "messages": [{"role": "user", "content": "Compute the integrals of x\u2074cos(x) and x\u2074sin(x) with respect to x using recursion."}, {"role": "assistant", "content": "Symbols x, y, [sin(x)], [cos(x)], n, dx;\nSet fromx: x, [sin(x)], [cos(x)];\n*\nLocal exprcos = x^4*[cos(x)];\nLocal exprsin = x^4*[sin(x)];\nMultiply dx;\nrepeat;\nid select fromx dx*[sin(x)] = - [cos(x)];\nid select fromx dx*[cos(x)] = [sin(x)];\nid select fromx dx*x^n?*[sin(x)] =\n- x^n*[cos(x)] + dx*n*x^(n-1)*[cos(x)];\nid select fromx dx*x^n?*[cos(x)] =\nx^n*[sin(x)] - dx*n*x^(n-1)*[sin(x)];\nendrepeat;\n*\nFormat 60;\nPrint;\n.end"}], "instruction": "Compute the integrals of x\u2074cos(x) and x\u2074sin(x) with respect to x using recursion.", "code": "Symbols x, y, [sin(x)], [cos(x)], n, dx;\nSet fromx: x, [sin(x)], [cos(x)];\n*\nLocal exprcos = x^4*[cos(x)];\nLocal exprsin = x^4*[sin(x)];\nMultiply dx;\nrepeat;\nid select fromx dx*[sin(x)] = - [cos(x)];\nid select fromx dx*[cos(x)] = [sin(x)];\nid select fromx dx*x^n?*[sin(x)] =\n- x^n*[cos(x)] + dx*n*x^(n-1)*[cos(x)];\nid select fromx dx*x^n?*[cos(x)] =\nx^n*[sin(x)] - dx*n*x^(n-1)*[sin(x)];\nendrepeat;\n*\nFormat 60;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols x, y, [sin(x)], [cos(x)], n, dx;\n Set fromx: x, [sin(x)], [cos(x)];\n *\n Local exprcos = x^4*[cos(x)];\n Local exprsin = x^4*[sin(x)];\n Multiply dx;\n repeat;\n id select fromx dx*[sin(x)] = - [cos(x)];\n id select fromx dx*[cos(x)] = [sin(x)];\n id select fromx dx*x^n?*[sin(x)] =\n - x^n*[cos(x)] + dx*n*x^(n-1)*[cos(x)];\n id select fromx dx*x^n?*[cos(x)] =\n x^n*[sin(x)] - dx*n*x^(n-1)*[sin(x)];\n endrepeat;\n *\n Format 60;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 5\n exprcos Terms in output = 5\n Bytes used = 172\n\nTime = 0.00 sec Generated terms = 5\n exprsin Terms in output = 5\n Bytes used = 172\n\n exprcos =\n 24*[sin(x)] - 24*x*[cos(x)] - 12*x^2*[sin(x)] + 4*x^3\n *[cos(x)] + x^4*[sin(x)];\n\n exprsin =\n - 24*[cos(x)] - 24*x*[sin(x)] + 12*x^2*[cos(x)] + 4*\n x^3*[sin(x)] - x^4*[cos(x)];\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-40", "messages": [{"role": "user", "content": "Show that the inner product U = S^ij T_jl transforms as a mixed tensor under a coordinate change: express the transformed product Ubar = Sbar^ij Tbar_jl in terms of the original S and T, the transformation matrices dxbar(i,p) = dxbar^i/dx^p and dx(s,l) = dx^s/dxbar^l, and simplify to the form dxbar(i,p)*dx(s,l)*U(p,s)."}, {"role": "assistant", "content": "Indices i, j, l, p, q, r, s;\nFunctions S, T, U, dxbar, dx;\nLocal Ubar = S(p,q)*T(r,s)*dxbar(i,p)*dxbar(j,q)*dx(r,j)*dx(s,l);\nrepeat;\n id dxbar(j?,q?)*dx(r?,j?) = d_(q,r);\nendrepeat;\nid S(p?,q?)*T(q?,s?) = U(p,s);\nPrint;\n.end\n"}], "instruction": "Show that the inner product U = S^ij T_jl transforms as a mixed tensor under a coordinate change: express the transformed product Ubar = Sbar^ij Tbar_jl in terms of the original S and T, the transformation matrices dxbar(i,p) = dxbar^i/dx^p and dx(s,l) = dx^s/dxbar^l, and simplify to the form dxbar(i,p)*dx(s,l)*U(p,s).", "code": "Indices i, j, l, p, q, r, s;\nFunctions S, T, U, dxbar, dx;\nLocal Ubar = S(p,q)*T(r,s)*dxbar(i,p)*dxbar(j,q)*dx(r,j)*dx(s,l);\nrepeat;\n id dxbar(j?,q?)*dx(r?,j?) = d_(q,r);\nendrepeat;\nid S(p?,q?)*T(q?,s?) = U(p,s);\nPrint;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Indices i, j, l, p, q, r, s;\n Functions S, T, U, dxbar, dx;\n Local Ubar = S(p,q)*T(r,s)*dxbar(i,p)*dxbar(j,q)*dx(r,j)*dx(s,l);\n repeat;\n id dxbar(j?,q?)*dx(r?,j?) = d_(q,r);\n endrepeat;\n id S(p?,q?)*T(q?,s?) = U(p,s);\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n Ubar Terms in output = 1\n Bytes used = 104\n\n Ubar =\n U(p,s)*dxbar(i,p)*dx(s,l);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-41", "messages": [{"role": "user", "content": "Compute the expanded forms of sin(2a), sin(3a), and sin(4a) using the double-angle identity sin(2x) = 2sin(x)cos(x), applying it repeatedly until no further simplification is possible."}, {"role": "assistant", "content": "CFunctions sin,cos,f;\nSymbols a,b,x;\nLocal expr1 = sin(2*a);\nLocal expr2 = sin(3*a);\nLocal expr3 = sin(4*a);\nrepeat;\nid sin(2*x?)=2*sin(x)*cos(x);\nid sin(4*x?)=2*sin(2*x)*cos(2*x);\nendrepeat;\nPrint;\n.end"}], "instruction": "Compute the expanded forms of sin(2a), sin(3a), and sin(4a) using the double-angle identity sin(2x) = 2sin(x)cos(x), applying it repeatedly until no further simplification is possible.", "code": "CFunctions sin,cos,f;\nSymbols a,b,x;\nLocal expr1 = sin(2*a);\nLocal expr2 = sin(3*a);\nLocal expr3 = sin(4*a);\nrepeat;\nid sin(2*x?)=2*sin(x)*cos(x);\nid sin(4*x?)=2*sin(2*x)*cos(2*x);\nendrepeat;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n CFunctions sin,cos,f;\n Symbols a,b,x;\n Local expr1 = sin(2*a);\n Local expr2 = sin(3*a);\n Local expr3 = sin(4*a);\n repeat;\n id sin(2*x?)=2*sin(x)*cos(x);\n id sin(4*x?)=2*sin(2*x)*cos(2*x);\n endrepeat;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 1\n expr1 Terms in output = 1\n Bytes used = 60\n\nTime = 0.00 sec Generated terms = 1\n expr2 Terms in output = 1\n Bytes used = 72\n\nTime = 0.00 sec Generated terms = 1\n expr3 Terms in output = 1\n Bytes used = 112\n\n expr1 =\n 2*sin(a)*cos(a);\n\n expr2 =\n sin(3*a);\n\n expr3 =\n 4*sin(a)*cos(a)*cos(2*a);\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-42", "messages": [{"role": "user", "content": "Compute the expression 1 + y\u00b2x\u2074 + y\u00b3x\u2075 + y\u2074x\u2076 + y\u2075x\u2077, and for each term check whether the weighted count of y (with weight -1) plus twice the count of x exceeds 7; discard any term for which it does, and print the remaining terms."}, {"role": "assistant", "content": "Symbols x,y;\nLocal F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\nif (count(y,-1,x,2) > 7);\ndiscard;\nendif;\nPrint;\n.end\n"}], "instruction": "Compute the expression 1 + y\u00b2x\u2074 + y\u00b3x\u2075 + y\u2074x\u2076 + y\u2075x\u2077, and for each term check whether the weighted count of y (with weight -1) plus twice the count of x exceeds 7; discard any term for which it does, and print the remaining terms.", "code": "Symbols x,y;\nLocal F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\nif (count(y,-1,x,2) > 7);\ndiscard;\nendif;\nPrint;\n.end\n", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols x,y;\n Local F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\n if (count(y,-1,x,2) > 7);\n discard;\n endif;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n F Terms in output = 3\n Bytes used = 92\n\n F =\n 1 + x^4*y^2 + x^5*y^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |
| {"task_id": "tut-43", "messages": [{"role": "user", "content": "Compute the sum of the terms in the expression, but only keep it if the weighted count of y and x (with y counted as -1 and x as 2) exceeds 7; otherwise, discard the entire expression."}, {"role": "assistant", "content": "Symbols x,y;\nLocal F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\nif (count(y,-1,x,2) > 7);\ndiscard;\nendif;\nPrint;\n.end"}], "instruction": "Compute the sum of the terms in the expression, but only keep it if the weighted count of y and x (with y counted as -1 and x as 2) exceeds 7; otherwise, discard the entire expression.", "code": "Symbols x,y;\nLocal F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\nif (count(y,-1,x,2) > 7);\ndiscard;\nendif;\nPrint;\n.end", "form_stdout": "FORM 5.0 (Apr 8 2025) Run: Sat Sep 19 21:23:47 2026\n Symbols x,y;\n Local F = 1 + y^2*x^4 + y^3*x^5 + y^4*x^6 + y^5*x^7;\n if (count(y,-1,x,2) > 7);\n discard;\n endif;\n Print;\n .end\n\nTime = 0.00 sec Generated terms = 3\n F Terms in output = 3\n Bytes used = 92\n\n F =\n 1 + x^4*y^2 + x^5*y^3;\n\n 0.00 sec out of 0.00 sec\n", "form_rc": 0} | |