Esempio n. 1
0
	def __init__(self):
		mgen=MarkerGen(6)
		markers=[]
		for i in range(6):
			mgen.enlarge([sz_in])
			mgen.filt()
			marker=deepcopy(mgen.marker)
			marker.reorder()
			marker.compact()
			markers.append(marker)
			print marker.qns,marker.sizes,marker.divs
Esempio n. 2
0
import numpy as np
from scipy.linalg import kron
from scipy.sparse import identity

from mps import MPS,ket2mps#,overlap,expect
from marker import Marker,MarkerGen,sz_in

mgen=MarkerGen(6)
markers=[]
markers.append(deepcopy(mgen.marker))
for i in range(6):
	mgen.enlarge([sz_in])
	mgen.filt()
	marker=deepcopy(mgen.marker)
	markers.append(marker)

class TestMPS(object):
	def __init__(self):
		self.ket=np.random.rand(2**6)
		self.ket2=np.random.rand(2**6)
		self.mps=ket2mps(self.ket,2,6,cano='right')
		self.mps.contract_s()
		self.mps2=ket2mps(self.ket2,2,6,cano='right')
		self.ops=[np.random.random(size=(2,2)) for i in range(6)]

	def check_shape(self):
		for M in self.mps.Ms:
			print M.shape  

	def check_cano(self):
		if self.mps.cano=='left':