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 metadata through vars.id and vars.name, which makes mixed-variable expressions safe even when objects are created independently, 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 paper 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后端。该软件提供三个功能对等的类:用于CPU执行的MPOLY、作为传统GPU基线的MPOLY_GPU,以及改进型GPU导向实现MPOLY_HP。通过这些后端,Polylab支持多项式的构建、代数运算、简化、矩阵操作、微分、雅可比矩阵和海森矩阵构建、LaTeX导出、CPU端LaTeX重构、后端转换,以及与YALMIP和SOSTOOLS的互操作。3.0和3.1版本新增两项实用扩展:通过vars.id和vars.name实现显式变量元数据,使混合变量表达式即使对象独立创建也能保持安全性;以及基于自动微分、MF-logDet-Exact和MF-logDet-Stochastic的仿射法向方向计算。该工具箱已在前期研究中成功应用,3.1版本在成熟的多项式建模核心之上新增了面向几何的计算层。本文档记录了该软件的架构与用户接口,按工作流程组织功能,展示包含实际输出的代表性MATLAB会话,并报告可复现的基准测试结果。结果表明:对于轻量级交互工作负载,MPOLY是恰当的默认选择;而对于化简密集型任务及中大规模仿射法向计算,MPOLY-HP更具优势;在近似导向参数设置下的大规模稀疏问题中,随机对数行列式变体展现出吸引力。