Skip to content

Add P_constraint=1 to solve_qmd and solve_imd for correct axial tensor behavior#18

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/update-matrix-transformation-data
Draft

Add P_constraint=1 to solve_qmd and solve_imd for correct axial tensor behavior#18
Copilot wants to merge 3 commits intomainfrom
copilot/update-matrix-transformation-data

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 7, 2026

solve_qmd and solve_imd returned too few independent components for magnetic point groups with anti-unitary operations. For 31m (3 unitary + 3 anti-unitary ops), QMD gave 2 instead of 4, IMD gave 1 instead of 3.

QMD/IMD tensors are axial (pseudo) tensors requiring P_constraint=1 alongside T_constraint=1. The effective parity coefficient is det(Rs)^T_constraint, so for anti-unitary improper rotations (θσ_v), the T-sign (−1) and P-sign (−1) cancel, and these operations contribute the same constraints as pure spatial rotations.

Changes

  • tensorconstraint.py: Added P_constraint=1 to solve_qmd() and solve_imd() calls to solve_tensor_constraints()
  • test_tensorconstraint.py: Updated expected values in 5 affected tests; added test_solve_qmd_imd_magnetic_31m regression test verifying 4/3 independent components and nullspace structure

Before/After

ops = _31m_operations()  # 3 unitary + 3 anti-unitary

# Before: P_constraint=0 (polar) — anti-unitary ops kill z-components
solve_qmd(ops)  # → 2 independent components
solve_imd(ops)  # → 1 independent component

# After: P_constraint=1 (axial) — T and P signs cancel for anti-unitary improper ops
solve_qmd(ops)  # → 4 independent components (σ_xxy group, σ_xxz group, σ_zxx=σ_zyy, σ_zzz)
solve_imd(ops)  # → 3 independent components (σ_xxy group, σ_xxz=σ_zxx group, σ_zzz)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 7, 2026 06:30
QMD and IMD tensors require both T_constraint=1 (time-reversal odd) and
P_constraint=1 (axial/pseudo), making the effective parity coefficient
det(Rs)^T_constraint. This correctly handles magnetic point groups where
anti-unitary operations combine with improper spatial rotations.

For the magnetic point group 31m (3 unitary + 3 anti-unitary operations):
- QMD now gives 4 independent components (was 2)
- IMD now gives 3 independent components (was 1)

Co-authored-by: Connor1y <55659348+Connor1y@users.noreply.github.com>
…olve_qmd_imd_magnetic_31m

Co-authored-by: Connor1y <55659348+Connor1y@users.noreply.github.com>
Copilot AI changed the title [WIP] Update matrix transformation data structure Add P_constraint=1 to solve_qmd and solve_imd for correct axial tensor behavior Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants