hardware-providers-and-serialization
Use Cirq provider packages, provider-safe serialization, and browser visualization workflows without accidental live hardware calls.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- hardware-providers-and-serialization
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Cirq provider packages, provider-safe serialization, and browser visualization workflows without accidental live hardware calls.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/provider-and-visualization-workflows.md8.5 KB
- 参考文档references/provider-api-reference.md10.4 KB
- 参考文档references/serialization.md7.3 KB
- 参考文档references/troubleshooting.md8.2 KB
- 脚本scripts/inspect_provider_imports.py8.1 KB
03 SKILL.md 正文
Cirq hardware providers and serialization
Use this sub-skill when a task touches Cirq provider packages, hardware-facing samplers, provider serializers, credentials, JSON persistence, or cirq_web visualization. Default to offline inspection and validation; make live service calls only when the user explicitly supplies credentials, project/processor/target details, and permission to contact the service.
Use this when
- Working with
cirq_google.Engine,get_engine_sampler, Google devices such asSycamoreorWillow105, Google target gatesets, serializers, or workflow objects. - Preparing IonQ circuits with
cirq_ionq.Service,cirq_ionq.Sampler, IonQ serializers, or IonQ target gatesets. - Using AQT
AQTSampler,AQTSamplerLocalSimulator, workspace/resource/token concepts, or AQT-local validation. - Using Pasqal
PasqalSampler,PasqalDevice,PasqalVirtualDevice,TwoDQubit, orThreeDQubit. - Rendering provider-adjacent visualizations with
cirq_web.Circuit3D, widgets, or offline HTML representations. - Persisting or exchanging Cirq objects with
cirq.to_json,cirq.read_json, provider JSON resolvers, or custom serialization hooks.
Route elsewhere
- Generic qubits, gates, operations, circuit construction, parameters, diagrams, or JSON basics:
core-circuits-and-ops. - Local simulator-only studies, noisy simulation, histograms, sweeps, or result analysis:
simulation-study-and-noise. - Decomposing unsupported gates, routing to a topology, or compiling to target gatesets before provider packaging:
transformers-and-compilation. - Algorithm design or observable expectation workflows before hardware packaging:
algorithms-and-observables.
Reference map
- Start with Provider API reference for public package boundaries, key signatures, devices, samplers, serializers, target gatesets, and widget objects.
- Use Provider and visualization workflows for offline packaging, credential gates, live-run stop conditions, and
cirq_webusage. - Use Serialization for
cirq.to_json,cirq.read_json, custom resolvers, provider resolver registration, and distinctions between Cirq JSON and provider API serialization. - Use Troubleshooting for missing optional packages, absent credentials, project/target errors, unsupported gates, resolver failures, and browser/frontend limitations.
Bundled safe helper
Run the deterministic helper to inspect installed provider packages and perform an optional JSON/widget smoke check without network or credentials:
python scripts/inspect_provider_imports.py --help
python scripts/inspect_provider_imports.py
python scripts/inspect_provider_imports.py --check-widget-html
The helper imports provider packages, reports sanitized public signatures, can round-trip a tiny circuit with Cirq JSON, and never creates live cloud jobs, opens sockets, prints token values, or reads any source checkout.
Operating guardrails
- Treat cloud access as opt-in. Stop before
run,run_sweep,create_job,list_*,get_*, resource discovery, or sampler execution unless the user explicitly authorizes a live service call. - Separate three phases: circuit construction, offline provider validation/serialization, then credentialed submission. Route construction and compilation to their sub-skills before submission.
- Never store API tokens, project secrets, or credential file contents in Cirq JSON, notebooks, logs, or bundled scripts.
- Prefer provider serializers, device validation, and target gatesets for offline rejection of unsupported gates; use the transformers sub-skill when conversion is needed.
- For
cirq_web, assume a local browser or notebook display is optional. Validate by generating an HTML representation, not by requiring WebGL, Node, npm, or a browser automation stack.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).