print('\n') psi = comm.substitute_group(psi, subs_rules, split_orders) orders.update(zip(iofvars,[test_order]*len(iofvars))) try: normdict = comm.check_normalisable(psi+psi_test, iofvars, test_order, orders, split_orders) for x in sorted(normdict.keys(), key = lambda x: int(str(x)[2+len(str(test_order)):])): print(str(x)+': ' +str(normdict[x])) except ValueError as e: print(str(e)) psi += psi_test comm.save_group(psi, FILEHEAD + '_r' + str(test_order), iofvars=iofvars, split_orders=split_orders) if NORM_AS_YOU_GO: prop = comm.square_to_find_identity_scalar_up_to_order(psi, test_order, split_orders) with open(FILEHEAD+'_norm', mode = 'w') as f: f.write(str(prop)+'\n\n') f.write(latex(prop).replace('\\\\', '\\')) if not NORM_AS_YOU_GO: prop = comm.square_to_find_identity(psi_sub)[0].scalar with open(FILEHEAD+'_norm', mode = 'w') as f: f.write(str(prop)+'\n\n') f.write(latex(prop).replace('\\\\', '\\')) print('Done!')
#!/home/kempj/py343ve/bin/python from sys import argv from commutator import load_group, print_group, square_to_find_identity_scalar_up_to_order from sympy import latex iofvars = [] split_orders = [] normdict = {} psi = load_group(argv[1], iofvars = iofvars, split_orders = split_orders, normdict=normdict) prop = square_to_find_identity_scalar_up_to_order(psi, int(argv[2]), split_orders) print(str(prop)+'\n\n') print(latex(prop).replace('\\\\', '\\'))