compile-execute
Select a pyQuil quantum computer, compile and execute programs, batch parameter maps, inspect QAM results, configure QVM/QPU endpoints, and recover from service or compiler failures.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- compile-execute
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Select a pyQuil quantum computer, compile and execute programs, batch parameter maps, inspect QAM results, configure QVM/QPU endpoints, and recover from service or compiler failures.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/compile-and-run.md7.2 KB
- 参考文档references/configuration.md6.2 KB
- 参考文档references/qc-selection.md5.5 KB
- 参考文档references/results-and-batching.md5.9 KB
- 参考文档references/troubleshooting.md8.5 KB
- 脚本scripts/check_services.py5.5 KB
- 脚本scripts/qvm_bell_smoke.py4.9 KB
03 SKILL.md 正文
Compile and execute
Use this route when the task mentions get_qc, QuantumComputer.compile,
qc.run, execute/get_result, QVM, QPU, quilc, QCS settings, endpoints,
reservations, memory maps, batch execution, timeouts, or connection errors.
This skill owns the compiled executable → QAM → result lifecycle; it does
not own Quil construction or numerical state analysis.
Route first
- Read qc-selection.md when choosing a target,
interpreting
get_qcnames/flags, or deciding between PyQVM, service QVM, and QPU. - Read compile-and-run.md for compilation stages, compiler classes, protoquil, metadata, PRAGMAs, and the exact run lifecycle.
- Read configuration.md before changing URLs, QCS profiles, timeouts, clients, endpoint IDs, or concurrency.
- Read results-and-batching.md when consuming register/raw/memory/duration data or reusing an executable with parameter maps.
- Read troubleshooting.md after any compiler, service, configuration, credential, shape, or backend-specific error.
- Run
scripts/check_services.py --helpfor safe diagnostics. It never starts services and does not make network requests unless explicitly requested. Runscripts/qvm_bell_smoke.py --help; execute it only with the explicit--executeopt-in after a local QVM and quilc are known to be available.
For program syntax, declarations, measurements, placeholders, and Quil-T, route to program-authoring. For statevectors, PyQVM numerical behavior, and service-free simulation, route to simulation. For noise/Experiment workflows, route to noise-experiments. For topology or ISA construction, route to processor-isa.
Non-negotiable lifecycle
- Build and validate a
Programusing the authoring route. - Select a target with
get_qc(...); record whether.qamisQVM,QPU, orPyQVM, and whether.compilerisQVMCompilerorQPUCompiler. - For service-backed QVM or QPU, call
executable = qc.compile(program).qc.compileperforms native Quil compilation and executable translation. - Supply only the compiled
QuantumExecutabletoqc.run(executable, ...), or useqc.qam.execute(...)followed byqc.qam.get_result(handle)when asynchronous control is needed. Do not pass an uncompiled high-level program to a QPU; a standardQVMalso requires aProgramexecutable, but the high-levelqc.compilepath is the portable choice. - Validate the returned register names and shapes before interpreting data. Use raw readout data rather than forcing a rectangular matrix for dynamic control flow or QPU qubit reuse.
get_qc and the execution methods have exact installed signatures; see the
linked references rather than guessing keyword names. Compilation and execution
are network/service operations unless the chosen QAM is explicitly in-process.
No helper in this sub-skill proves that a QVM, quilc, QPU, reservation, or QCS
credential is available.
Minimal pattern
from pyquil import Program, get_qc
from pyquil.gates import H, CNOT, MEASURE
program = Program()
ro = program.declare("ro", "BIT", 2)
program += [H(0), CNOT(0, 1), MEASURE(0, ro[0]), MEASURE(1, ro[1])]
program.wrap_in_numshots_loop(100)
qc = get_qc("9q-square-qvm")
executable = qc.compile(program) # requires quilc for this target
result = qc.run(executable) # requires QVM service
bits = result.get_register_map()["ro"]
assert bits.shape == (100, 2)
assert (bits[:, 0] == bits[:, 1]).all()
For a local QVM smoke test with bounded failure behavior, use the bundled
qvm_bell_smoke.py; it deliberately does not use QCS credentials or start
qvm/quilc. For service/config presence checks, use check_services.py.
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).