QTechTheory / QuESTlink

A Mathematica package for multithreaded and GPU simulation of quantum computers
https://questlink.qtechtheory.org/
MIT License
30 stars 4 forks source link

Incompatibility with < v12.2 #230

Open TysonRayJones opened 2 weeks ago

TysonRayJones commented 2 weeks ago

Functions Enclose, Confirm and ConfirmQuiet are not available in Mathematica v < 12.2. These functions are used (~13 times) to propagate errors from internal functions to the user's scope. A hacky workaround for these users is:

Quiet @ Import @ "https://qtechtheory.org/questlink.m";

QuEST`Private`ConfirmQuiet = Identity;
QuEST`Private`Confirm = Identity;
QuEST`Private`Enclose[a_, b_] := 
    If[FreeQ[a, $Failed], a, Throw["Error thrown but message lost"]; $Failed];

We should revert to the old horrible boilerplate to propagate errors; at least we don't lose user support!