Qubit pauli expectations

From XuShuwenn/RedAct · View interactive version

Qubit pauli expectations is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Compute σx, σy, σz expectation values for a single-qubit state given Bloch angles (theta, phi) using QuTiP, with robust angle handling and exact output formatting.

How to use this skill

Skill file

Single-Qubit Pauli Expectations from Bloch Angles (QuTiP)

This skill computes expectation values of the Pauli matrices (σx, σy, σz) for a pure qubit state specified by Bloch sphere angles (theta, phi). It prefers QuTiP APIs and includes a deterministic fallback construction and analytic verification.

When to Use

Activate this skill when you need to:

Core Workflow

  1. Parse input
  1. Construct the qubit state (|ψ⟩)
  1. Compute expectations with QuTiP
  1. Format results
  1. Final checks

Verification

Perform at least one of the following independent checks:

Compare your QuTiP results to this analytic result with a tight tolerance (e.g., 1e-9) before rounding.

Success criteria:

Common Pitfalls

Optional Script Usage

A helper script is provided to parse inputs, construct the state, compute expectations with QuTiP when available, and write the required output.

Example:

The script:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.