Exemplo n.º 1
0
def get_bipartition_rhos(state):
    N = int(log(len(state), 2)) - 1
    c = int(N/2)
    left_rdms  = [0] * c
    left_rdm = mx.rdms(state, range(c))
    left_rdms[-1] = left_rdm
    right_rdms = [0] * (N - c)
    right_rdm = mx.rdms(state, range(c+1, N+1))
    right_rdms[0] = right_rdm
    for j in range(c-1):
        left_rdm = mx.traceout_last(left_rdm)
        left_rdms[c-j-2] = left_rdm
        right_rdm = mx.traceout_first(right_rdm)
        right_rdms[j+1] = right_rdm
    if N % 2 != 0:
        right_rdm = mx.traceout_first(right_rdm)
        right_rdms[-1] = right_rdm
    return left_rdms + right_rdms
Exemplo n.º 2
0
def get_bipartition_rhos(state):
    N = int(log2(len(state))) - 1
    c = int(N / 2)
    left_rdms = [0] * c
    left_rdm = mx.rdms(state, range(c))
    left_rdms[-1] = left_rdm
    right_rdms = [0] * (N - c)
    right_rdm = mx.rdms(state, range(c + 1, N + 1))
    right_rdms[0] = right_rdm
    for j in range(c - 1):
        left_rdm = mx.traceout_last(left_rdm)
        left_rdms[c - j - 2] = left_rdm
        right_rdm = mx.traceout_first(right_rdm)
        right_rdms[j + 1] = right_rdm

    if N % 2 != 0:
        right_rdm = mx.traceout_first(right_rdm)
        right_rdms[-1] = right_rdm
    return left_rdms + right_rdms
Exemplo n.º 3
0
def get_twosite_rhos(state):
    L = int(log2(len(state)))
    twosite_rhos = np.asarray(
        [mx.rdms(state, [j, k]) for j in range(L) for k in iter(range(j))])
    return twosite_rhos
Exemplo n.º 4
0
def get_local_rhos(state):
    L = int(log2(len(state)))
    local_rhos = np.asarray([mx.rdms(state, [j]) for j in range(L)])
    return local_rhos
Exemplo n.º 5
0
def get_center_rho(state, out=None):
    L = int(log2(len(state)))
    center_rho = mx.rdms(state, list(range(int(L / 2))), out=out)
    return center_rho
Exemplo n.º 6
0
def get_rhojk(state):
    L = int(log2(len(state)))
    rhojk = np.asarray(
        [mx.rdms(state, [j, k]) for j in range(L) for k in range(j)])
    return rhojk
Exemplo n.º 7
0
def get_rhoj(state):
    L = int(log2(len(state)))
    rhoj = np.asarray([mx.rdms(state, [j]) for j in range(L)])
    return rhoj
Exemplo n.º 8
0
def get_twosite_rhos(state):
    L = int(log(len(state), 2))
    twosite_rhos = np.asarray([mx.rdms(state, [j, k]) for j in range(L) for k in
        range(j)])
    return twosite_rhos
Exemplo n.º 9
0
def get_local_rhos(state):
    L = int(log(len(state), 2))
    local_rhos = np.asarray([mx.rdms(state, [j]) for j in range(L)])
    return local_rhos
Exemplo n.º 10
0
def get_center_rho(state):
    L = int(log(len(state), 2))
    center_rho = mx.rdms(state, list(range(int(L/2))))
    return center_rho
Exemplo n.º 11
0
import copy
import matplotlib as mpl
from matplotlib.backends.backend_pdf import PdfPages
import json
from collections import namedtuple, Iterable, OrderedDict

from numpy import sin, cos, log, pi
import matrix as mx
import states as ss
import processing as pp
import fio as io
import sweep_eca as sweep

init_state = ss.make_state(3, [('E0_1', 1.0)])

r0 = mx.rdms(init_state, [0])
r1 = mx.rdms(init_state, [1])
r2 = mx.rdms(init_state, [2])

state_1 = mx.op_on_state(mx.listkron([ss.pauli['1']] * 2), [0, 2], init_state)
r0_1 = mx.rdms(state_1, [0])
r1_1 = mx.rdms(state_1, [1])
r2_1 = mx.rdms(state_1, [2])

rd = mx.rdms(state_1, [1, 2])


# sx and sz entropies
# -------------------
def sz(th):
    p0 = 0.5 * (1.0 + cos(2.0 * th))