AGENT SKILL

core-circuits-and-ops

Build, inspect, mutate, serialize, and debug Cirq circuits and core operation objects.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
core-circuits-and-ops
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Build, inspect, mutate, serialize, and debug Cirq circuits and core operation objects.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Core Circuits and Operations

Use this sub-skill when the task is about Cirq's core object model: qubits/qids, gates, operations, moments, circuits, circuit diagrams, measurement keys, tags, controls, symbolic parameters, custom gates, and basic object serialization.

Stay in this sub-skill for

  • Choosing or constructing LineQubit, GridQubit, NamedQubit, LineQid, or GridQid objects.
  • Building and mutating Gate, Operation, Moment, Circuit, FrozenCircuit, and CircuitOperation objects.
  • Using Circuit.append, Circuit.insert, InsertStrategy, OP trees, findall_operations, measurement keys, operation tags, controls, and classically controlled operations.
  • Resolving symbolic parameters with ParamResolver and resolve_parameters.
  • Using core protocols such as unitary, has_unitary, decompose, inverse, qid_shape, and circuit_diagram_info for debugging custom or built-in objects.
  • Basic JSON, QASM, and Quirk interop at the circuit-object level.

Route away when

  • The user needs sampling, state vectors, density matrices, result histograms, parameter sweeps as execution, or noise simulation: use simulation-study-and-noise.
  • The user needs circuit transformers, optimization, decomposition pipelines, routing, target gatesets, or placement: use transformers-and-compilation.
  • The user needs cloud/hardware provider serializers, live services, credentials, or provider-specific package behavior: use hardware-providers-and-serialization.
  • The user needs algorithm recipes, Pauli observables, expectation values, or textbook algorithm interpretation: use algorithms-and-observables.

Operating routine

  1. Identify whether the task is object construction, mutation, inspection, parameters, protocols, or interop.
  2. For exact signatures and object-model facts, read references/api-reference.md.
  3. For common build/debug recipes, read references/workflows.md.
  4. For known failure modes, read references/troubleshooting.md.
  5. For a safe local smoke helper, run scripts/inspect_circuit.py with --help, then run it with optional --json or --qubits N.

Bundled assets

  • references/api-reference.md — verified public API signatures and compact examples for core Cirq objects.
  • references/workflows.md — task-oriented recipes for construction, mutation, parameter resolution, custom gates, and interop.
  • references/troubleshooting.md — symptom-based fixes for unresolved parameters, duplicate measurement keys, protocol failures, qid-shape mismatches, JSON resolver issues, QASM limits, and insert strategy surprises.
  • scripts/inspect_circuit.py — deterministic helper that builds a small parameterized circuit, prints diagrams, validates measurement-key uniqueness, and optionally performs a JSON roundtrip.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351