WallGo.mathematicaHelpers

Common Wolfram Mathematica and WallGoMatrix related functions. Common physics/math functions should go into helpers.py

Functions

generateMatrixElementsViaSubprocess(...)

Generates matrix elements by executing a Mathematica script via a subprocess.

generateMatrixElementsViaSubprocess(inFilePath, outFilePath)[source]

Generates matrix elements by executing a Mathematica script via a subprocess.

This function takes the input and output file paths, converts them to string representations, and constructs a command to run a Mathematica script using wolframscript. The command is executed using the subprocess.run method, and the output is printed to the console. If the command fails, an error message is printed.

This requires a licensed installation of WolframEngine.

Parameters:
  • inFilePath (pathlib.Path) – The path to the input file containing the Mathematica script.

  • outFilePath (pathlib.Path) – The path to the output file where the results will be saved.

Raises:

subprocess.CalledProcessError – If the subprocess command fails.

Return type:

None