Quantum numerical simulation

From XuShuwenn/RedAct · View interactive version

Quantum numerical simulation is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Simulate open Dicke model steady state and calculate cavity field Wigner function for different loss cases.

How to use this skill

Skill file

Open Dicke Model Quantum Simulation

When to Use

Scope Guardrails

Model Parameters

4 Loss Cases

  1. Local dephasing + local pumping: γφ=0.01, γ↑=0.1
  2. Local dephasing + local emission: γφ=0.01, γ↓=0.1
  3. Case 2 + collective pumping: γφ=0.01, γ↓=0.1, γ⇑=0.1
  4. Case 2 + collective emission: γφ=0.01, γ↓=0.1, γ⇓=0.1

Critical Modeling Constraint

Workflow

  1. Build the Hamiltonian and collapse operators strictly from the provided task parameters.
  2. Preserve the requested dissipation structure exactly: local channels must act on each spin separately in the full tensor-product spin space, while collective channels act on the full spin ensemble.
  3. Keep all operators in one consistent Hilbert-space representation; check composite operator/Liouvillian dims and shapes before calling steadystate, and do not fix incompatible superoperators by manually overwriting .dims.
  4. Before full-scale runs, validate one reduced but structurally faithful end-to-end pipeline: read back the saved script, run a quick syntax/import check, print/inspect dims and shape for H and each c_op, then build the model, solve one steady state, confirm subsystem ordering for ptrace, compute a small Wigner grid, and write a test CSV.
  5. Keep reduced tests structurally faithful to the real task: use the same full cavity ⊗ 2^N spin-product-space construction, the same local-vs-collective collapse-operator pattern, and the same likely bottleneck as the final run; do not switch to a Dicke/symmetric basis when local dissipation is present.
  6. Instrument the script with progress/timing prints around case build, Liouvillian assembly, steadystate start/end, ptrace, Wigner start/end, and CSV write; do not launch the full 4-case 1000×1000 production run until one reduced test case has successfully completed steadystate → ptrace → wigner → CSV write.
  7. Use the reduced benchmark to choose the execution plan. In timeout-prone environments, prefer one case per process/script invocation with immediate CSV persistence, and keep one validated baseline implementation instead of restarting from speculative optimization paths.
  8. Use steadystate for the required final results. Do not replace the final workflow with finite-time evolution (mesolve) just because the solve is slow or times out. If you use time evolution only as a diagnostic, explicitly verify stationarity before treating it as relevant evidence, then return to the required steadystate workflow for final outputs.
  9. Solve the full-parameter steady state case-by-case.
  10. Trace out spins → cavity state, confirming subsystem ordering before ptrace.
  11. Calculate the Wigner function on grid x,p ∈ [-6,6], 1000×1000.
  12. Save each finished case immediately as CSV: 1.csv, 2.csv, 3.csv, 4.csv, in the approved output directory.
  13. If you used reduced settings for diagnosis, restore the exact required parameters before the final run; do not change N=4, n_max=16, or the final 1000×1000 grid unless the user explicitly approves it.
  14. Verify that all four CSVs were actually written and are non-empty before declaring completion.
  15. Write CSVs with built-in or NumPy-based output (numpy.savetxt or csv); do not add optional dependencies such as pandas just for file export.
  16. If the surrounding instructions specify an exact final completion string, emit it immediately after verifying the four CSVs; do not perform any further experimentation once deliverables are secured.

Workflow

Execution Guardrails

Debugging and Validation

Debugging and Validation

Output

Completion Checklist

Before declaring completion:

CSV files with Wigner function values:

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.