Skip to main content

Physical Layer Linter — validates RF and physics calculations against hard physical limits

Project description

PhysBound

Physical Layer Linter — An MCP server that validates RF and physics calculations against hard physical limits. Catches AI hallucinations in engineering workflows.

License: MIT Python 3.12+ Tests


What LLMs Get Wrong

LLMs routinely hallucinate physics. PhysBound catches it:

# Category LLM Hallucination PhysBound Truth Verdict
1 Shannon-Hartley "20 MHz 802.11n at 15 dB SNR achieves 500 Mbps" Shannon limit: 100.6 Mbps CAUGHT
2 Shannon-Hartley "100 MHz 5G channel at 20 dB SNR delivers 2 Gbps" Shannon limit: 665.8 Mbps CAUGHT
3 Antenna Aperture "30 cm dish at 1 GHz provides 45 dBi gain" Aperture limit: 7.4 dBi CAUGHT
4 Thermal Noise "Noise floor of -180 dBm/Hz at room temperature" Actual: -174.0 dBm/Hz at 290K CAUGHT
5 Link Budget "Wi-Fi at 2.4 GHz reaches 10 km at -40 dBm" Actual RX power: -94.1 dBm CAUGHT
6 Link Budget "1W to GEO with 0 dBi antennas at -80 dBm" Actual RX power: -175.1 dBm CAUGHT

Generated automatically by pytest tests/test_marketing.py -s


Quick Start

Install

pip install physbound

Use with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "physbound": {
      "command": "uv",
      "args": ["run", "--from", "physbound", "physbound"]
    }
  }
}

That's it. Claude now has access to physics-validated RF calculations.


Tools

rf_link_budget

Computes a full RF link budget using the Friis transmission equation. Validates antenna gains against aperture limits.

Example: "What's the received power for a 2.4 GHz link at 100 m with 20 dBm TX, 10 dBi TX gain, 3 dBi RX gain?"

Returns: FSPL, received power, wavelength, and optional aperture limit checks. Rejects antenna gains that violate G_max = eta * (pi * D / lambda)^2.

shannon_hartley

Computes Shannon-Hartley channel capacity C = B * log2(1 + SNR) and validates throughput claims.

Example: "Can a 20 MHz channel with 15 dB SNR support 500 Mbps?"

Returns: Theoretical capacity, spectral efficiency, and whether the claim is physically possible. Flags violations with the exact percentage by which the claim exceeds the Shannon limit.

noise_floor

Computes thermal noise power N = k_B * T * B, cascades noise figures through multi-stage receivers using the Friis noise formula, and calculates receiver sensitivity.

Example: "What's the noise floor for a 1 MHz receiver at 290K with a two-stage LNA chain?"

Returns: Thermal noise in dBm and watts, cascaded noise figure, system noise temperature, and receiver sensitivity.


Physics Guarantees

Every calculation is validated against hard physical limits:

  • Speed of light: c = 299,792,458 m/s — no exceptions
  • Thermal noise floor: N = -174 dBm/Hz at 290K — the IEEE standard reference
  • Shannon limit: C = B * log2(1 + SNR) — no throughput claim exceeds this
  • Aperture limit: G_max = eta * (pi * D / lambda)^2 — antenna gain is bounded by physics

Violations return structured PhysicalViolationError responses with LaTeX explanations, not silent failures.


Development

# Clone and install
git clone https://github.com/JonesRobM/physbound.git
cd physbound
uv sync --all-extras

# Run tests
uv run pytest tests/ -v

# Print hallucination delta table
uv run pytest tests/test_marketing.py -s

# Start MCP server locally
uv run physbound

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

physbound-0.1.0.tar.gz (100.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

physbound-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file physbound-0.1.0.tar.gz.

File metadata

  • Download URL: physbound-0.1.0.tar.gz
  • Upload date:
  • Size: 100.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for physbound-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a6f95ccdb7a959486a3601cc9df8aa41dac019fae8b4b964cb78ec9e380437a
MD5 d52ee441ef1be1af98cc5729888a34c5
BLAKE2b-256 93975273e7011050124b177221ffe4983c7038bd8788e6df867ca249499d8f77

See more details on using hashes here.

File details

Details for the file physbound-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: physbound-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for physbound-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6a1304e28de854cd4769948cbb416fc4b4d49254d42fa2f021acde06846532d
MD5 f334e5f0dfc6092c03923e3aa0f66d92
BLAKE2b-256 7f804ecf68f6b7b0f3a18b1f082063e0df8659a6cec913c7187a14ac55c02c57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page