sympy – skill Lập trình cho agent AI
SymPy là thư viện Python cho toán học ký hiệu, cho phép tính toán chính xác bằng các ký hiệu toán học thay vì xấp xỉ số.
Cài skill sympy bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/sympy-a6597.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /sympy – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/sympy-a6597.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $sympy – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/sympy-a6597.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /sympy – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/sympy-a6597.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /sympy – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
SymPy - Symbolic Mathematics in Python
Detailed Guide
Read [the detailed guide](references/detailed-guide.md) before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use This Skill
Use this skill when:
- Solving equations symbolically (algebraic, differential, systems of equations)
- Performing calculus operations (derivatives, integrals, limits, series)
- Manipulating and simplifying algebraic expressions
- Working with matrices and linear algebra symbolically
- Doing physics calculations (mechanics, quantum mechanics, vector analysis)
- Number theory computations (primes, factorization, modular arithmetic)
- Geometric calculations (2D/3D geometry, analytic geometry)
- Converting mathematical expressions to executable code (Python, C, Fortran)
- Generating LaTeX or other formatted mathematical output
- Needing exact mathematical results (e.g.,
sqrt(2)not1.414...)
Getting Started Examples
Example 1: Solve Quadratic Equation
from sympy import symbols, solve, sqrt
x = symbols('x')
solution = solve(x**2 - 5*x + 6, x)
# [2, 3]Example 2: Calculate Derivative
from sympy import symbols, diff, sin
x = symbols('x')
f = sin(x**2)
df_dx = diff(f, x)
# 2*x*cos(x**2)Example 3: Evaluate Integral
from sympy import symbols, integrate, exp, oo
x = symbols('x')
integral = integrate(x * exp(-x**2), (x, 0, oo))
# 1/2Example 4: Matrix Eigenvalues
from sympy import Matrix
M = Matrix([[1, 2], [2, 1]])
eigenvals = M.eigenvals()
# {3: 1, -1: 1}Example 5: Generate Python Function
from sympy import symbols, lambdify
import numpy as np
x = symbols('x')
expr = x**2 + 2*x + 1
f = lambdify(x, expr, 'numpy')
f(np.array([1, 2, 3]))
# array([ 4, 9, 16])Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- syncbook-discovery – Tìm người cộng tác đối ứng trên Syncbook hoặc chuẩn bị bản nháp hồ sơ riêng tư để con…
- systematic-debugging – Dùng khi gặp bất kỳ lỗi, test thất bại hoặc hành vi bất thường nào, trước khi đề xuất…
- systems-programming-rust-project – Bạn là chuyên gia kiến trúc dự án Rust, chuyên dựng khung cho các ứng dụng Rust sẵn sàng…
- takeout-coupon – Gọi API phiếu giảm giá đặt đồ ăn để lấy danh sách phiếu giảm ẩn, lì xì và trang đổi…
- tdd – Phát triển hướng kiểm thử (TDD). Dùng khi người dùng muốn xây dựng tính năng hoặc sửa…
- tdd-workflows-tdd-green – Viết mã tối thiểu cần thiết để làm cho các test thất bại vượt qua trong giai đoạn green…
- tdd-workflows-tdd-red – Tạo các test thất bại cho giai đoạn red của TDD để xác định hành vi mong đợi và các…
- tdd-workflows-tdd-refactor – Dùng khi làm việc với bước refactor trong quy trình TDD.