Inv_test/psi4_value.wl

23 lines
598 B
Mathematica
Raw Normal View History

2024-02-05 16:43:04 -05:00
(*
Usage: Please set the fowllowing variables from outside as
command line arguments, like this:
wolframscript -file psi4_value.wl psi4_file x y z
for example:
wolframscript -file psi4_value.wl psi4.txt 1.2 2.1 3.4
*)
(* Parsing arguments *)
argv = Rest@$ScriptCommandLine;
(* Print[argv] *)
Check[
psi4file = argv[[1]];
{x, y, z} = ToExpression[argv[[2]]];
,
Print["Error: Check your command line arguments!"];Abort[]
];
psi4[r_, theta_, phi_] = ToExpression[Import[psi4file, "Text"] ]/.{t->0};
result = psi4@@ToSphericalCoordinates[{x,y,z}]
Print[Re@result, " ", Im@result]