Skip to content

Commit

Permalink
improve generation of symmetry operations
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Mar 22, 2024
1 parent c8cf5ff commit ea5603a
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions posym/ir_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,36 +75,25 @@ def get_all_operations(self):
if 'all_operations' in self.attrs:
return self.attrs['all_operations']

"""
print('generators: ', self.generators)
print('operations: ', self.operations)
print('\ngenerators')
for op in self.generators:
try:
print('connect: ', op.label, op.axis, op.order, op.exp)
except:
try:
print('connect: ', op.label, op.axis)
except:
print('connect: ', op.label)
print('\nOperators in table')
for op in self.operations:
print(op)
print('\n')
"""

# generate all operations of the group and store its relation in connection
def do_loop(opt_list, opi):
def add_layer(opt_list, opi):
for gen_op in self.generators:
op_p = gen_op * opi
if not op_p in opt_list:
opt_list.append(op_p)
do_loop(opt_list, op_p)

def generate_operations(opt_list):

while True:
list_ini = list(opt_list)
for op in opt_list:
add_layer(opt_list, op)

if len(list_ini) == len(opt_list):
break

opt_list = [self.operations[0]]
do_loop(opt_list, self.operations[0])
generate_operations(opt_list)

"""
print('n_operations:', len(opt_list))
Expand Down Expand Up @@ -142,7 +131,6 @@ def do_loop(opt_list, opi):
if op_ref == op:
op_ref._gen_rep = op._gen_rep


self.attrs['all_operations'] = operation_dict

return self.attrs['all_operations']
Expand Down

0 comments on commit ea5603a

Please sign in to comment.