agentleFS
odinfreeodinfree/storm-ecdsa-harness/skills/quantum-affine-lookup-synthesis/SKILL.md

quantum-affine-lookup-synthesis

Skill4 starsChanged 21 days agoMITView on GitHub

Lower Toffoli cost in a repeated small reversible XOR lookup or modular squarer by sharing nonlinear terms across outputs, testing affine basis changes and proving arbitrary-target behavior before measuring the full circuit.

The file

Files
SKILL.md

Spickzettel (quantum-affine-lookup-synthesis)

Synthesize the lookup in the caller's frame

Extract the actual address-to-word table, caller guard, scratch assumptions and observed call multiplicities from the frozen source. Record output bit ordering, legal address domain and behavior for unused encodings. The contract of an XOR lookup is (a,t) → (a,t XOR F(a)) for arbitrary incoming t.

  1. For an address bit x, let F0 and F1 be word-valued cofactors and D=F0 XOR F1. Price Shannon selection, positive Davio F0 XOR (x AND D), and negative Davio F1 XOR ((NOT x) AND D). Share reusable terms across output columns. Include creating, controlling and uncomputing each helper. Try invertible linear output coordinates where they expose identical terms. For a basis L, the target enters as L(t), receives L(F(a)), and leaves through L⁻¹.
  2. For a modular squarer on canonical residues modulo an odd prime, x and p−x have equal squares. Explore a half-table only if the address fold, zero case, garbage removal and restored original address all fit the width and price. Specify behavior on noncanonical inputs whenever the source admits them.
  3. Exhaust the addresses at each emitted table size and verify address, target, phase and borrowed workspace. Checking target zero and the single-bit target vectors proves arbitrary-target correctness only after establishing the map is affine in the incoming target at each address. If a target can influence a nonlinear control, prove the restriction, exhaust targets, or use equivalence checking. Test disabled guards, inverse direction and bit/basis adapters.
  4. Recompile in the actual caller, rebase insertion spans and inverse spans on the exact parent, and price the combined build. Count printed gates, compiled CCX and executed Toffolis independently. Remeasure call multiplicities after other rewrites. In paired panels retain failure IDs and passing-state digests. Test the emitted stream's own benchmark draw separately.

See Boolean expansions, vector multiplicative complexity and exact multiplicative complexity.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.