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-10-08
- Stars
- ★ 11
- Forks
- 3
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 资源文件 4
- 参考文档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
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
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.