소스 정보
- 저장소
- 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명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
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).