Esempio n. 1
0
    backup_interval = 100

if "-loginterval" in sys.argv:
    log_interval = int(sys.argv[sys.argv.index("-loginterval") + 1])
else:
    log_interval = 100
    
mode = "fu"
if "-mode" in sys.argv:
    mode = sys.argv[sys.argv.index("-mode") + 1]

name_suffix = ""
if "-namesuffix" in sys.argv:
    name_suffix = sys.argv[sys.argv.index("-namesuffix") + 1]

globallog.write("tfi_gs_2d.py, D={:d}, chi={:d}, h={:f}, tau={:.0e}, iterations={:d}, trotter order {:d}{:s}{:s}\n".format(D, chi, h, tau, maxiterations, 2 if trotter_second_order else 1, ", ffu" if fast_full_update else "", "" if name_suffix == "" else ", name_suffix=" + name_suffix))

basepath = "output_tfi/"
if mode == "su":
    basepath = "output_tfi_su/"

if name_suffix != "":
    name_suffix = "_" + name_suffix

if not output_to_terminal:
    f = open(basepath + "log_tfi_gs_2d_D={:d}_chi={:d}_h={:f}_tau={:.0e}{:s}.txt".format(D, chi, h, tau, name_suffix), "a")
    sys.stdout = f
    sys.stderr = f

if os.path.isfile(basepath + statefile):
    a, nns = peps.load(basepath + statefile)
Esempio n. 2
0
import globallog
from time import time
from polish import polish

t0 = time()

chi = int(sys.argv[1])
h = float(sys.argv[2])
statefile = sys.argv[3]
output_to_terminal = "-writehere" in sys.argv

num_workers = 1
if "-workers" in sys.argv:
    num_workers = int(sys.argv[sys.argv.index("-workers") + 1])

globallog.write('tfi_gs_polish.py, chi={0:d}, h={1:f}, statefile="{2:s}"\n'.format(chi, h, statefile))

basepath_in = "output_tfi/"
basepath_out = "output_tfi_polish/"

if not output_to_terminal:
    logfile = open(basepath_out + statefile[:-5] + ".log", "a")
    sys.stdout = logfile
    sys.stderr = logfile


def test_fct(a, A):
    n = len(a)
    X = map(lambda b: peps.make_double_layer(b, o=gates.sigmax), a)
    Z = map(lambda b: peps.make_double_layer(b, o=gates.sigmaz), a)
    AT = map(lambda B: B.transpose([1, 2, 3, 0]), A)
# from polish import polish
import polish

t0 = time()

chi = int(sys.argv[1])
J = int(sys.argv[2])
h = float(sys.argv[3])
statefile = sys.argv[4]

num_workers = 1
if "-workers" in sys.argv:
    num_workers = int(sys.argv[sys.argv.index("-workers") + 1])

globallog.write(
    'heisenberg_gs_polish.py, chi={0:d}, J={1:d}, h={2:f}, statefile="{3:s}"\n'.format(chi, J, h, statefile)
)

basepath = "output_heisenberg_polish/"

if not ("-writehere" in sys.argv):
    logfile = open(basepath + statefile[statefile.rfind("/") + 1 : -5] + ".log", "a")
    sys.stdout = logfile
    sys.stderr = logfile


def test_fct(a, A):
    n = len(a)
    Z = map(lambda b: peps.make_double_layer(b, o=gates.sigmaz), a)
    AT = map(lambda B: B.transpose([1, 2, 3, 0]), A)
    ZT = map(lambda B: B.transpose([1, 2, 3, 0]), Z)