ソース情報
- リポジトリ
- ZhangXin8069/PyQCU
- ソースの最終更新活動
- 2026年8月24日 17:59
- 検出された SKILL.md の言語
- 英語
- スター
- 3
- フォーク
- 0
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/ZhangXin8069/PyQCU --skill latticeコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
PyQCU 性能基准 skill:覆盖 examples/benchmark 的通用基准,以及 dev87 strict MultiGrid 对 QUDA 的可复现公平计时与显存口径。
pyqcu.cuda 目录的完整生成 skill:C++ CUDA 后端(libqcu.so)的 Cython 桥接包;含 strict QUDA-style MultiGrid、params/argv/set_ptrs 参数协议与显存生命周期约束。
cpp/cuda/qcu/include 目录的完整生成 skill:26 个模板化 CUDA 头文件(内核内联),define.h 须镜像 pyqcu/cuda/define.py。
SKILL.md を表示中
| name | lattice |
| description | pyqcu.lattice 目录的完整生成 skill:gamma/Gell-Mann 矩阵、SU(3) 检查、规范场生成与 Ward 负索引约定。 |
Lattice QCD fundamentals: gamma matrices, Gell-Mann matrices, SU(3) group utilities, and gauge field generation.
gamma — 4×4×4 gamma matrices γ₀, γ₁, γ₂, γ₃ in the Dirac-Pauli representation (γ₀ anti-hermitian, γ_i hermitian). Shape [4, 4, 4].gamma_5 — γ₅ = γ₀γ₁γ₂γ₃. Shape [4, 4].gamma_gamma — six γ_μ γ_ν products: [γ_x,γ_y], [γ_x,γ_z], [γ_x,γ_t], [γ_y,γ_z], [γ_y,γ_t], [γ_z,γ_t]. Shape [6, 4, 4]. Used as σ_{μν} matrices in the clover term.I — 4×4 identity matrix (complex64)minus_I — −I (precomputed)gell_mann — eight Gell-Mann matrices λ₁…λ₈ (SU(3) generators, traceless hermitian). Shape [8, 3, 3]. λ₁,λ₄,λ₆ are real; λ₂,λ₅,λ₇ are i×real.Ward indices use negative indexing because spacetime dimensions are always the last four axes (...xyzt layout):
wards['x'] = -4 # last 4th axis
wards['y'] = -3 # last 3rd axis
wards['z'] = -2 # last 2nd axis
wards['t'] = -1 # last axis
wards['t_p'] = -1 # parity-split temporal (same index as t)
This makes indexing robust regardless of prefix dimensions (spin, color, parity, etc.).
ward_keys = ['x', 'y', 'z', 't'] — standard 4D directionsward_p_keys = ['x', 'y', 'z', 't_p'] — parity-aware (t_p for temporal with even/odd mask)ward_ward_keys = ['xy', 'xz', 'xt', 'yz', 'yt', 'zt'] — 6 plane directions for cloverward_wards['xy'] = {'mu': -4, 'nu': -3, 'ward': -6} # gamma_gamma index 0
ward_wards['xz'] = {'mu': -4, 'nu': -2, 'ward': -5} # gamma_gamma index 1
# ... etc.
check_su3(U, tol=1e-3, verbose=True) → boolVerifies SU(3) properties of a gauge field:
_torch.allclose with atol=tol)torch.linalg.det — no NPU equivalent needed)Returns True only if all three checks pass.
generate_gauge_field(U, sigma=0.1, seed=None, verbose=False) → torch.TensorGenerates random SU(3) gauge links via exponential map:
torch.matrix_exp[3, 3, 4, Lx, Ly, Lz, Lt] layoutWrites result in-place into U. Returns U.
give_support_multi() → boolReturns True if MPI.COMM_WORLD.size > 1 (multi-process run).
Gauge field U: shape [3, 3, 4, Lx, Ly, Lz, Lt] = [color, color, direction, x, y, z, t]
In addition to the matrix data above, the module imports mpi4py.MPI, pyqcu.cann as _torch, and raw torch (for torch.linalg.det and torch.matrix_exp which have no NPU wrappers).