Quantum bloch vector

From XuShuwenn/RedAct · View interactive version

Quantum bloch vector is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Calculate Bloch vector components from quantum state angles (theta, phi) in radians.

How to use this skill

Skill file

Bloch Sphere Vector Calculation

When to Use

Input Format

File /root/input.txt:

theta phi

Read exactly two whitespace-separated numbers from /root/input.txt first, in this order: theta phi.

Do not swap them, and do not guess or hardcode example values.

Bloch Vector Components

The input angles are given in degrees. Convert theta and phi to radians before calling trig functions, e.g. with math.radians(...). Apply these formulas directly after conversion; do not reorder inputs, add extra transformations, or substitute alternate coordinate conventions. Keep full precision during computation and round only when formatting the final output.

New Section

Workflow

  1. Read theta and phi from /root/input.txt.
  2. Convert both angles from degrees to radians.
  3. Compute rx, ry, and rz using the formulas above.
  4. Keep full precision during computation and round only when formatting the final output.
  5. Write /root/output.txt with labels rx:, ry:, rz: in that order, using explicit signs and exactly 3 decimal places.
  6. Re-open or inspect the saved output and verify labels, order, signs, and rounding before finishing.

Output Format

To /root/output.txt:

rx: +0.XXX
ry: +0.XXX
rz: +0.XXX

Round to 3 decimal places. Include sign (+/-).

Tips

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.