Add support for high/low symmetry variants in tetragonal and trigonal systems
The code treated all tetragonal and trigonal systems as having 6 independent elastic constants, but low-symmetry variants require different handling: tetragonal low (space groups 75-88) has 7 constants including C₁₆, while trigonal low (143-148) has different coupling patterns than high symmetry variants.
Changes
New symmetry functions:
-
tetragonal_high()/tetragonal_low()- Handle space groups 89-142 (6 constants) and 75-88 (7 constants with C₁₆) -
trigonal_high()/trigonal_low()- Handle space groups 149-167 and 143-148 (both 6 constants, different coupling)
Automatic selection:
-
get_symmetry_function()- Uses spglib space group number to select appropriate symmetry function - Updated
get_elementary_deformations(),get_elastic_tensor(),get_cij_order()to use automatic selection
Backward compatibility:
- Existing
tetragonal()andtrigonal()functions aliased to high symmetry variants
Usage
from ase.spacegroup import crystal
from elastic import get_symmetry_function, get_cij_order
# Low symmetry tetragonal (space group 75) - automatically gets 7 constants
cryst = crystal(['Zn'], [(0, 0, 0)], spacegroup=75, cellpar=[a, a, c, 90, 90, 90])
symm_func, axes, info = get_symmetry_function(cryst)
# Returns tetragonal_low with 7 constants: C₁₁, C₃₃, C₁₂, C₁₃, C₄₄, C₆₆, C₁₆
# High symmetry tetragonal (space group 136) - gets 6 constants
cryst = crystal(['Ti', 'O'], [(0, 0, 0), (0.302, 0.302, 0)],
spacegroup=136, cellpar=[a, a, c, 90, 90, 90])
symm_func, axes, info = get_symmetry_function(cryst)
# Returns tetragonal_high with 6 constants: C₁₁, C₃₃, C₁₂, C₁₃, C₄₄, C₆₆
Space group ranges based on International Tables for Crystallography and verified against matscipy implementation.
Original prompt
This section details on the original issue you should resolve
<issue_title>Number of independent elastic tensors in trigonal and tetragonal lattice systems</issue_title> <issue_description>Elastic is a very convenient tool for calculating elastic constants of crystals. Thanks a lot for the continuous development.
I would like to bring the following points into attention if not discussed yet.
In the Elastic code, the number of independent elastic tensors is taken as 6 for trigonal and tetragonal lattice systems.
On the other hand, it is stated that the number of independent elastic tensors can be either 6 or 7 for trigonal and tetragonal lattice systems due to different symmetries.
Elasticity measurements on minerals: A review European Journal of Mineralogy 21(3), June 2009 DOI: https://doi.org/10.1127/0935-1221/2009/0021-1925 https://web.gps.caltech.edu/~jackson/pdf/Angel2009_EJM.pdf
also: https://github.com/libAtoms/matscipy/blob/master/matscipy/elasticity.py
'trigonal_high': np.array([[1, 7, 8, 9, 10, 0], [7, 1, 8, 0,-9, 0], [8, 8, 3, 0, 0, 0], [9, -9, 0, 4, 0, 0], [10, 0, 0, 0, 4, 0], [0, 0, 0, 0, 0, 6]]),
'trigonal_low': np.array([[1, 7, 8, 9, 10, 0 ], [7, 1, 8, -9, -10, 0 ], [8, 8, 3, 0, 0, 0 ], [9, -9, 0, 4, 0, -10], [10,-10, 0, 0, 4, 9 ], [0, 0, 0, -10 , 9, 6 ]]),
'tetragonal_high': np.array([[1, 7, 8, 0, 0, 0], [7, 1, 8, 0, 0, 0], [8, 8, 3, 0, 0, 0], [0, 0, 0, 4, 0, 0], [0, 0, 0, 0, 4, 0], [0, 0, 0, 0, 0, 6]]),
'tetragonal_low': np.array([[1, 7, 8, 0, 0, 11], [7, 1, 8, 0, 0, -11], [8, 8, 3, 0, 0, 0], [0, 0, 0, 4, 0, 0], [0, 0, 0, 0, 4, 0], [11, -11, 0, 0, 0, 6]])</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes jochym/Elastic#74
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.