技能 sympy
📦

sympy

内容修订 r2 高风险 ⚡ 包含脚本📁 文件系统访问⚙️ 外部命令🌐 网络访问

使用 SymPy 求解符号数学问题

要在代数、微积分、矩阵和物理等领域正确实现精确符号数学并非易事。此技能提供实用的 SymPy 指导、示例和工作流模式。

支持: Claude Codex Code(CC)
⚠️ 38 差

使用我的智能体安装

将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。

智能体请求
Review the Skillstore skill "sympy" from https://skillstore.io/skills/davila7-sympy.md and its manifest at https://skillstore.io/api/skills/davila7-sympy/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.

你的智能体仍应展示其计划,并按安全策略请求必要确认。

Agent 可读资源

当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。

测试它

正在使用“sympy”。 精确求解 x 的平方减 5x 加 6 等于零。

预期结果:

解:x = 2 和 x = 3。将这两个值分别代入后,多项式均为零。

正在使用“sympy”。 计算 x 的平方从零到一的积分。

预期结果:

精确结果:三分之一。原函数是 x 的立方除以三。

正在使用“sympy”。 求行分别为 [1, 2] 和 [2, 1] 的矩阵的特征值。

预期结果:

特征值为 3 和 -1,重数均为一。

安全审计

高风险
v9 • 2026/7/23 打开版本化报告

Most static alerts are false positives caused by Markdown backticks, ordinary SymPy imports, symbolic constructors, dictionary keys, and documentation links. Five file-writing examples and the recommendation to use eval are confirmed because they can overwrite files or execute untrusted code. Separate examples directly parse interactive input and deserialize a pickle without a trust boundary, creating high-severity code-execution risks.

6
已扫描文件
3,200
分析行数
6
复核项
0
已忽略误报

已确认安全问题 (2)

高
Untrusted Expression Parsing
The example reads interactive input and passes it directly to parse_expr. SymPy parsing can evaluate Python-like input, enabling arbitrary code execution.
The data flow from input() to parse_expr is direct and has no validation or restricted grammar before parsing.
高
Unsafe Pickle Deserialization
The example loads expr.pkl with pickle.load without establishing file trust. A replaced or attacker-controlled pickle can execute arbitrary code during deserialization.
The example directly calls pickle.load on a local file and provides no warning or trust check, which is a documented Python code-execution hazard.
能力复核项 (6)

这些是真实的本地能力,对此技能可能是预期行为,因此需要复核,但不会按已确认恶意行为计分。

高
Dynamic code evaluation with eval()
# This can be eval()'ed to recreate the expression
The guidance explicitly recommends reconstructing an expression with eval(). Applying that advice to modified or untrusted text can execute arbitrary Python code.
中
Python file write/append
with open('output.tex', 'w') as f:
The example opens output.tex in write mode without checking whether it exists. Running it can silently overwrite a same-named file in the working directory.
中
Python file write/append
with open('output.txt', 'w') as f:
The example opens output.txt in write mode without checking whether it exists. Running it can silently overwrite a same-named file in the working directory.
中
Python file write/append
with open('output.py', 'w') as f:
The example opens output.py in write mode without checking whether it exists. Running it can silently overwrite a same-named file in the working directory.
中
Python file write/append
with open('expr.pkl', 'wb') as f:
The example opens expr.pkl in write mode without checking whether it exists. Running it can silently overwrite a same-named file in the working directory.
中
Python file write/append
with open('document.tex', 'w') as f:
The example opens document.tex in write mode without checking whether it exists. Running it can silently overwrite a same-named file in the working directory.

风险因素

⚡ 包含脚本 (10)
📁 文件系统访问 (6)
⚙️ 外部命令 (50)
🌐 网络访问 (4)
审计者: codex 查看审计历史 →
分享与引用此报告

分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。

打开版本化报告
安全评估

复制报告链接

https://skillstore.io/skills/davila7-sympy/audits/9?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report

Markdown 徽章

[![Skillstore security assessment](https://skillstore.io/badges/skills/davila7-sympy/security.svg)](https://skillstore.io/skills/davila7-sympy?utm_source=security_passport_badge)

HTML 徽章

<a href="https://skillstore.io/skills/davila7-sympy?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/davila7-sympy/security.svg" alt="Skillstore security assessment" loading="lazy"></a>

嵌入卡片

<iframe src="https://skillstore.io/embed/skills/davila7-sympy.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>
学术引用 (APA · BibTeX · CFF)

APA 引用

davila7. (2026). sympy security audit report (audit version 9) [Author version unspecified]. Skillstore. https://skillstore.io/skills/davila7-sympy/audits/9

BibTeX 引用

@techreport{davila7-davila7-sympy-2026, author = {davila7}, title = {sympy security audit report (audit version 9)}, institution = {Skillstore}, year = {2026}, number = {9}, url = {https://skillstore.io/skills/davila7-sympy/audits/9}, note = {Author version unspecified} }

CITATION.cff

cff-version: 1.2.0 message: "If you use this Skill, cite its author and this versioned security audit report." title: "sympy security audit report (audit version 9)" version: "unspecified" type: report authors: - name: "davila7" date-released: "2026-07-23" url: "https://skillstore.io/skills/davila7-sympy/audits/9" identifiers: - type: other value: "skillstore:davila7-sympy:audit:9" description: "Skillstore immutable audit report identifier"

比较变体

2 个可安装变体

每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。

为什么此变体排名第一

Skillstore 使用量更高
K-Dense-AI 推荐

k-dense-ai-sympy

Skillstore 评分 38
证据置信度 中
Skillstore 使用量 17
已更新

2026-09-09

davila7 当前

davila7-sympy

Skillstore 评分 38
证据置信度 中
Skillstore 使用量 12
已更新

2026-09-09

Skillstore 评分

评分依据 证据置信度: 中
45
架构
85
可维护性
87
内容
75
社区
83
规范符合性

你能构建什么

验证解析模型

推导精确公式、化简参数化表达式,并在数值模拟前检查结果。

构建数学软件

将符号公式转换为经过测试的数值函数、生成的代码或格式化文档。

教授符号方法

通过精确步骤和可复现的 SymPy 工作流讲解代数、微积分、矩阵和物理。

试试这些提示

化简表达式
将 x 定义为实数符号,并化简 (x + 1)^2 - (x^2 + 2x + 1)。解释每个 SymPy 操作。
求解并验证方程组
使用 SymPy 精确求解 x + y = 5 和 x - y = 1。通过代入验证每个解。
推导级数展开
推导 exp(sin(x)) 到 x^6 阶的 Taylor 级数。说明假设,展示符号推导步骤,并验证余项阶数。
构建符号模型流水线
为参数化矩阵模型创建 SymPy 工作流。推导特征值、讨论奇异情况,并生成经过测试且可供 NumPy 使用的数值函数。

最佳实践

  • 在构造表达式之前定义符号和假设。
  • 使用 Rational 或 SymPy 精确常量,而不是浮点近似值。
  • 通过代入验证符号解,并测试生成的数值函数。

避免

  • 不要使用不受限制的 SymPy 解析器来解析不受信任的用户文本。
  • 不要加载来源未知或未经验证的 pickle 文件。
  • 不要假设每个方程都有简单的闭式解。

常见问题

此技能涵盖哪些问题?
它涵盖符号代数、微积分、方程、矩阵、物理、高等数学、格式化和代码生成。
它会返回精确结果吗?
是的,前提是 SymPy 支持精确形式,并且输入使用精确符号值。
它能生成数值函数吗?
可以。它演示如何使用 lambdify 将符号表达式转换为与 NumPy 兼容的函数。
它能生成 C 或 Fortran 代码吗?
可以。它包含 SymPy 代码生成工作流,但仍需进行编译和测试。
它需要外部软件包吗?
需要 SymPy。某些示例还会使用 NumPy、SciPy、Matplotlib 或编译器工具链。
解析用户提供的表达式安全吗?
默认情况下并不安全。不受信任的输入需要严格的允许列表、隔离、验证和资源限制。

开发者详情

作者

davila7

许可证

MIT

Skillstore 修订

r2

版本提示

作者未声明版本。

引用

c43861a65bb95efcae259cd161c9d6f4dc7eec6f

维护新鲜度

2026/7/27

使用量

7 次下载 · 539 次浏览