Polylab is a MATLAB toolbox for multivariate polynomial scalars and polynomial matrices with a unified symbolic-numeric interface across CPU and GPU-oriented backends. The software exposes three aligned classes: MPOLY for CPU execution, MPOLY_GPU as a legacy GPU baseline, and MPOLY_HP as an improved GPU-oriented implementation. Across these backends, Polylab supports polynomial construction, algebraic manipulation, simplification, matrix operations, differentiation, Jacobian and Hessian construction, LaTeX export, CPU-side LaTeX reconstruction, backend conversion, and interoperability with YALMIP and SOSTOOLS. Versions 3.0 and 3.1 add two practically important extensions: explicit variable identity and naming for safe mixed-variable expression handling, and affine-normal direction computation via automatic differentiation, MF-logDet-Exact, and MF-logDet-Stochastic. The toolbox has already been used successfully in prior research applications, and Polylab Version 3.1 adds a new geometry-oriented computational layer on top of a mature polynomial modeling core. This article documents the architecture and user-facing interface of the software, organizes its functionality by workflow, presents representative MATLAB sessions with actual outputs, and reports reproducible benchmarks. The results show that MPOLY is the right default for lightweight interactive workloads, whereas MPOLY-HP becomes advantageous for reduction-heavy simplification and medium-to-large affine-normal computation; the stochastic log-determinant variant becomes attractive in larger sparse regimes under approximation-oriented parameter choices.
翻译:Polylab是一个MATLAB工具箱,用于处理多元多项式标量与多项式矩阵,其统一符号-数值接口兼容基于CPU与GPU的后端。该软件提供三个对齐的类:MPOLY(面向CPU执行)、MPOLY_GPU(传统GPU基线)以及MPOLY_HP(改进型GPU导向实现)。在这些后端上,Polylab支持多项式构造、代数操作、简化、矩阵运算、微分、雅可比矩阵与黑塞矩阵构造、LaTeX导出、CPU端LaTeX重建、后端转换,以及与YALMIP和SOSTOOLS的互操作。版本3.0和3.1新增两项重要扩展:显式变量标识与命名机制(保障混合变量表达式的安全处理),以及基于自动微分、MF-logDet-Exact与MF-logDet-Stochastic的仿射-法向方向计算。该工具箱已在以往研究中成功应用,而Polylab 3.1版本在成熟的多项式建模核心之上新增了面向几何的计算层。本文档记录了该软件的架构与用户接口,按工作流组织其功能,呈现包含实际输出的典型MATLAB运行示例,并报告可复现的基准测试结果。结果表明,MPOLY是轻量交互工作负载的合理默认选择,而MPOLY-HP在重简化运算及中大规模仿射-法向计算中更具优势;在近似导向参数选择下,随机log-行列式变体对大规模稀疏场景具有显著吸引力。