AI Agent Hub
Back to plugins
🤖

dsh-complex

Model Inference Updated 2026.09.11

Run the following command in DeepSeek Harness:

dsh plugin install TYEclipse/dsh-complex

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install TYEclipse/dsh-complex in a DeepSeek Harness terminal to install; the full source lives at https://github.com/TYEclipse/dsh-complex under the MIT license with zero runtime dependencies.

About this plugin

Large language models routinely botch complex arithmetic: expanding (3+4i)(1-2i), evaluating exp(iπ) or log(-1), finding the four fourth-roots of -4, computing i^i. Any task that forces an agent to hand-track i² = -1, Euler formulas, or polar conversions is a near-certainty of error. dsh-complex gives DeepSeek Harness a deterministic complex-math layer so the agent delegates the arithmetic to a tool and focuses on interpreting the result.

The plugin ships five pure-arithmetic tools: complex_parse (accepts a+bi, j-suffix, scientific notation, and polar r∠θ° input; returns rectangular, polar, and exponential forms plus modulus, argument, and conjugate in one call), complex_calc (add, subtract, multiply, divide, conjugate, reciprocal, and integer powers from -1000 to 1000 via De Moivre), complex_convert (bidirectional polar-to-rectangular and rectangular-to-polar conversion), complex_functions (principal values of exp, log, sin, cos, tan, sinh, cosh, sqrt with the branch convention stated in the result note), and complex_roots (the full set of n-th roots for n = 1 to 64). All computations use IEEE 754 doubles and round to 10 decimal places only at the output boundary; log(0) and division by zero return an honest valid: false with an explanation rather than a guess.

Well suited to agent workflows in signal processing, communications theory, control engineering, or quantum computing where complex arithmetic appears frequently. Zero runtime dependencies, fully local execution, 123 tests anchored to the Python cmath reference implementation, MIT-licensed, install and go.

Use Cases

  • When an agent needs exact complex multiplication, division, or integer powers
  • Frequent polar-to-rectangular conversion in signal processing or communications
  • Solving polynomial complex roots or evaluating principal-branch functions like exp(iθ) and log(-1)

Best For

  • Developers using DSH agents for scientific or engineering computation
  • Researchers in signal processing, control engineering, or quantum computing
  • Agent workflow designers who want to eliminate LLM complex-arithmetic errors