Esempio n. 1
0
fpart = [Ncproduct(I*f, [2*j+1,2*j+2]) for j in range(L-1)]
V1part = [Ncproduct(V1, [2*j+1,2*j+2,2*j+3,2*j+4]) for j in range(L-2)]
V2part = [Ncproduct(V2, [2*j+2,2*j+3,2*j+4,2*j+5]) for j in range(L-2)]
small = fpart+V1part+V2part
Jpart = [Ncproduct(I*J, [2*j+2,2*j+3]) for j in range(L-1)]
H = fpart + V1part + V2part +Jpart

START_ORDER = 7
END_ORDER = 8

START_PSI = (N(1, 'a1')
             + N(f/J, 'a2') + N(V1/(I*J), 'b1 a2 a3'))

START_IOFVARS = []
START_SPLIT_ORDERS = [0, 1, 3]
START_NORMDICT = {}

START_PSI = comm.load_group('psidual_r6', START_IOFVARS, START_SPLIT_ORDERS)#, START_NORMDICT)

orders.update(zip(START_IOFVARS,[START_ORDER-1]*len(START_IOFVARS)))

FILEHEAD = 'psidual'
NORM_AS_YOU_GO = False

START_NORMDICT = comm.check_normalisable(START_PSI,
                                         START_IOFVARS,
                                         START_ORDER-1,
                                         orders,
                                         START_SPLIT_ORDERS,
                                         update_splits = False)
Esempio n. 2
0
                                                    orders,
                                                    matrixrows,
                                                    subspace,
                                                    norm = False,
                                                    subs_rules = subs_rules,
                                                    iofvars = iofvars,
                                                    split_orders = split_orders,
                                                    fvarname = 'F' + str(test_order) + '_')

    for x in sorted(subs_rules.keys(), key = lambda x: int(str(x)[2+len(str(test_order)):])):
        print(str(x)+': ' +str(subs_rules[x]))
    print('\n')
    psi = comm.substitute_group(psi, subs_rules, split_orders)

    orders.update(zip(iofvars,[test_order]*len(iofvars)))
    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]))
    psi_test_sub = comm.substitute_group(psi_test, normdict)
    psi_sub = psi + psi_test_sub
    comm.save_group(psi_sub, FILEHEAD)

    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(psi_sub)[0].scalar
        with open(FILEHEAD+'_norm', mode = 'w') as f:
            f.write(str(prop)+'\n\n')
            f.write(latex(prop).replace('\\\\', '\\'))