tc-rosetta

tc-rosetta is a skill for Claude Code from tensorcircuit/tensorcircuit-ng. It costs 56 tokens per session (881 once invoked), scanned A, original, Apache-2.0.

A migration guide that rewrites quantum-computing scripts from Qiskit or PennyLane for TensorCircuit-NG, a different quantum software framework. It preserves the mathematical goal while adapting the code to TensorCircuit-NG and JAX.

In plain words
What is it for?
Use it to migrate algorithms such as VQE, QAOA, or quantum Fisher information scripts, then produce a before-and-after execution-time comparison.
Why use it?
A line-by-line conversion can carry over assumptions from the old framework and miss the new framework's functional and vectorized style.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tensorcircuit/tensorcircuit-ng/tc-rosetta
Any agent
npx skills add tensorcircuit/tensorcircuit-ng --skill tc-rosetta
Clone the repo
git clone --depth 1 https://github.com/tensorcircuit/tensorcircuit-ng

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tc-rosetta

README.md
[![agentmods](https://agentmods.dev/badge/skills/tensorcircuit/tensorcircuit-ng/tc-rosetta.svg)](https://agentmods.dev/skills/tensorcircuit/tensorcircuit-ng/tc-rosetta)
Your own site
<a href="https://agentmods.dev/skills/tensorcircuit/tensorcircuit-ng/tc-rosetta"><img src="https://agentmods.dev/badge/skills/tensorcircuit/tensorcircuit-ng/tc-rosetta.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.00881
Opus 5 $0.00028 $0.00441
Sonnet 5 $0.00011 $0.00176
Haiku 4.5 $0.00006 $0.00088

Measured 6d ago against content hash d302c3c734a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tc-rosetta scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/tc-rosetta/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When tasked with translating quantum computing code from frameworks like Qiskit, PennyLane, or Cirq into TensorCircuit-NG (TC-NG), you act as a Principal Quantum Software Migration Expert.

Your goal is NOT to do a naive 1:1 syntax or line-by-line translation. You must perform End-to-End Intent Understanding to refactor the code into the idiomatic, differentiable, and functional programming paradigm of TC-NG.

1. End-to-End Intent Extraction (Do NOT Translate Line-by-Line)

  • Read the Entire Script: Absorb the global objective of the source code (e.g., VQE, QAOA, QFI).
  • Extract the Math/Physics Core: Extract only the fundamental mathematical entities: the Ansatz architecture, the target Hamiltonian, and the loss function.
  • Discard Legacy Paradigms: Explicitly abandon the original framework's constraints (e.g., Qiskit's parameter-binding for loops).

2. Idiomatic Synthesis in TC-NG

  • Start Fresh: Write the TC-NG script from scratch based on the extracted intent.
  • JAX-Native Initialization:
    import tensorcircuit as tc
    import jax
    import jax.numpy as jnp
    import time
    
    tc.set_backend("jax")
    
  • Functional Paradigm & Vectorization: Construct the circuit execution as a pure, differentiable Python function. Apply tc.backend.vmap natively for any batched operations.
  • Programming Paradigms: Avoid over-defensive programming; trust internal invariants where reasonable. Use try...except sparingly and never use broad catch-all blocks like except Exception:. Fail fast and expose problems early rather than masking them with silent failures or broad error handling.

3. Execution, Verification & Strict Benchmarking

  • Run the Source Code: If the original script is executable, run it and strictly record its total execution time using time or a simple bash time python script.py.
  • Run the TC-NG Code: Execute your newly synthesized TC-NG script. Ensure it outputs numerically equivalent results (e.g., matching loss curves or final energies).
  • Record Performance: Measure the exact execution time of the TC-NG script, noting separately the JIT compilation time (if applicable/measurable) and the actual execution time.

Read the full file on GitHub · 48 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 48 lines · 56 tokens per session scan A d302c3c734a3

Subscribe to this mod's changes

tc-rosetta is a skill published in the GitHub repository tensorcircuit/tensorcircuit-ng (89 stars, last pushed 4d ago), licensed Apache-2.0. It adds 56 tokens to every session and 881 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

physicsnemo-discover

Official NVIDIA-authored guidance for navigating PhysicsNeMo — pick the model, datapipe, or example for a SciML/AI4Science task (surrogates, forecasting, downscaling, physics-informed, inverse, generative). Points at existing files via live repo search; never writes code. Do NOT use for installation or environment…

NVIDIA/physicsnemo · 124 tokens

cellxgene-census-query

Query CZ CELLxGENE Census (61M+ cells). Filter by cell type/tissue/disease, retrieve expression data, and integrate with scanpy/PyTorch for population-scale single-cell analysis. Use this skill when: (1) Querying single-cell expression data by cell type, tissue, or disease, (2) Exploring available single-cell datasets…

PharMolix/OpenBioMed · 105 tokens

start-experiment

Start the autoresearch optimization loop for a specific model + lane. Resolves the hierarchical program.md (root → model → lane), asks the user for hardware (local TPU VM or GKE cluster of a specified TPU type + topology), discovers available clusters from .env/, checks occupancy with USERPREFIX-aware attribution…

vlasenkoalexey/tpu_performance_autoresearch_wiki · 103 tokens

stop-experiment

Stop the autoresearch optimization loop cleanly. Disarms the launch-armed process watcher, cancels pending wakeups, reaps orphan workloads on the project's cluster pool, files any missing experiment pages, runs lint, and appends a clean-shutdown marker to wiki/log.md. Invoke at the end of an autoresearch session.

vlasenkoalexey/tpu_performance_autoresearch_wiki · 70 tokens

edit-model-code

Coding-discipline guidelines for surgically modifying model code inside a per-experiment fork in the autoresearch loop. Adapts Andrej Karpathy's LLM-coding guidelines (think before coding, simplicity first, surgical changes, goal-driven execution) to this project's invariants — no semantics drift, one mechanism per…

vlasenkoalexey/tpu_performance_autoresearch_wiki · 146 tokens

author-kernel

Authoring discipline for kernel-family candidates (the author role of kernelexperiments/program.md step K4). Load BEFORE writing any kernel candidate — whether you are a solo agent running the whole K0–K9 loop (production: Gemini / Claude / Codex from a bare prompt) or a dispatched author process in the trial…

vlasenkoalexey/tpu_performance_autoresearch_wiki · 0 tokens