Get the FREE Ultimate OpenClaw Setup Guide →

matrices

npx machina-cli add skill parcadei/Continuous-Claude-v3/matrices --openclaw
Files (1)
SKILL.md
1.2 KB

Matrices

When to Use

Use this skill when working on matrices problems in linear algebra.

Decision Tree

  1. Identify Matrix Type

    • Square, symmetric, orthogonal, diagonal?
    • Check properties with sympy_compute.py matrix_type
  2. Basic Operations

    • Multiplication: sympy_compute.py matmul "A" "B"
    • Inverse: sympy_compute.py inverse "A"
    • Transpose: sympy_compute.py transpose "A"
  3. Solve Linear Systems

    • Ax = b: sympy_compute.py linsolve "A" "b"
    • Check consistency with z3_solve.py sat
  4. Decompositions

    • LU: sympy_compute.py lu "A"
    • QR: sympy_compute.py qr "A"
    • SVD: sympy_compute.py svd "A"

Tool Commands

Sympy_Inverse

uv run python -m runtime.harness scripts/sympy_compute.py inverse "[[1,2],[3,4]]"

Sympy_Det

uv run python -m runtime.harness scripts/sympy_compute.py det "[[a,b],[c,d]]"

Sympy_Linsolve

uv run python -m runtime.harness scripts/sympy_compute.py linsolve "[[1,2],[3,4]]" "[5,6]"

Cognitive Tools Reference

See .claude/skills/math-mode/SKILL.md for full tool documentation.

Source

git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/math/linear-algebra/matrices/SKILL.mdView on GitHub

Overview

This skill helps you tackle matrices problems in linear algebra by guiding you through type identification, basic operations, solving linear systems, and decompositions. It emphasizes concrete tool commands (Sympy and related scripts) to compute, verify, and analyze results.

How This Skill Works

Start with a decision tree: identify matrix type (square, symmetric, orthogonal, diagonal), perform basic ops (matmul, inverse, transpose), then solve Ax=b (linsolve) or apply decompositions (LU, QR, SVD). Use the provided tool commands to execute steps and confirm consistency.

When to Use It

  • You need to identify matrix type and properties (square, symmetric, orthogonal, diagonal) before applying methods.
  • You want to perform basic operations such as multiplication, inversion, or transposition and verify results.
  • You need to solve a linear system Ax = b and check the solution for consistency.
  • You want to analyze or simplify problems using decompositions (LU, QR, SVD).
  • You want to validate determinants or other properties with the available Sympy tools during workflow.

Quick Start

  1. Step 1: Identify matrix type with matrix_type (via sympy_compute.py).
  2. Step 2: Perform core operations (matmul, inverse, transpose) using the corresponding commands.
  3. Step 3: If needed, solve or decompose (linsolve, lu, qr, svd) and verify results.

Best Practices

  • Check the matrix type early using matrix_type to choose the right method.
  • Always verify dimension compatibility before performing operations like matmul or solving Ax=b.
  • Prefer decompositions (LU, QR, SVD) to simplify solving and understanding A.
  • Cross-check results with multiple methods (e.g., linsolve and inverse when applicable).
  • Use the exact tool commands (matmul, inverse, transpose, linsolve, lu, qr, svd) to compute and verify results.

Example Use Cases

  • Compute the inverse of [[1,2],[3,4]] and use it to solve Ax=b.
  • Use LU decomposition to factor A and solve for x when A is large or ill-conditioned.
  • Apply QR decomposition to an overdetermined system to perform least-squares approximation.
  • Compute SVD of a matrix to analyze rank, conditioning, and perform dimensionality reduction.
  • Determine matrix type (e.g., symmetric or diagonal) to apply specialized properties and simplify calculations.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers