Skip to content

Commit 1cbc8db

Browse files
committed
Rename metatensor labels for compatibility with featomic
1 parent 7fd9f97 commit 1cbc8db

4 files changed

+6
-6
lines changed

qstack/equio.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import numbers
77

88
vector_label_names = SimpleNamespace(
9-
tm = ['spherical_harmonics_l', 'species_center'],
9+
tm = ['o3_lambda', 'center_type'],
1010
block_prop = ['radial_channel'],
1111
block_samp = ['atom_id'],
1212
block_comp = ['spherical_harmonics_m']
1313
)
1414

1515
matrix_label_names = SimpleNamespace(
16-
tm = ['spherical_harmonics_l1', 'spherical_harmonics_l2', 'species_center1', 'species_center2'],
16+
tm = ['o3_lambda1', 'o3_lambda2', 'center_type1', 'center_type2'],
1717
block_prop = ['radial_channel1', 'radial_channel2'],
1818
block_samp = ['atom_id1', 'atom_id2'],
1919
block_comp = ['spherical_harmonics_m1', 'spherical_harmonics_m2']
@@ -68,10 +68,10 @@ def _get_tsize(tensor):
6868

6969
def _labels_to_array(labels):
7070
"""Represents a set of metatensor labels as an array of the labels, using custom dtypes
71-
71+
7272
Args:
7373
labels (metatensor Labels): Labels
74-
74+
7575
Returns:
7676
labels (numpy ndarray[ndim=1, structured dtype]): the same labels
7777
"""
@@ -179,7 +179,7 @@ def tensormap_to_vector(mol, tensor):
179179
llist = _get_llist(q, mol)
180180
il = {l: 0 for l in range(max(llist)+1)}
181181
for l in llist:
182-
block = tensor.block(spherical_harmonics_l=l, species_center=q)
182+
block = tensor.block(o3_lambda=l, center_type=q)
183183
id_samp = block.samples.position((iat,))
184184
id_prop = block.properties.position((il[l],))
185185
for m in _get_mrange(l):
@@ -342,7 +342,7 @@ def tensormap_to_matrix(mol, tensor):
342342
il2 = {l2: 0 for l2 in range(max(llist2)+1)}
343343
for l2 in llist2:
344344

345-
block = tensor.block(spherical_harmonics_l1=l1, spherical_harmonics_l2=l2, species_center1=q1, species_center2=q2)
345+
block = tensor.block(o3_lambda1=l1, o3_lambda2=l2, center_type1=q1, center_type2=q2)
346346
id_samp = block.samples.position((iat1, iat2))
347347
id_prop = block.properties.position((il1[l1], il2[l2]))
348348

0 Bytes
Binary file not shown.

tests/data/H2O_dist.ccpvdz.dm.npz

-64 Bytes
Binary file not shown.
-64 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)