sympy
Was er macht
Mit diesem Tool kannst du exakte Berechnungen mit Symbolen durchführen, statt mit ungefähren Zahlen. Es hilft bei Algebra, Analysis, beim Lösen von Gleichungen und sogar bei Physik.
Wann du ihn nutzt
- ✓Gleichungen wie „x + 5 = 10“ exakt lösen.
- ✓Ableitungen oder Integrale von mathematischen Funktionen berechnen.
- ✓Komplexe mathematische Ausdrücke vereinfachen.
Link zum Skill
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/sympy/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Löse die Gleichung x^2 - 4 = 0 nach x auf.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Du sagst der KI, welche Symbole du verwendest (zum Beispiel „x“ oder „y“), und schreibst dann den mathematischen Ausdruck oder die Gleichung. Die KI nutzt das SymPy-Tool, um das exakte Ergebnis zu berechnen.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
SymPy - Symbolic Mathematics in Python
Overview
SymPy is a Python library for symbolic mathematics that enables exact computation using mathematical symbols rather than numerical approximations. This skill provides comprehensive guidance for performing symbolic algebra, calculus, linear algebra, equation solving, physics calculations, and code generation using SymPy.
Installation
Reviewed against current official documentation and executed with SymPy 1.14.0
on Python 3.13.3 (2026-10-01). Core SymPy requires Python 3.9+; the tested
NumPy 2.5.3 / SciPy 1.18.1 stack needs Python 3.12+. SymPy 1.14.0 requires
mpmath>=1.1,<1.4; use the compatible 1.3.0, not the newer 1.4.x release.
See verification and official sources for coverage.
# Install SymPy using uv
uv pip install "sympy==1.14.0"
# Optional: for lambdify and plotting examples
uv pip install numpy scipy matplotlib
Check your version:
import sympy
print(sympy.__version__)
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...)
Core Capabilities
Seven capability areas are documented in references/core_capabilities.md:
- Symbolic computation basics — symbols, expressions, simplification, substitution.
- Calculus — differentiation, integration, limits, series.
- Equation solving —
solve,solveset, linear and nonlinear systems, ODEs. - Matrices and linear algebra — see references/matrices-linear-algebra.md.
- Physics and mechanics — see references/physics-mechanics.md.
- Advanced mathematics — see references/advanced-topics.md.
- Code generation and output — see references/code-generation-printing.md.
Deeper treatment of the first three is in references/core-capabilities.md.
Working with SymPy: Best Practices
1. Always Define Symbols First
from sympy import symbols
x, y, z = symbols('x y z')
# Now x, y, z can be used in expressions
2. Use Assumptions for Better Simplification
from sympy import symbols, sqrt
x = symbols('x', positive=True, real=True)
sqrt(x**2) # Returns x (not Abs(x)) due to positive assumption
Common assumptions: real, positive, negative, integer, rational, complex, even, odd
3. Use Exact Arithmetic
from sympy import Rational, S
# Correct (exact):
expr = Rational(1, 2) * x
expr = S(1)/2 * x
# Approximate (appropriate for measured/numerical inputs):
expr = 0.5 * x # Creates approximate value
4. Numerical Evaluation When Needed
from sympy import pi, sqrt
result = sqrt(8) + pi
result.evalf() # 5.96371554103586
result.evalf(50) # Request 50 decimal digits; cannot recover precision lost in inputs
5. Convert to NumPy for Performance
from sympy import symbols, lambdify
import numpy as np
x = symbols("x")
expr = x**2 + 1
# Slow for many evaluations:
for x_val in range(1000):
result = expr.subs(x, x_val).evalf()
# Fast:
f = lambdify(x, expr, 'numpy')
results = f(np.arange(1000))
6. Use Appropriate Solvers
solveset: Algebraic equations (primary)linsolve: Linear systemsnonlinsolve: Nonlinear systemsdsolve: Differential equationssolve: General purpose; supports some problemssolvesetdoes not
…
Häufige Fragen
Was ist der Unterschied zwischen diesem Tool und einem normalen Taschenrechner?
Normale Taschenrechner arbeiten mit ungefähren Zahlen (etwa 3,14159). Dieses Tool verwendet exakte Symbole (etwa Pi oder die Wurzel aus 2), damit du präzise Ergebnisse bekommst.
Kann ich Zahlen und Symbole gemischt verwenden?
Ja, du kannst Zahlen und Symbole kombinieren. Du kannst zum Beispiel bitten, „2*x + 3*x“ zu vereinfachen.
Kann es jede Art von Mathe-Aufgabe lösen?
Es ist sehr leistungsstark für Algebra, Analysis und einige Bereiche der Physik. Bei extrem komplexen oder sehr speziellen Aufgaben kann es aber an seine Grenzen stoßen.
Details
Originalbeschreibung des Autors
Performs exact symbolic mathematics with SymPy for algebra, calculus, equation solving, symbolic linear algebra, physics, and lambdify or LaTeX code generation. Use when a task needs symbolic results, explicit assumptions, or exact arithmetic; use NumPy or SciPy for purely numerical workloads.
Beliebtheit
- GitHub-Sterne
- 51k
- Platz im Ranking
- #3579
- Lizenz
- MIT
- Aktualisiert
- 15.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
13c-metabolic-flux
51kSchätzt Stoffflüsse im Stoffwechsel anhand von Kohlenstoff-13-Isotopendaten. Nützlich für die Analyse des Zellstoffwechsels und biochemischer Stoffwechselwege.
adaptyv
51kPlant Experimente zur Proteincharakterisierung mit der Adaptyv API. Hilft beim Schätzen der Kosten, Einreichen von Sequenzen und Verfolgen der Laborergebnisse.
aeon
51kFührt Machine-Learning-Aufgaben mit Zeitreihendaten aus. Nützlich zum Klassifizieren, Prognostizieren, Erkennen von Anomalien und Finden von Mustern.
alphagenome
51kSucht vorberechnete genomische Effekte für genetische Varianten heraus. Liefert Scores und Erklärungen zu den Auswirkungen der Varianten auf das Genom.
Ähnliche Skills
pytorch-patterns
280kHilft deinem Agenten, PyTorch für Machine-Learning-Modelle einzusetzen. Er wendet Best Practices für effizientes Training und reproduzierbare Ergebnisse an.
evm-token-decimals
280kHilft deinem Agenten, Fehler bei Dezimalzahlen in verschiedenen Blockchain-Netzwerken zu vermeiden. Sorgt dafür, dass Token-Werte stimmen.
ito-inference
280kHilft deinem Agenten, die Verfügbarkeit von KI-Modellen zu prüfen. Er verbindet Rechenanfragen mit einem bereiten Modellservice.