From c94188f41e7fc0c0361001841707b85fd9f4963c Mon Sep 17 00:00:00 2001 From: yangcal Date: Fri, 31 Jul 2020 13:14:47 -0700 Subject: [PATCH] fix for contractions with different modulus in the two inputs --- symtensor/symlib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/symtensor/symlib.py b/symtensor/symlib.py index 2e98d13..0dd7993 100644 --- a/symtensor/symlib.py +++ b/symtensor/symlib.py @@ -133,7 +133,7 @@ def merge_sym_range(range_A, range_B, modulus1=None, modulus2=None): return _merge_sym_range(range_A, range_B) elif modulus1 is None and modulus2 is not None: rA = fold_sym_range(range_A, modulus2) - return _merge_sym_range(range_B, r_A) + return _merge_sym_range(range_B, rA) else: rB = fold_sym_range(range_B, modulus1) return _merge_sym_range(range_A, rB) @@ -228,7 +228,11 @@ def make_irrep_map_lst(symlib, sym1, sym2, sym_string_lst): sign_string = ''.join([sym1_[0][i] for i in idxa]) + '-' sym_range = [sym1[1][i] for i in idxa] sym_range.append(aux_range) - aux_sym = [sign_string, sym_range, None, sym1[3]] + if sym1[3] is not None: + symq = sym1[3] + else: + symq = sym2[3] + aux_sym = [sign_string, sym_range, None, symq] delta_tensor.append(symlib.get_irrep_map(aux_sym)) delta_lst = fuse_delta([delta_strings, delta_tensor], symlib.backend) return delta_lst