def find_spectrum(fname, adj=None): ''' ''' cells, spacing, zones, J, feedback = parse_qca_file(fname, one_zone=True) h, J = qca_to_coef(cells, spacing, J, adj=adj) h, J = normalized_coefs(h, J) # get clocking schedule s, eps, gamma = clock_schedule(scheme='linear') spectrum = Spectrum() spectrum.solve(h, J, eps, gamma, show=True, exact=False)
def find_spectrum(fname, adj=None): ''' ''' cells, spacing, zones, J, feedback = parse_qca_file(fname, one_zone=True) h, J = qca_to_coef(cells, spacing, J, adj=adj) h, J = normalized_coefs(h,J) # get clocking schedule s, eps, gamma = clock_schedule(scheme='linear') spectrum = Spectrum() spectrum.solve(h, J, eps, gamma, show=True, exact=False)
def main(fname): ''' ''' try: cells, spacing, zones, J, fb = parse_qca_file(fname, one_zone=True) except: print('Failed to load qca file') return h, J = qca_to_coef(cells, spacing, J, adj='full') h /= np.max(np.abs(J)) J /= np.max(np.abs(J)) for _ in range(100): h_, J_, K, hp, inds = mix_seriation(h, J) hval, K_, hp_, inds_ = hash_problem(h_, J_) if False: print('K: {0:.4f}\t hp: {1}\ninds: {2}'.format(K, hp, inds)) print('K: {0:.4f}\t hp: {1}\ninds: {2}'.format(K_, hp_, inds_)) print('hash val: {0}'.format(hval))