Skip to content

Commit d596dba

Browse files
committed
Changes to compatibility for DoFun/QMeS
1 parent 5c91954 commit d596dba

13 files changed

Lines changed: 1070 additions & 168 deletions

File tree

FunKit.m

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
FInstalledPaclet,FInstalledVersion},
2626

2727
FCurPacletAddr="https://github.com/satfra/FunKit/raw/refs/heads/main/PacletInfo.m";
28-
FCurPaclet=Import[FCurPacletAddr];
28+
FCurPaclet=TimeConstrained[Import[FCurPacletAddr],2,$Failed];
2929

3030
If[FCurPaclet=!=$Failed,
3131
FCurPaclet=(List@@FCurPaclet)[[1]];
@@ -91,12 +91,6 @@
9191
StyleBox[\"dependencies\",\nFontSize->10,\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"]\)\!\(\*
9292
StyleBox[\"...\",\nFontSize->10,\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"]\)"];
9393

94-
If[$OperatingSystem === "Windows" && !TrueQ[Global`$UseFORMOnWindows],
95-
Print["FunKit: Skipping TensorBases (not available on Windows without FORM). Set Global`$UseFORMOnWindows = True before loading FunKit to override."];
96-
,
97-
If[$OperatingSystem === "Windows" && TrueQ[Global`$UseFORMOnWindows],
98-
Print["FunKit: Loading TensorBases on Windows -- user has set Global`$UseFORMOnWindows = True. Ensure FormTracer/FORM are available."];
99-
];
10094
TensorBasesInstalled[]:=Module[{TensorBasesDirectory},
10195
TensorBasesDirectory=SelectFirst[
10296
Join[
@@ -131,7 +125,6 @@
131125
StyleBox[\"TensorBases\",\nFontSize->10,\nFontWeight->\"Bold\",\nFontSlant->\"Italic\"]\)\!\(\*
132126
StyleBox[\" \",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*
133127
StyleBox[\"loaded\",\nFontSize->10,\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"]\)"];
134-
];
135128

136129

137130
(* ::Input::Initialization:: *)
@@ -255,26 +248,18 @@
255248
StyleBox[\"DiANE\",\nFontSize->10,\nFontWeight->\"Bold\",\nFontSlant->\"Italic\"]\)\!\(\*
256249
StyleBox[\" \",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*
257250
StyleBox[\"loaded\",\nFontSize->10,\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"]\)"];
258-
If[$OperatingSystem === "Windows" && !TrueQ[Global`$UseFORMOnWindows],
259-
Print["FunKit: Skipping DiRK module (requires TensorBases). Set Global`$UseFORMOnWindows = True before loading FunKit to override."];
260-
,
261251
Get[$FunKitDirectory<>"modules/DiRK.m"];
262252
PrintTemporary["\!\(\*
263253
StyleBox[\"...\",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*
264254
StyleBox[\"DiRK\",\nFontSize->10,\nFontWeight->\"Bold\",\nFontSlant->\"Italic\"]\)\!\(\*
265255
StyleBox[\" \",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*
266256
StyleBox[\"loaded\",\nFontSize->10,\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"]\)"];
267-
];
268-
If[$OperatingSystem === "Windows" && !TrueQ[Global`$UseFORMOnWindows],
269-
Print["FunKit: Skipping TRACY module (requires FORM/FormTracer). Set Global`$UseFORMOnWindows = True before loading FunKit to override."];
270-
,
271257
Get[$FunKitDirectory<>"modules/TRACY.m"];
272258
PrintTemporary["\!\(\*
273259
StyleBox[\"...\",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*
274260
StyleBox[\"TRACY\",\nFontSize->10,\nFontWeight->\"Bold\",\nFontSlant->\"Italic\"]\)\!\(\*
275261
StyleBox[\" \",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*
276262
StyleBox[\"loaded\",\nFontSize->10,\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"]\)"];
277-
];
278263
Get[$FunKitDirectory<>"modules/COEN.m"];
279264
PrintTemporary["\!\(\*
280265
StyleBox[\"...\",\nFontSize->10,\nFontSlant->\"Italic\"]\)\!\(\*

FunKit.nb

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
NotebookFileLineBreakTest
1111
NotebookFileLineBreakTest
1212
NotebookDataPosition[ 154, 7]
13-
NotebookDataLength[ 58817, 1327]
14-
NotebookOptionsPosition[ 54421, 1238]
15-
NotebookOutlinePosition[ 54876, 1256]
16-
CellTagsIndexPosition[ 54833, 1253]
13+
NotebookDataLength[ 59121, 1332]
14+
NotebookOptionsPosition[ 54724, 1243]
15+
NotebookOutlinePosition[ 55179, 1261]
16+
CellTagsIndexPosition[ 55136, 1258]
1717
WindowFrame->Normal*)
1818

1919
(* Beginning of Notebook Content *)
@@ -68,8 +68,11 @@ Cell[BoxData[
6868
"\"\<https://github.com/satfra/FunKit/raw/refs/heads/main/PacletInfo.\
6969
m\>\""}], ";", "\[IndentingNewLine]",
7070
RowBox[{"FCurPaclet", "=",
71-
RowBox[{"Import", "[", "FCurPacletAddr", "]"}]}], ";",
72-
"\[IndentingNewLine]", "\[IndentingNewLine]",
71+
RowBox[{"TimeConstrained", "[",
72+
RowBox[{
73+
RowBox[{"Import", "[", "FCurPacletAddr", "]"}], ",", "2", ",",
74+
"$Failed"}], "]"}]}], ";", "\[IndentingNewLine]",
75+
"\[IndentingNewLine]",
7376
RowBox[{"If", "[",
7477
RowBox[{
7578
RowBox[{"FCurPaclet", "=!=", "$Failed"}], ",",
@@ -152,8 +155,10 @@ new features!\>\"", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}],
152155
3.983259060650054*^9, 3.983259073578887*^9}, {3.983259104630189*^9,
153156
3.983259111706098*^9}, {3.9832591571122503`*^9, 3.983259158683097*^9}, {
154157
3.983259249135556*^9, 3.9832593226035147`*^9}, {3.983259404590269*^9,
155-
3.983259419578163*^9},
156-
3.984107722254324*^9},ExpressionUUID->"fc6ea956-4f03-4713-ac8c-\
158+
3.983259419578163*^9}, 3.984107722254324*^9, {3.984538220096855*^9,
159+
3.984538228032502*^9}, {3.984538263140874*^9, 3.984538291456411*^9}, {
160+
3.9845388330004063`*^9, 3.984538837196621*^9}, {3.98453978940454*^9,
161+
3.984539789500387*^9}},ExpressionUUID->"fc6ea956-4f03-4713-ac8c-\
157162
8ce6e6542b87"]
158163
}, Open ]],
159164

@@ -1260,72 +1265,72 @@ Cell[CellGroupData[{
12601265
Cell[1160, 35, 151, 3, 67, "Title",ExpressionUUID->"3edd37f6-e6ee-46fd-bdbb-e9eec3794061"],
12611266
Cell[CellGroupData[{
12621267
Cell[1336, 42, 164, 3, 47, "Chapter",ExpressionUUID->"2f936df3-40b7-4534-a1c0-f7f827071b5f"],
1263-
Cell[1503, 47, 5175, 109, 522, "Input",ExpressionUUID->"fc6ea956-4f03-4713-ac8c-8ce6e6542b87",
1268+
Cell[1503, 47, 5478, 114, 522, "Input",ExpressionUUID->"fc6ea956-4f03-4713-ac8c-8ce6e6542b87",
12641269
InitializationCell->True]
12651270
}, Open ]],
12661271
Cell[CellGroupData[{
1267-
Cell[6715, 161, 271, 4, 47, "Chapter",ExpressionUUID->"291f640c-487b-4f30-9942-6958673dcd5e"],
1268-
Cell[6989, 167, 2367, 53, 251, "Input",ExpressionUUID->"117cd3b6-a15f-4718-9e05-00d79dca8ab1",
1272+
Cell[7018, 166, 271, 4, 47, "Chapter",ExpressionUUID->"291f640c-487b-4f30-9942-6958673dcd5e"],
1273+
Cell[7292, 172, 2367, 53, 251, "Input",ExpressionUUID->"117cd3b6-a15f-4718-9e05-00d79dca8ab1",
12691274
InitializationCell->True],
1270-
Cell[9359, 222, 1924, 45, 204, "Input",ExpressionUUID->"259e2f7b-ed26-4ac9-90b6-12ae40f229f2",
1275+
Cell[9662, 227, 1924, 45, 204, "Input",ExpressionUUID->"259e2f7b-ed26-4ac9-90b6-12ae40f229f2",
12711276
InitializationCell->True],
1272-
Cell[11286, 269, 6264, 140, 592, "Input",ExpressionUUID->"4600f702-b623-4c77-bc43-2b8669b8e0af",
1277+
Cell[11589, 274, 6264, 140, 592, "Input",ExpressionUUID->"4600f702-b623-4c77-bc43-2b8669b8e0af",
12731278
InitializationCell->True],
1274-
Cell[17553, 411, 1991, 43, 143, "Input",ExpressionUUID->"b6352d19-2461-4c4a-a46c-48016be58972",
1279+
Cell[17856, 416, 1991, 43, 143, "Input",ExpressionUUID->"b6352d19-2461-4c4a-a46c-48016be58972",
12751280
InitializationCell->True],
1276-
Cell[19547, 456, 976, 16, 32, "Input",ExpressionUUID->"b9cad7be-9f89-40bd-a9a3-3fe1a41c3deb",
1281+
Cell[19850, 461, 976, 16, 32, "Input",ExpressionUUID->"b9cad7be-9f89-40bd-a9a3-3fe1a41c3deb",
12771282
InitializationCell->True]
12781283
}, Open ]],
12791284
Cell[CellGroupData[{
1280-
Cell[20560, 477, 158, 3, 47, "Chapter",ExpressionUUID->"bcd04fe3-ac6a-4f3c-882e-a55a76a5a942"],
1281-
Cell[20721, 482, 730, 17, 95, "Input",ExpressionUUID->"046565fa-0b6e-470f-b2dd-8f76fa7999b9",
1285+
Cell[20863, 482, 158, 3, 47, "Chapter",ExpressionUUID->"bcd04fe3-ac6a-4f3c-882e-a55a76a5a942"],
1286+
Cell[21024, 487, 730, 17, 95, "Input",ExpressionUUID->"046565fa-0b6e-470f-b2dd-8f76fa7999b9",
12821287
InitializationCell->True],
1283-
Cell[21454, 501, 2134, 50, 220, "Input",ExpressionUUID->"47eb9e2a-4aab-4cae-818b-2b159f33dd9f",
1288+
Cell[21757, 506, 2134, 50, 220, "Input",ExpressionUUID->"47eb9e2a-4aab-4cae-818b-2b159f33dd9f",
12841289
InitializationCell->True],
1285-
Cell[23591, 553, 427, 10, 62, "Input",ExpressionUUID->"00423a7c-d6a3-484b-9304-a68bd1e4d0dd",
1290+
Cell[23894, 558, 427, 10, 62, "Input",ExpressionUUID->"00423a7c-d6a3-484b-9304-a68bd1e4d0dd",
12861291
InitializationCell->True],
1287-
Cell[24021, 565, 705, 20, 62, "Input",ExpressionUUID->"1ea8b5d2-96e6-4af7-a52c-280e569f15a7",
1292+
Cell[24324, 570, 705, 20, 62, "Input",ExpressionUUID->"1ea8b5d2-96e6-4af7-a52c-280e569f15a7",
12881293
InitializationCell->True],
1289-
Cell[24729, 587, 417, 10, 32, "Input",ExpressionUUID->"782d2e05-61cb-4a1e-995b-58129b80f7bd",
1294+
Cell[25032, 592, 417, 10, 32, "Input",ExpressionUUID->"782d2e05-61cb-4a1e-995b-58129b80f7bd",
12901295
InitializationCell->True]
12911296
}, Open ]],
12921297
Cell[CellGroupData[{
1293-
Cell[25183, 602, 218, 4, 47, "Chapter",ExpressionUUID->"06ff7fc1-962e-43b4-a94f-9559f0b4dca3"],
1294-
Cell[25404, 608, 794, 19, 62, "Input",ExpressionUUID->"79ec99ed-c6a5-40d1-ba31-4de7b82081b9",
1298+
Cell[25486, 607, 218, 4, 47, "Chapter",ExpressionUUID->"06ff7fc1-962e-43b4-a94f-9559f0b4dca3"],
1299+
Cell[25707, 613, 794, 19, 62, "Input",ExpressionUUID->"79ec99ed-c6a5-40d1-ba31-4de7b82081b9",
12951300
InitializationCell->True],
1296-
Cell[26201, 629, 997, 22, 78, "Input",ExpressionUUID->"9f2ac5dd-2eaa-4d6f-b8cb-362c8c467d62",
1301+
Cell[26504, 634, 997, 22, 78, "Input",ExpressionUUID->"9f2ac5dd-2eaa-4d6f-b8cb-362c8c467d62",
12971302
InitializationCell->True],
1298-
Cell[27201, 653, 3477, 76, 311, "Input",ExpressionUUID->"93970ecf-4458-45a6-af7f-b722479ab7d0",
1303+
Cell[27504, 658, 3477, 76, 311, "Input",ExpressionUUID->"93970ecf-4458-45a6-af7f-b722479ab7d0",
12991304
InitializationCell->True],
1300-
Cell[30681, 731, 800, 17, 59, "Input",ExpressionUUID->"1a245aa3-9301-4d39-8cb0-5948275641b1",
1305+
Cell[30984, 736, 800, 17, 59, "Input",ExpressionUUID->"1a245aa3-9301-4d39-8cb0-5948275641b1",
13011306
InitializationCell->True]
13021307
}, Open ]],
13031308
Cell[CellGroupData[{
1304-
Cell[31518, 753, 164, 3, 47, "Chapter",ExpressionUUID->"e0bcd719-68cb-44c9-baed-80f31c0888a8"],
1305-
Cell[31685, 758, 8125, 167, 463, "Input",ExpressionUUID->"e55cdd8a-6045-4e30-8a2b-0448ee7472c1",
1309+
Cell[31821, 758, 164, 3, 47, "Chapter",ExpressionUUID->"e0bcd719-68cb-44c9-baed-80f31c0888a8"],
1310+
Cell[31988, 763, 8125, 167, 463, "Input",ExpressionUUID->"e55cdd8a-6045-4e30-8a2b-0448ee7472c1",
13061311
InitializationCell->True]
13071312
}, Open ]],
13081313
Cell[CellGroupData[{
1309-
Cell[39847, 930, 201, 4, 47, "Chapter",ExpressionUUID->"e3e05c8f-39f0-4050-ac9f-88b0d5ad1c65"],
1310-
Cell[40051, 936, 1494, 29, 64, "Input",ExpressionUUID->"9bb42373-e385-489c-a935-e93c92a48e3a",
1314+
Cell[40150, 935, 201, 4, 47, "Chapter",ExpressionUUID->"e3e05c8f-39f0-4050-ac9f-88b0d5ad1c65"],
1315+
Cell[40354, 941, 1494, 29, 64, "Input",ExpressionUUID->"9bb42373-e385-489c-a935-e93c92a48e3a",
13111316
InitializationCell->True],
1312-
Cell[41548, 967, 1167, 26, 49, "Input",ExpressionUUID->"db419abf-7774-45ce-b342-c6f00edd9243",
1317+
Cell[41851, 972, 1167, 26, 49, "Input",ExpressionUUID->"db419abf-7774-45ce-b342-c6f00edd9243",
13131318
InitializationCell->True],
1314-
Cell[42718, 995, 7668, 140, 49, "Input",ExpressionUUID->"4b4f4ad4-7210-4478-a569-41f20a07bb6c",
1319+
Cell[43021, 1000, 7668, 140, 49, "Input",ExpressionUUID->"4b4f4ad4-7210-4478-a569-41f20a07bb6c",
13151320
InitializationCell->True]
13161321
}, Open ]],
13171322
Cell[CellGroupData[{
1318-
Cell[50423, 1140, 205, 4, 49, "Chapter",ExpressionUUID->"cacaeb49-784c-4d44-b62b-bdfa179ee658"],
1319-
Cell[50631, 1146, 501, 13, 49, "Input",ExpressionUUID->"ca725fc5-148b-4105-9299-39fa7ea7dd6a",
1323+
Cell[50726, 1145, 205, 4, 49, "Chapter",ExpressionUUID->"cacaeb49-784c-4d44-b62b-bdfa179ee658"],
1324+
Cell[50934, 1151, 501, 13, 49, "Input",ExpressionUUID->"ca725fc5-148b-4105-9299-39fa7ea7dd6a",
13201325
InitializationCell->True]
13211326
}, Open ]],
13221327
Cell[CellGroupData[{
1323-
Cell[51169, 1164, 151, 3, 49, "Chapter",ExpressionUUID->"49d12299-ea1b-44fc-bd22-2da512cfecd4"],
1324-
Cell[51323, 1169, 310, 8, 49, "Input",ExpressionUUID->"d25beb62-45c5-4226-ae79-0968129dba54",
1328+
Cell[51472, 1169, 151, 3, 49, "Chapter",ExpressionUUID->"49d12299-ea1b-44fc-bd22-2da512cfecd4"],
1329+
Cell[51626, 1174, 310, 8, 49, "Input",ExpressionUUID->"d25beb62-45c5-4226-ae79-0968129dba54",
13251330
InitializationCell->True],
1326-
Cell[51636, 1179, 1068, 23, 49, "Input",ExpressionUUID->"73bec28f-fd6a-4219-ac01-24118d1dd697",
1331+
Cell[51939, 1184, 1068, 23, 49, "Input",ExpressionUUID->"73bec28f-fd6a-4219-ac01-24118d1dd697",
13271332
InitializationCell->True],
1328-
Cell[52707, 1204, 1686, 30, 49, "Input",ExpressionUUID->"42d56651-f604-4980-b186-5fd230523be3",
1333+
Cell[53010, 1209, 1686, 30, 49, "Input",ExpressionUUID->"42d56651-f604-4980-b186-5fd230523be3",
13291334
InitializationCell->True]
13301335
}, Open ]]
13311336
}, Open ]]

modules/FEDeriK.m

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,21 @@ Replaces undetermined fields (AnyField) with explicit fields from the truncation
3434
Clears all custom functional derivative rules added with FAddFDRule.";
3535

3636
QMeSForm::usage = "QMeSForm[setup, expr]
37-
Converts expressions containing indexed objects (like Propagator, GammaN) to QMeS-style notation.
38-
Transforms correlation functions to symbolic forms suitable for further processing.
37+
Converts FunKit expressions to QMeS-style notation.
38+
For superindex input: produces QMeS native Association format (inverse of FunKitForm).
39+
For routed input (FEx, FTerm, or Association): produces QMeS named-symbol format.
3940
Uses the canonical ordering 'c>ag>g' for field arrangement.";
4041

4142
DoFunForm::usage = "DoFunForm[setup, expr]
42-
Transforms expressions from FunKit-style notation to DoFun-style notation.";
43+
Transforms expressions from FunKit-style notation to DoFun-style notation.
44+
For superindex input: produces DoFun symbolic format (op[P[...], V[...], ...]).
45+
For routed input (FEx, FTerm, or Association): produces DoFun algebraic format.";
4346

4447
FunKitForm::usage = "FunKitForm[expr]
4548
Transforms expressions from QMeS-style or DoFun-style notation to FunKit-style notation.
46-
This involves replacing indexed objects with their FunKit equivalents and adjusting the overall structure.";
49+
Handles QMeS native Association format and DoFun symbolic (op[...]) format.
50+
FunKitForm[setup, expr] also handles QMeS named-symbol format (requires setup for field name parsing).
51+
DoFun algebraic format (with explicit->False) is detected automatically without setup.";
4752

4853
FExpand::usage = "FExpand[setup, expr, order]
4954
Expands powers of FTerm and FEx expressions up to the specified order.

0 commit comments

Comments
 (0)