AGENT SKILL

analysis-and-measurements

Use OpenFermion for bounded sparse or dense operator analysis, Davidson and eigensolver workflows, RDM reconstruction and mapping, symmetry-sector restriction, measurement grouping and partitioning, VPE estimation, resource functionals, and grid or lattice numerical helpers.

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

01 前言 Front Matter

name
analysis-and-measurements
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use OpenFermion for bounded sparse or dense operator analysis, Davidson and eigensolver workflows, RDM reconstruction and mapping, symmetry-sector restriction, measurement grouping and partitioning, VPE estimation, resource functionals, and grid or lattice numerical helpers.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Analysis and measurements

Use this route when the task is to analyze an already constructed public OpenFermion operator or numerical tensor: obtain a sparse matrix, compute a small spectrum or ground state, restrict a Jordan–Wigner operator to a symmetry sector, map or validate RDMs, group compatible measurements, estimate a VPE functional, or use grid/lattice indexing helpers.

Route first

  • Operator construction, fermion-to-qubit transforms, or choosing a mapping: route to operators-and-transforms.
  • Molecular, Hubbard, jellium, or other model construction: route to hamiltonians-and-chemistry.
  • Circuit synthesis, VPE circuit creation, or state simulation: route to circuits-and-simulation. This skill only processes bounded numerical or measurement data for those workflows.
  • Large benchmarks, performance claims, multiprocessing experiments, and production integrations are evidence only; do not infer scalability from a tiny smoke check.

Read references/api-reference.md for signatures, shape conventions, and public import locations. Read references/workflows.md before doing a numerical workflow. Use references/troubleshooting.md when an import, dimension, backend, tensor, or solver check fails.

Guardrails before numerical work

  1. Identify the operator family (QubitOperator, FermionOperator, bosonic operator, polynomial tensor, or an existing sparse/linear operator), the qubit/mode count, and whether the operator is Hermitian.
  2. For a qubit Hilbert space, require the matrix dimension to be exactly 2**n_qubits; reject an underspecified n_qubits rather than silently truncating. For bosons, provide a positive integer trunc and estimate the dimension trunc**n_modes first.
  3. Keep dense diagonalization bounded. sparse_eigenspectrum converts the entire matrix to dense form and is appropriate only for a deliberately tiny matrix. Prefer get_ground_state, get_gap, or Davidson for larger but still bounded sparse cases.
  4. Check state shape and normalization before expectation or variance. These functions do not repair a wrong basis, wrong dimension, or an unnormalized state.
  5. For RDMs, state the number of spin-orbitals, particle number, and exact tensor convention before converting. Reject incompatible ranks or leading dimensions before calling an einsum or reconstruction routine.

Main routes

  • Sparse matrix and spectrum: use get_sparse_operator; inspect .shape, .format, and .nnz; use get_ground_state for the lowest state, get_gap for a Hermitian gap, and sparse_eigenspectrum only after a dense memory bound. The bundled sparse analysis smoke helper is a safe tiny example and prints the matrix shape and ground energy.
  • Symmetry-sector analysis: use jw_number_restrict_operator or jw_sz_restrict_operator on a Jordan–Wigner sparse matrix, or use get_number_preserving_sparse_operator when constructing a fermionic matrix directly in a bounded sector. Restricted state vectors are generally not normalized; renormalize before interpreting expectations.
  • Davidson: use SparseDavidson for a sparse matrix and QubitDavidson for a QubitOperator without materializing its full matrix. Supply a diagonal, a dimension-compatible initial guess, and bounded DavidsonOptions; inspect the returned success flag and residual rather than assuming convergence.
  • RDMs and equality constraints: use the mapping functions only with the documented OpenFermion index order. get_interaction_rdm reconstructs an InteractionRDM from measured qubit-term coefficients and can be O(n_qubits**4); specify n_qubits when identity or trailing orbitals make counting ambiguous. Equality projection is a resource-functional workflow, not a generic RDM repair operation.
  • Measurement grouping and partitioning: use tensor-product basis grouping for a QubitOperator; use qubit partition iterators for coverage families; use fermion/Majorana pairings only when their combinatorial output is the requested measurement schedule. They do not synthesize circuits or estimate shot noise.
  • VPE and resource functionals: PhaseFitEstimator requires known eigenvalues and phase samples aligned to its simulation points. The one-norm functions consume spatial-orbital integral tensors and distinguish inclusion of the constant. is_contextual is imported from openfermion.functionals.contextuality, not the root package.
  • Grid and lattice helpers: use Grid for centered real-space and reciprocal-space indexing, and HubbardSquareLattice for site, degree of freedom, spin, and neighbor iteration. These helpers do not construct a Hamiltonian; route model construction elsewhere.

Completion checklist

  • Record input type, n_qubits/mode count, truncation or sector, matrix shape, Hermiticity check, solver path, tolerance/iteration bound, and numerical result.
  • For spectra, state whether the result was dense or iterative and give the expected dimension. For RDMs, record ranks, shapes, particle/hole counts, contraction identity, and round-trip or trace checks.
  • For measurements, record the partition/grouping convention and whether identity terms or unpaired labels are present.
  • Stop and diagnose shape, basis, backend, or convergence failures using the troubleshooting table; do not increase dimensions or iteration limits blindly.

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