Ejemplo n.º 1
0
def build_Tb_tensors():
    """Build the .json file of the 13 Tb tensors cs-sym for the peps-torch CTM.
    """
    tensor_Tb_list = contract_B_cs()
    for i in range(len(tensor_Tb_list)):
        tensor = tensor_Tb_list[i].view(4, 4, 4, 4, 4).contiguous()
        ipeps.write_ipeps(ipeps.IPEPS({(0, 0): tensor}),
                          path + f"input-states/tensor_Tb{i}.json")
Ejemplo n.º 2
0
def build_Ta_tensors():
    """Build the .json file of the 8 Ta tensors c4v-sym for the peps-torch CTM.
    """
    tensor_Ta_list = contract_A_c4v()
    for i in range(len(tensor_Ta_list)):
        tensor = tensor_Ta_list[i].view(4, 4, 4, 4, 4).contiguous()
        ipeps.write_ipeps(ipepsc4v.IPEPS_C4V(tensor),
                          path + f"input-states/tensor_Ta{i}.json")
Ejemplo n.º 3
0
def build_B_tensor(coef_list):
    """Build the .json file associated with the B tensor from the Ta2 .json files.
    """
    B_tensor = torch.zeros([4, 4, 4, 4, 4], dtype=torch.float64)
    for i in range(len(coef_list)):
        tensor_Tb = ipeps.read_ipeps(path + f"input-states/tensor_Tb{i}.json")
        B_tensor += coef_list[i] * tensor_Tb.site(coord=(0, 0))
    ipeps.write_ipeps(ipeps.IPEPS({(0, 0): B_tensor}),
                      path + "input-states/B_tensor.json")
    return B_tensor
Ejemplo n.º 4
0
def build_A_tensor(coef_list):
    """Build the .json file associated with the A tensor from the Ta .json files.
    """
    A_tensor = torch.zeros([4, 4, 4, 4, 4], dtype=torch.float64)
    for i in range(len(coef_list)):
        tensor_Ta = ipepsc4v.read_ipeps_c4v(path +
                                            f"input-states/tensor_Ta{i}.json")
        A_tensor += coef_list[i] * tensor_Ta.site()
    ipeps.write_ipeps(ipepsc4v.IPEPS_C4V(A_tensor),
                      path + "input-states/A_tensor.json")
    return A_tensor
Ejemplo n.º 5
0
def write_ipeps_d2(state,
                   outputfile,
                   aux_seq=[0, 1, 2, 3],
                   tol=1.0e-14,
                   normalize=False):
    # force building of on-site tensors
    tmp_state = IPEPS_D2SYM(state.parent_site)
    ipeps.write_ipeps(tmp_state,
                      outputfile,
                      aux_seq=aux_seq,
                      tol=tol,
                      normalize=normalize)
Ejemplo n.º 6
0
 def write_to_file(self, outputfile, symmetrize=True, **kwargs):
     # symmetrize before writing out
     tmp_t = make_c4v_symm(self.site()) if symmetrize else self.site()
     tmp_state = IPEPS_C4V(tmp_t)
     ipeps.write_ipeps(tmp_state, outputfile, **kwargs)
Ejemplo n.º 7
0
 def write_to_file(self, outputfile, symmetrize=True, **kwargs):
     # symmetrize before writing out
     tmp_state = to_ipeps_c4v(self) if symmetrize else self
     ipeps.write_ipeps(tmp_state, outputfile, **kwargs)