MPSKit.jl
Efficient and versatile tools for working with matrix product states
Table of contents
Installation
MPSKit.jl is a part of the general registry, and can be installed via the package manager as:
pkg> add MPSKit
Key Features
- Construction and manipulation of Matrix Product States (MPS)
- Calculation of observables and expectation values
- Various optimization methods for obtaining MPS fixed points
- Support for both finite and infinite MPS
- Support for wide variety of symmetries, including Abelian, non-Abelian, fermionic and anyonic symmetries
Usage
To get started with MPSKit, we recommend also including TensorKit.jl and MPSKitModels.jl. The former defines the tensor backend which is used throughout MPSKit, while the latter includes some common operators and models.
using TensorOperations
using TensorKit
using MPSKit
using MPSKitModels
using LinearAlgebra: norm
Finite Matrix Product States
Finite MPS are characterised by a set of tensors, one for each site, which each have 3 legs. They can be constructed by specifying the virtual spaces and the physical spaces, i.e. the dimensions of each of the legs. These are then contracted to form the MPS. In MPSKit, they are represented by FiniteMPS
, which can be constructed either by passing in the tensors directly, or by specifying the dimensions of the legs.
d = 2 # physical dimension
D = 5 # virtual dimension
L = 10 # number of sites
mps = FiniteMPS(L, ComplexSpace(d), ComplexSpace(D)) # random MPS with maximal bond dimension D
MPSKit.FiniteMPS{TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}, TensorKit.TensorMap{TensorKit.ComplexSpace, 1, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}(Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[TensorMap((ℂ^1 ⊗ ℂ^2) ← ProductSpace(ℂ^2)):
[:, :, 1] =
0.7265248249531497 + 0.18996930103976348im … 0.24769178947371645 + 0.6121455062455057im
[:, :, 2] =
-0.3069926433531642 + 0.5846613210366283im … 0.7417457001456094 - 0.11721763061178744im
, TensorMap((ℂ^2 ⊗ ℂ^2) ← ProductSpace(ℂ^4)):
[:, :, 1] =
0.2528468313695884 + 0.0696625088927223im … 0.501244495123123 + 0.6766967498232014im
0.3447577177172082 + 0.005383573758412492im 0.31275367290659833 + 0.07313927057370359im
[:, :, 2] =
-0.09550937430527665 + 0.6405512870618496im … 0.3601430407468062 - 0.291188907647239im
-0.26260665603597766 + 0.2741953564963129im 0.16933574445966235 + 0.43961127676372036im
[:, :, 3] =
0.6004123667313221 + 0.27821818168209533im … 0.11369564409263189 + 0.11653008536831677im
-0.2498812183262571 - 0.016766440330273993im -0.6654387629429139 - 0.17338739560722372im
[:, :, 4] =
-0.237636364089287 + 0.13197050619126025im … 0.12187543393070388 - 0.18703447135474802im
0.7489773430129346 + 0.3365694382281207im -0.4456549956209548 - 0.058504759374584776im
, TensorMap((ℂ^4 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.370071466579589 + 0.5562185898111434im … 0.33008766747970125 + 0.3934327996521666im
0.34138407702713763 + 0.2109199761196779im 0.3024165964438669 + 0.13170562101438327im
0.06126888735317986 + 0.059783219099885196im 0.07078047967401972 + 0.05252649192104121im
0.044600541860270834 + 0.04672054887829111im 0.0030074688963673065 + 0.028467169363887542im
[:, :, 2] =
0.207973144032975 - 0.4310788218541415im … -0.43681584506061144 + 0.3252640661946822im
0.2415535763336425 - 0.22574995795988642im 0.2869313100551085 + 0.4632868166333591im
0.030242552964973336 + 0.03993366776229297im -0.15293213695031002 + 0.17232361665050178im
-0.08091855184779942 - 0.07072002855695426im -0.003558649516546707 + 0.02971909965974021im
[:, :, 3] =
0.16531059053828345 - 0.14119784671059604im … -0.4021139583228299 + 0.048421184924749394im
0.10861177014602574 + 0.5256547921400366im 0.20665435785661077 - 0.6253353777768149im
-0.024361249998340995 + 0.0891827197019607im -0.04354420593589673 + 0.11839440717500344im
-0.17688828838133397 + 0.09995570659176467im 0.014734685232944376 - 0.02962114728848368im
[:, :, 4] =
-0.11267289203639354 + 0.28884490354242814im … -0.04619229497759669 - 0.11110029652076231im
0.10937877935020789 - 0.4049245387578058im 0.019309316443349794 - 0.20172049807154574im
0.06751036941689081 + 0.6501923210536996im -0.438576121600121 + 0.11162894694904714im
-0.19073878984075865 - 0.040513467313953624im 0.0069440770532401795 + 0.04707696709346957im
[:, :, 5] =
0.15983802344346382 + 0.3525051399959916im … -0.40928237487082386 + 0.20771899678456912im
-0.09187794343345854 - 0.4422548804926898im -0.007934530538270099 - 0.31428743494771394im
-0.2526012999947558 - 0.3055756253457399im 0.1255576370852477 - 0.11713075813611065im
0.21455914652871225 - 0.27463678537659364im 0.16844659320039204 + 0.012599360482757274im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.5402556552898474 + 0.4540786263932587im … 0.5686918054736695 + 0.39424822502160584im
0.04270874965607674 + 0.08381874495940546im 0.08551167609218305 + 0.05654036471612148im
0.03310196571000648 + 0.0005455490613685519im 0.03905008208022218 + 0.01699830239095776im
0.012667831573835652 + 0.010846519062405864im 0.007909372727382763 + 0.008338553112078633im
0.015901499368700542 + 0.001349724417168941im 0.007755873988035056 + 0.010039123029212152im
[:, :, 2] =
0.12183501219884998 - 0.6752259819561081im … -0.04907840743178436 + 0.6810743415047942im
0.049212478170139295 - 0.052536814658452974im -0.07749774034014903 + 0.17973746102611776im
-0.08787312557203095 + 0.04588050801651416im 0.06091248274527372 - 0.011829794567047108im
-0.002725595232684236 - 0.007417877946798708im 0.003578438496055608 + 0.028338746478914538im
-0.05875089476468797 - 0.0008389855112199279im 0.0337427991003919 + 0.017760670543501104im
[:, :, 3] =
-0.015821049228165115 + 0.021974743824328565im … 0.0333473160959063 + 0.018333340909181817im
0.14430822083047704 - 0.6101003002998624im -0.13904310386527627 + 0.19520962412198511im
0.36607922993309616 - 0.4109333542248672im -0.018303601011321335 + 0.2652256734257705im
-0.08216741483964973 - 0.09564144003009999im -0.08273642865989012 - 0.06969614120054124im
0.35745046782642287 - 0.036690127935605735im -0.09316445794655512 + 0.09150665927147336im
[:, :, 4] =
-0.09235267601002758 - 0.049822341749018104im … 0.1432734725320869 + 0.03999777116891699im
0.10574299124257638 + 0.3787536297737531im -0.3841290548828332 - 0.09859754653475819im
-0.12005374060585088 - 0.4691170355681224im -0.45767025298174263 + 0.16906232385204764im
-0.1181315445262181 + 0.09158690747959691im 0.08966061298865395 + 0.085588806963366im
-0.10406297860452005 - 0.3005634940376293im -0.19779089743070613 - 0.06651943856746118im
[:, :, 5] =
0.06479586646406095 + 0.046280782134110014im … 0.07056408610042042 - 0.0859795000675127im
-0.36782428141135864 - 0.18949106136016694im -0.5124860425032057 + 0.24414389505596068im
0.17276971181223488 + 0.199658255342295im -0.10150298988485888 - 0.2710744469626837im
-0.13518875681644119 + 0.20037233012369016im 0.21396595088574233 + 0.2344063903558715im
-0.22818775300010885 + 0.19016072486876234im -0.15140893079175682 + 0.2530470208881402im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.7034466890346531 + 0.5008820898879087im … 0.3622818960832261 + 0.30484523899987337im
0.1298406726414612 + 0.07122988885211094im 0.08722575872004444 + 0.007183445009998929im
0.005431892176808361 + 0.011806608922266997im 0.008259547560804093 + 0.0073841631177254im
0.008796884557295635 + 0.005376204580494037im 0.007958530826417533 + 0.0041299835084054265im
0.005395103412981254 + 5.267006279277087e-5im 0.0011861567503040993 + 0.0001243782786715126im
[:, :, 2] =
-0.4819921656650857 + 0.005509294303630157im … 0.850944758033392 + 0.08374763565908658im
0.054671053787957336 - 0.14692037346985215im 0.05985677301303339 + 0.08439536506683176im
0.025494316938147205 - 0.004504642199802072im -0.004991999601097979 + 0.012595349647963988im
-0.006880178278922662 - 0.0008026167644981238im 0.005434181015191914 - 0.0037359687632350733im
-0.015740489860383382 + 0.0029725268363670777im 0.007097856533613127 - 0.0005989995484151796im
[:, :, 3] =
0.07888058683293489 - 0.06239723956307795im … -0.014742165190789476 + 0.16601203999557876im
-0.7452036808386728 - 0.2802079940363866im 0.5432268094060947 + 0.061895451719908394im
-0.05888759951839395 - 0.11617000787884728im 0.06051740067224335 + 0.05395118505739829im
0.017659895640819764 - 0.002428943965276171im -0.02648838290362411 + 0.024899422572319158im
0.025724886346378286 + 0.05904061243818727im 0.0035154165623480543 - 0.00018421207591062032im
[:, :, 4] =
-0.05505971324179011 + 0.08962902293687443im … -0.06556548953349672 + 0.10742381413649038im
0.17967066903234719 - 0.5056738721737651im 0.07210360808928692 - 0.7890929144384027im
-0.025862004533021392 - 0.005183073210119982im 0.005850246480862782 - 0.15287707888143373im
-0.04060350121173073 - 0.06289769787834186im -0.06819500718509618 - 0.10664281889771365im
-0.021128330238600772 + 0.013982293405492426im -0.021509520097721842 + 0.10202090825492173im
[:, :, 5] =
-0.009175894010182678 - 0.015483410680170307im … -0.002652452883874376 - 0.019272730898548793im
0.1266855262991582 + 0.06672360086122191im 0.12389147948325557 + 0.010621130187122005im
-0.19964527993308093 - 0.15096846068881897im -0.37485015251207554 + 0.03545758130498627im
-0.1777936621440292 - 0.02322118826931928im -0.7071345532758615 + 0.42433753990774675im
0.03157858684995518 + 0.2098311506509261im 0.03666554981267289 + 0.017109012776356673im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.3670331667864706 + 0.6485689639231811im … 0.41409331803148186 + 0.4670345419871492im
0.028688243523783366 + 0.12652383336097522im 0.10496979517453815 + 0.16122931499876897im
0.004638637055964715 + 0.015381758864700053im 0.026749296778589664 + 0.013809244436249183im
0.0021263594252730026 + 0.002428482027151751im 0.001808220938019624 + 0.004801652475525639im
0.0005579262926404061 + 0.001535703665071138im 0.0011664374268682233 + 0.0006768721473292392im
[:, :, 2] =
0.3884492197991521 - 0.39328554001679406im … -0.33597310955368265 + 0.39180075897456995im
0.1380479181679064 + 0.4568395398271017im -0.34167355280729667 + 0.2505402470061625im
0.11820993617596096 + 0.047709474448402546im 0.005556915271762056 + 0.06299838522553654im
0.001977763804841888 + 0.017547421425767873im -0.011697205030932297 + 0.004044300570119396im
0.005619381782675439 - 0.0012865079349932388im -0.0018663890359832346 + 0.005091008010173067im
[:, :, 3] =
0.14933752828960536 - 0.06610929245365395im … -0.19517117940702308 + 0.42793826711604804im
0.31812883387220864 - 0.2576850634780266im 0.1383100905137475 - 0.7188307768230036im
-0.030510215557844722 - 0.037830901182618955im -0.13882834062633534 - 0.14016089729352538im
-0.008639893366611013 - 0.018289614084099168im 0.06992134509266201 + 0.04112780062843345im
-0.0034204220769885217 - 0.009702941782154749im 0.011240601804916959 - 0.01215398233999867im
[:, :, 4] =
-0.3001439668419208 + 0.1444132163447354im … 0.2711324448631069 - 0.2143685735546858im
0.3725573856272201 + 0.6183651914610623im -0.23883441805112351 - 0.36249918014746285im
0.21290843503258108 + 0.03048691372516377im -0.08357407839508273 - 0.042229893454446756im
0.047856871635015175 + 0.029318642785214986im 0.03648424057406885 + 0.015790353948892468im
0.004548550779308562 - 0.013094145266920645im 0.0016867380042812077 - 0.004117095602247086im
[:, :, 5] =
-0.013965676393462276 + 0.017378472989574123im … 0.018264055986229516 - 0.022614189274088647im
0.140593491961255 - 0.017043750546371545im -0.13390414665465689 + 0.04766814466570404im
-0.30957459321999703 + 0.29912052287057034im 0.18606436531284162 - 0.4663413280063103im
-0.5372444776761676 + 0.44226568107551223im -0.1571503835366697 - 0.035780040833048504im
0.008923301060286493 + 0.0888543554738481im -0.0070400333232301295 + 0.0525678746794394im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.5027390976138644 + 0.46068061998327753im … 0.12957311359198032 + 0.7132726457943875im
0.04028302709643597 + 0.04151179376899777im 0.027546414617415412 + 0.06430098163679497im
0.002717235956551856 - 0.0035934867181239036im 0.006239458078136806 + 0.001077723681329653im
0.021210671971712065 + 0.016065470165354326im 0.00713265851857118 + 0.020464777505613117im
0.0003932003652074409 + 0.00041631727503474165im 0.0003158539239233036 + 0.0013580129856289786im
[:, :, 2] =
-0.5235128974552973 + 0.5021525939606065im … 0.6763123602080084 - 0.07976760447220065im
-0.03261473604816145 + 0.04808288705608876im 0.06840475959028121 - 0.0134024269552963im
0.008288448119968922 + 0.0008193698895301724im 0.015190712257616106 - 0.009614189391508762im
-0.036875375789513665 + 0.00430203181887723im 0.002794548951763158 + 0.000415363383726088im
0.00048813854174233843 - 5.643657485828669e-5im 0.0005318119992154445 - 0.0013604459182669714im
[:, :, 3] =
-0.008325501082988926 - 0.04411706412945108im … -0.028545299337276064 + 0.0038706650531324938im
0.12505946859771627 + 0.7450951366611855im 0.14875742946105613 - 0.11440477940728318im
0.1646357146115891 + 0.23921597186757373im -0.024747090258842794 - 0.03615741400826543im
0.18726570352589195 - 0.25547679768582765im 0.2151632876267091 - 0.39594657464364497im
0.007132818177601239 + 0.027387472714581685im 0.01912443555956105 + 0.017585648214425324im
[:, :, 4] =
-0.053568053323487956 + 0.04095272372632393im … 0.015267533660232563 + 0.022845840234664294im
0.25363794282497054 - 0.36572483109683684im -0.10059474687002115 - 0.14566387677485im
-0.10293348114870103 + 0.15724551152770708im -0.5759294122434959 - 0.11325951345512403im
0.5155811584294845 + 0.0548425242447309im 0.3144928395787836 - 0.12796985800079055im
-0.011178438498563318 + 0.012621581421609601im 0.0321205808259349 + 0.0008164192865780683im
[:, :, 5] =
-0.006640195516106825 - 0.017285989192919907im … 0.061378282267718146 - 0.06387023475066525im
0.17700627618867734 + 0.20289933093923332im -0.5368712762927427 + 0.7574277483023296im
-0.02597031297388655 + 0.0682798327371412im -0.1415511694518804 + 0.02170023162009903im
-0.08848740640318443 + 0.09380349692581677im 0.1155092498252575 + 0.009000961726682154im
0.008684705433463558 - 0.03642479713638315im -0.0031505347679068483 - 0.00863811603063533im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^4)):
[:, :, 1] =
0.569178932011488 + 0.3204725397734965im … 0.6260147123114521 + 0.2970418556245378im
0.23739134436354148 - 0.004429487614848911im 0.18080569200413388 + 0.06290721477335061im
0.006458441846305153 + 0.003955521323063435im 0.008222506116141566 + 0.0039317492340102305im
0.0039709914059849 + 0.0011955110574484128im 0.0021086078348155016 + 0.0016284430497948976im
0.0013367452768285365 + 0.0007140228735170498im 0.0037991032973328878 + 0.0008197906319811897im
[:, :, 2] =
0.2946603983193228 - 0.6215633089617947im … -0.3540724176682535 + 0.5360256891879247im
0.15466793299943116 + 0.018785170804685884im 0.2784605463312886 + 0.10881692686930894im
0.004601833655411826 + 0.0061532565422780655im -0.00763045340202032 + 0.014011653675466113im
0.0022000651509839365 - 0.0006924336530863014im 0.002904084518031918 + 0.0007414881363978154im
0.009971781103848934 + 0.006477421371987448im 0.0007133817935501724 + 0.004152027934679331im
[:, :, 3] =
-0.11768094049498228 - 0.05744814709497493im … 0.15415520712462677 - 0.18752474557689125im
-0.3078245811291211 + 0.6542370889770537im 0.5890670077974736 + 0.225768425733535im
-0.005429119741084398 + 0.028653330807188272im -0.030445158432159343 + 0.014736592726510157im
-0.01806826521114305 - 0.0017867847520045869im 0.022362930263171082 + 0.004660888561993907im
0.008801571340140337 + 0.012826840979725486im -0.00885916446812546 + 0.0012499164629161774im
[:, :, 4] =
0.02665667940138036 + 0.2804074482799204im … -0.213795644720722 - 0.003699345439418855im
-0.298235128938114 - 0.5379087587872204im 0.626955312543 - 0.2427690271435505im
0.0011755692898079463 - 0.11996351158991911im -0.005407380760231574 + 0.11767033890486313im
0.03938220643520984 - 0.023856189944833732im 0.03193458909741944 - 0.056853292576081134im
-0.04867345405928577 - 0.022316987533941547im 0.054682188119433005 + 0.06435349294640907im
, TensorMap((ℂ^4 ⊗ ℂ^2) ← ProductSpace(ℂ^2)):
[:, :, 1] =
0.4732046800454788 + 0.733718629243323im … 0.33627318277232093 + 0.3376970916137779im
0.015693874306083173 + 0.06411168573310314im 0.05811931677205181 + 0.018246246087300105im
0.04016389635061679 + 0.02290892364174499im 0.014300469084510712 + 0.007560743470198283im
0.004193013423968622 + 0.010687923079747263im 0.00345575992908636 + 0.002134802837515988im
[:, :, 2] =
-0.10926046727778467 - 0.4520170356019349im … 0.37818597358001327 + 0.7783908925465991im
-0.06774500267213468 - 0.11812443998103353im 0.02575887991166128 - 0.07528752669325688im
0.004081190275392497 + 0.027809967685511937im 0.026637571549720435 + 0.09035028544538487im
0.007755880461725066 - 0.00781875449133012im -0.001910788827694896 + 0.01278729422574826im
, TensorMap((ℂ^2 ⊗ ℂ^2) ← ProductSpace(ℂ^1)):
[:, :, 1] =
0.42717739677233446 + 0.6257121451497348im … 0.39756062929817415 + 0.4644880116791369im
0.12932435375293586 + 0.15972409734259058im 0.09943377060199002 + 0.008750180322790827im
], Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[missing, missing, missing, missing, missing, missing, missing, missing, missing, missing], Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[missing, missing, missing, missing, missing, missing, missing, missing, missing, missing], Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 1, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, TensorMap(ProductSpace(ℂ^1) ← ProductSpace(ℂ^1)):
1.0 + 0.0im
])
The FiniteMPS
object then handles the gauging of the MPS, which is necessary for many of the algorithms. This is done automatically when needed, and the user can access the gauged tensors by getting and setting the AL
, AR
, CR
/CL
and AC
fields, which each represent a vector of these tensors.
al = mps.AL[3] # left gauged tensor of the third site
@tensor E[a; b] := al[c, d, b] * conj(al[c, d, a])
@show isapprox(E, id(left_virtualspace(mps, 3)))
true
ar = mps.AR[3] # right gauged tensor of the third site
@tensor E[a; b] := ar[a, d, c] * conj(ar[b, d, c])
@show isapprox(E, id(right_virtualspace(mps, 2)))
true
As the mps will be kept in a gauged form, updating a tensor will also update the gauged tensors. For example, we can set the tensor of the third site to the identity, and the gauged tensors will be updated accordingly.
mps.CR[3] = id(domain(mps.CR[3]))
println(mps)
MPSKit.FiniteMPS{TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}, TensorKit.TensorMap{TensorKit.ComplexSpace, 1, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}(Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[TensorMap((ℂ^1 ⊗ ℂ^2) ← ProductSpace(ℂ^2)):
[:, :, 1] =
0.7265248249531497 + 0.18996930103976348im 0.24769178947371645 + 0.6121455062455057im
[:, :, 2] =
-0.3069926433531642 + 0.5846613210366283im 0.7417457001456094 - 0.11721763061178744im
, TensorMap((ℂ^2 ⊗ ℂ^2) ← ProductSpace(ℂ^4)):
[:, :, 1] =
0.2528468313695884 + 0.0696625088927223im 0.501244495123123 + 0.6766967498232014im
0.3447577177172082 + 0.005383573758412492im 0.31275367290659833 + 0.07313927057370359im
[:, :, 2] =
-0.09550937430527665 + 0.6405512870618496im 0.3601430407468062 - 0.291188907647239im
-0.26260665603597766 + 0.2741953564963129im 0.16933574445966235 + 0.43961127676372036im
[:, :, 3] =
0.6004123667313221 + 0.27821818168209533im 0.11369564409263189 + 0.11653008536831677im
-0.2498812183262571 - 0.016766440330273993im -0.6654387629429139 - 0.17338739560722372im
[:, :, 4] =
-0.237636364089287 + 0.13197050619126025im 0.12187543393070388 - 0.18703447135474802im
0.7489773430129346 + 0.3365694382281207im -0.4456549956209548 - 0.058504759374584776im
, TensorMap((ℂ^4 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.370071466579589 + 0.5562185898111434im 0.33008766747970125 + 0.3934327996521666im
0.34138407702713763 + 0.2109199761196779im 0.3024165964438669 + 0.13170562101438327im
0.06126888735317986 + 0.059783219099885196im 0.07078047967401972 + 0.05252649192104121im
0.044600541860270834 + 0.04672054887829111im 0.0030074688963673065 + 0.028467169363887542im
[:, :, 2] =
0.207973144032975 - 0.4310788218541415im -0.43681584506061144 + 0.3252640661946822im
0.2415535763336425 - 0.22574995795988642im 0.2869313100551085 + 0.4632868166333591im
0.030242552964973336 + 0.03993366776229297im -0.15293213695031002 + 0.17232361665050178im
-0.08091855184779942 - 0.07072002855695426im -0.003558649516546707 + 0.02971909965974021im
[:, :, 3] =
0.16531059053828345 - 0.14119784671059604im -0.4021139583228299 + 0.048421184924749394im
0.10861177014602574 + 0.5256547921400366im 0.20665435785661077 - 0.6253353777768149im
-0.024361249998340995 + 0.0891827197019607im -0.04354420593589673 + 0.11839440717500344im
-0.17688828838133397 + 0.09995570659176467im 0.014734685232944376 - 0.02962114728848368im
[:, :, 4] =
-0.11267289203639354 + 0.28884490354242814im -0.04619229497759669 - 0.11110029652076231im
0.10937877935020789 - 0.4049245387578058im 0.019309316443349794 - 0.20172049807154574im
0.06751036941689081 + 0.6501923210536996im -0.438576121600121 + 0.11162894694904714im
-0.19073878984075865 - 0.040513467313953624im 0.0069440770532401795 + 0.04707696709346957im
[:, :, 5] =
0.15983802344346382 + 0.3525051399959916im -0.40928237487082386 + 0.20771899678456912im
-0.09187794343345854 - 0.4422548804926898im -0.007934530538270099 - 0.31428743494771394im
-0.2526012999947558 - 0.3055756253457399im 0.1255576370852477 - 0.11713075813611065im
0.21455914652871225 - 0.27463678537659364im 0.16844659320039204 + 0.012599360482757274im
, missing, missing, missing, missing, missing, missing, missing], Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[missing, missing, missing, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.5084636669413563 + 0.3375616837729061im 0.6107119147627759 + 0.5045143527546623im
-0.7868959309135501 - 0.011510884841716673im 0.6021035867106245 + 0.07152416219923215im
0.07043052703407701 - 0.04870112043662461im -0.059692964860529274 + 0.02856256036107724im
-0.00400130770358601 + 0.019458628091967987im 0.005438971103269352 - 0.013872130623314827im
0.009036732131660126 - 0.006420529196448031im -0.007814257681461989 + 0.0034075434792031345im
[:, :, 2] =
0.0002889994746392212 - 0.0024918631340366897im -1.663589348938055e-5 + 0.0025920154968187806im
0.06434150894010027 - 0.035518579248851295im -0.06185829960489229 + 0.035225797377623796im
0.24977505267008743 - 0.6666690341290539im -0.18415708376765688 + 0.35850896931986664im
-0.2745227837293072 - 0.4084133882581036im -0.2998081052103303 - 0.6816012005623329im
0.20037560946916785 - 0.12399366458768747im 0.053352110515852535 + 0.09943533705684446im
[:, :, 3] =
-7.710292846412238e-5 - 3.1010711267685716e-5im 0.00010591417467976038 + 5.839656476053318e-5im
0.020885296802472773 - 0.03290315675368986im -0.0262391768647975 + 0.01637638628985146im
0.1215858296555905 - 0.45684692327211746im -0.12458752650085929 + 0.27110823038858345im
-0.08358132677155576 - 0.13976513024604448im -0.23739753263794286 - 0.34202675570258256im
-0.2791666893134814 + 0.17816827256952442im -0.18347404003119003 - 0.00957935119860058im
[:, :, 4] =
-1.5443825310495253e-5 - 1.1888343043799708e-5im 1.9954441801586108e-5 + 5.994320256357177e-6im
0.0017279786696768897 + 0.0071828082873597im -0.004159917451379772 - 0.0003758964869593293im
0.0037264620773723063 - 0.06274898702919122im -0.040658814106111725 + 0.029434939972899567im
-0.018944715998261863 + 0.018191824895667407im 0.03878654668199338 - 0.013479881743848152im
-0.15793188444911074 + 0.48072709061285007im 0.5845571663103079 - 0.34751829764693415im
[:, :, 5] =
1.3532211268507906e-6 + 9.665451759302116e-7im 1.4736867846496047e-6 - 1.7956280595763056e-6im
-0.0006650391381823325 - 0.00035132222528152916im -0.0009309378850519569 + 0.00044974961636531696im
0.0021822087748192194 + 0.004109981808620694im 0.0012327320064491577 - 0.0017266301245915593im
-0.006661405266920624 + 0.012740902349119447im 0.014282143002565452 + 0.0103599822002889im
-0.1216099108648927 + 0.1042581872736503im -0.019002945708186367 + 0.208749648802957im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.5647770948887965 + 0.449427054792526im 0.5674243432568911 + 0.39587372422937694im
-0.16512443313615696 - 0.5627288398146996im 0.2118129639892265 + 0.5663487459932726im
-0.01266261879336637 - 0.36568083957737973im 0.029254604091684955 + 0.3929691872536564im
0.030032328493356818 + 0.007899277159329856im -0.01267119461724428 - 0.003056546892134657im
-0.004913727848660466 + 0.004408559882863134im 0.0008632384661358128 - 0.00764251472597921im
[:, :, 2] =
-0.0091529085402094 - 0.00029463762688854665im 0.016364947960446817 + 0.002019978331504938im
0.07837524045671818 - 0.4799794233361619im 0.1296023649886709 + 0.11879343479384605im
-0.3013391972658448 + 0.6793038968223658im -0.16346244849964958 - 0.28076871704930645im
-0.17978864695274738 - 0.30399866709923845im -0.8566166518164842 + 0.07814760239635948im
0.15021658701932572 + 0.04771376781709066im 0.27870520885900574 + 0.05627206597039752im
[:, :, 3] =
9.545679056340952e-6 - 3.087349009186308e-6im -2.5608074200722114e-5 + 7.727518084986749e-5im
-0.052840313755089637 - 0.057631374791549034im 0.06566789988752807 - 0.048123169157819806im
0.04228561865974667 + 0.10473757142479606im -0.10777895063555881 + 0.05805477514232947im
0.11355557396789374 + 0.059136307407657296im -0.013780283653768181 + 0.06564772179810206im
-0.02163508665592047 + 0.2883430189831854im 0.15549182266598155 + 0.5015553257548966im
[:, :, 4] =
-2.056897912431877e-5 + 3.227476707256511e-5im -2.4127919420307908e-5 + 3.8710980556492286e-5im
0.020263019259632913 - 0.05309343157747065im 0.009241667951783019 - 0.08346200801685502im
-0.07450276093976754 + 0.0765072469740669im -0.06681404667845184 + 0.09681598618062018im
-0.07469140039587518 - 0.10116947241702974im -0.304215870693865 + 0.04578368246536345im
-0.2814687060923121 - 0.33406936398269294im -0.5635083367958996 + 0.03913597046984006im
[:, :, 5] =
-1.2623457681341036e-7 - 2.1300832296782654e-7im -3.649031548771405e-8 - 2.651387457524272e-7im
0.0004994053551167796 + 0.0002647280327021221im 0.0004856732886131381 + 5.208678859022878e-5im
-0.0030048048025027464 - 0.002396324410787596im -0.005048304764114352 + 8.182448653596666e-5im
-0.006476909552301645 + 0.005618881768150422im -0.040375286213097134 + 0.03427521195023867im
0.009969042091894309 + 0.10136947017888079im -0.10340364423943409 - 0.06244652645951072im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.4081264866890588 + 0.6308043631840202im 0.4058627039508512 + 0.5202858084379189im
0.28558590261020167 - 0.5345242667516393im -0.2660908044389102 + 0.6323301048869903im
0.06558886609884795 - 0.04640587364569059im -0.06557799033952885 + 0.06021320888410304im
0.10572431869883962 - 0.21891439091326279im -0.10903981878826052 + 0.265871321990528im
0.02777735969197119 + 0.016987133563543595im -0.03332334291307054 - 0.018047922418743617im
[:, :, 2] =
0.004875365977002006 - 0.0051114717757399465im -0.003349094480614386 + 0.0059181495751515455im
0.04241278810126081 + 0.28509849761180234im -0.2753120159502921 - 0.004858183336967581im
0.6077312674535256 + 0.1093651116793245im 0.5732493726201051 - 0.4557568650516996im
-0.3214003416981084 - 0.6186890804597992im 0.5541732682484437 + 0.20335405584944918im
0.0009059286413567657 - 0.08622169597216027im -0.12641137324245644 + 0.03545759902350999im
[:, :, 3] =
0.00037948709022757625 - 0.0001779306127492414im -0.0003811952844025229 + 0.00047246349264163626im
-0.013975648747117287 - 0.03842905254360382im 0.023727413468338766 - 0.010389092042586598im
-0.17371315730368853 + 0.03160845712544562im -0.10246142208685396 + 0.08862620947695887im
-0.037383299519283944 + 0.017623317176760418im 0.05514548270664148 - 0.03545996706742254im
-0.4769497222803882 + 0.09125618737311604im -0.37875052972562906 - 0.5126462588628915im
[:, :, 4] =
-0.00018571498972839333 + 8.863653204311885e-5im 0.00016785605750988975 - 0.0001316818606914087im
0.014847299730503007 + 0.019687474827134187im -0.010525454162534476 - 0.010793888497338828im
0.09668710485925901 + 0.01030426312822053im 0.03866626915202817 - 0.04816169422196998im
0.03222186104089264 - 0.0814653591257281im 0.03009870606922166 + 0.07843503641837im
-0.1150165950064435 - 0.2279434890829768im 0.246352954816835 - 0.27742956805819585im
[:, :, 5] =
-4.946106994512427e-7 + 6.154788668017264e-7im 6.468428203301715e-7 - 8.009078586137002e-7im
0.0002689089967575619 - 3.780043989640829e-5im -0.0002594531626654138 + 9.621595795119377e-5im
-0.03315540980921457 + 0.03341828541118683im 0.019861472497582987 - 0.050825779980394954im
-0.026736845710720932 + 0.025318998986005734im -0.03269413619528573 + 0.02494376782130272im
-0.06380723251612652 + 0.06717114039524781im 0.33552031728678533 + 0.08224063259859558im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.34466421350546894 + 0.6475024054739016im 0.3401824529046467 + 0.5876028806195538im
-0.5985483393246844 + 0.30280401668827683im 0.6326845044929663 - 0.35201619808254225im
0.07214139171020127 + 0.00611440409751066im -0.09163633667429177 - 0.011599832753120931im
-0.033261792854645617 + 0.0038556417809797947im 0.040334806305662496 - 0.0175067837068712im
-0.027643244068053498 - 0.0321643172746512im -0.0032863849647836174 + 0.03415617624383601im
[:, :, 2] =
-0.016213408706034285 + 0.015501209381922273im 0.020886232589268333 - 0.002559784182199672im
0.0278717812985525 + 0.07501191906376853im 0.061566842441519075 + 0.05162075825085896im
0.14813398066558298 + 0.5447093367208445im 0.18310396006061178 + 0.26007013492950204im
-0.3447166949341316 - 0.43296180359408903im 0.2811286322336559 - 0.30028519043493423im
0.04536246450111352 + 0.27327964694674595im 0.28487994089658075 - 0.7639927484764796im
[:, :, 3] =
-5.9942011661715745e-6 - 5.059954040897111e-5im -0.00010219410079726892 - 7.031583804034133e-5im
0.0196091672264678 + 0.058009667202316456im 0.08237460260726809 + 0.042425371495974445im
0.1444796839533955 + 0.27474926449819503im -0.13051992248682506 + 0.5406725111579518im
0.29622426187904743 + 0.016232289733540267im -0.17998727281815305 + 0.05885251648336087im
-0.225556993178737 + 0.3048752116600512im -0.010973496364621638 - 0.05345523893482387im
[:, :, 4] =
-1.9254405923928106e-5 + 1.1535904651747421e-5im -7.44494094762653e-6 - 1.347411191505357e-5im
0.010934348361569146 - 0.010687514544520509im 0.01019830098862634 + 0.012123006103550774im
-0.006504576658278697 + 0.17158758700055132im -0.3501584081342118 + 0.01812569348020225im
0.25426333544675006 + 0.365889515067115im -0.4093318414380026 - 0.07761417054626157im
-0.21689552959141872 - 0.15783669428213826im -0.003342565079971195 - 0.12055374313702158im
[:, :, 5] =
-1.0672526974772507e-6 - 2.7783095467530477e-6im 9.865091646450314e-6 - 1.0265613438761897e-5im
0.00234670615232143 + 0.0027002466270782065im -0.007161082086240129 + 0.010087656668776188im
-0.026581793493597183 + 0.02018552338049957im -0.06074995140921059 - 0.05880960510287485im
-0.07178928571105651 + 0.05621745855042118im -0.06831120070624648 - 0.11181242176351085im
0.05799110231878313 - 0.13550947721784912im 0.009350178115239603 - 0.01806735153067302im
, TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^4)):
[:, :, 1] =
0.6070791521033387 + 0.30583180478128325im 0.6516916102641809 + 0.3320233480214528im
0.19862784747660497 - 0.5363358017973624im -0.15445598096375818 + 0.49605376325330497im
-0.049562234505855576 - 0.4429485136187671im 0.008349496053105032 + 0.4352669014480011im
0.02568468759212754 - 0.0549599548586017im 0.007977949637063386 + 0.01703937041225209im
-0.043773927363301435 - 0.01781542150777371im 0.033888547246299305 + 0.010777445369004535im
[:, :, 2] =
0.018313998652706144 - 0.03341992805461297im -0.021921593039775724 + 0.03235568591805512im
0.3105066846364841 + 0.19462232054638998im 0.32962712852259474 - 0.38790841989734315im
-0.5108702998477259 - 0.13470351898908617im -0.1343567637987452 + 0.5423666762801884im
0.029999038050476785 + 0.6771057415243594im -0.5905814178715084 - 0.016024646665018613im
0.22778040513839193 + 0.03958401074364368im 0.08812819965420068 + 0.15552738871089772im
[:, :, 3] =
-0.00016072543216375697 - 0.00023397386877176585im 0.0005017401909507281 - 0.00042162715110327404im
-0.03748194186860783 + 0.07251419241255129im 0.04333619951475999 + 0.014107414151986714im
0.007349128032383856 + 0.012008394928669883im -0.06968396570980023 - 0.014194886692574129im
-0.3334025802684188 - 0.12139578020110317im -0.028695575326115965 + 0.015530031702756086im
0.06521017023180037 - 0.2823552786674053im -0.01765481401581038 - 0.5739358897824289im
[:, :, 4] =
2.393962275714252e-5 + 0.00025182613441967686im -0.0001920039253452219 - 3.3222793032299787e-6im
-0.009131698662609869 - 0.01735459943651241im 0.019227419087360195 - 0.007152048873476375im
0.004300184732553425 - 0.06927325604712047im -0.03560625481508022 + 0.09552860676294077im
0.15634229360439367 - 0.17940559909334933im 0.04733136784072923 - 0.041497113035141184im
0.5187510273740578 + 0.21019258234364332im -0.2995466265525378 + 0.3072344588538808im
, TensorMap((ℂ^4 ⊗ ℂ^2) ← ProductSpace(ℂ^2)):
[:, :, 1] =
0.4145683735173633 + 0.6311420605769108im 0.45096587607949445 + 0.46833577521092545im
-0.5863330048575088 + 0.24399452245047693im 0.6133212232087073 - 0.3890740910026675im
-0.1568664830519108 + 0.005634583928096126im 0.195243282657644 - 0.07533179722067468im
0.02523470715729971 - 0.03460362686763557im 0.06593016646401578 - 0.040102408858523564im
[:, :, 2] =
-0.009360603654003338 - 0.03872537268552873im 0.03240009030151439 + 0.06668659593492401im
-0.09791749665821214 - 0.1579225919666821im 0.0025733595573798618 - 0.18602340152909155im
0.1336709853687834 + 0.7273668341079689im -0.08708700727409308 + 0.6140453959910323im
0.5225913496930052 - 0.3792798187890386im -0.7278860106259868 + 0.21316159207616425im
, TensorMap((ℂ^2 ⊗ ℂ^2) ← ProductSpace(ℂ^1)):
[:, :, 1] =
0.4387831707687009 + 0.6427118127310695im 0.4083617598082393 + 0.4771074595438908im
0.037075123144312716 + 0.6269101132299123im -0.13009580058947479 - 0.7672576020104827im
], Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 2, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[missing, missing, missing, missing, missing, missing, missing, missing, missing, missing], Union{Missing, TensorKit.TensorMap{TensorKit.ComplexSpace, 1, 1, TensorKit.Trivial, Matrix{ComplexF64}, Nothing, Nothing}}[missing, missing, missing, TensorMap(ProductSpace(ℂ^5) ← ProductSpace(ℂ^5)):
1.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im
0.0 + 0.0im 1.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im
0.0 + 0.0im 0.0 + 0.0im 1.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im
0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 1.0 + 0.0im 0.0 + 0.0im
0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 1.0 + 0.0im
, missing, missing, missing, missing, missing, missing, missing])
These objects can then be used to compute observables and expectation values. For example, the expectation value of the identity operator at the third site, which is equal to the norm of the MPS, can be computed as:
N1 = LinearAlgebra.norm(mps)
N2 = expectation_value(mps, id(physicalspace(mps, 3)), 3)
println("‖mps‖ = $N1")
println("<mps|𝕀₃|mps> = $N2")
Finally, the MPS can be optimized in order to determine groundstates of given Hamiltonians. Using the pre-defined models in MPSKitModels
, we can construct the groundstate for the transverse field Ising model:
H = transverse_field_ising(; J=1.0, g=0.5)
find_groundstate!(mps, H, DMRG(; maxiter=10))
E0 = expectation_value(mps, H)
println("<mps|H|mps> = $(sum(real(E0)) / length(mps))")
[ Info: Iteraton 0 error 0.1353019439455198
[ Info: Iteraton 1 error 0.004042808559787478
[ Info: Iteraton 2 error 6.657552475285875e-5
[ Info: Iteraton 3 error 2.8745340770708428e-5
[ Info: Iteraton 4 error 1.225416136930109e-5
[ Info: Iteraton 5 error 6.186040821911605e-6
[ Info: Iteraton 6 error 3.2483558847115625e-6
[ Info: Iteraton 7 error 1.7129848029743637e-6
[ Info: Iteraton 8 error 9.053435105331808e-7
[ Info: Iteraton 9 error 4.790239911188034e-7
<mps|H|mps> = -0.976550348768947
Infinite Matrix Product States
Similarly, an infinite MPS can be constructed by specifying the tensors for the unit cell, characterised by the spaces (dimensions) thereof.
d = 2 # physical dimension
D = 5 # virtual dimension
mps = InfiniteMPS(d, D) # random MPS
1-site InfiniteMPS:
1: TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.5531005383023921 + 0.607252519915798im … 0.4067306383774567 + 0.3756503914339805im
-0.010141547705201346 - 0.08442141947691222im -0.03983044402118012 - 0.08395812164480079im
-0.010599261358052073 + 0.03377284327167058im -0.003180660046036267 + 0.03704935267708723im
-0.0011358423086808315 + 0.011281313014888588im 0.0026900837493630046 + 0.010744793050151441im
0.0020092912312483606 + 0.0029186956145237372im 0.002917061886598839 + 0.002802552019069812im
[:, :, 2] =
0.5265604343327268 + 0.18025562495910868im … -0.7605199852006858 - 0.19002550896447096im
0.21590152727444156 + 0.056114915634389556im -0.003246310625146529 + 0.1456881627345416im
-0.04081973981944068 - 0.009874058226562309im 0.029753502054964357 - 0.01408915698329287im
0.006590136714703734 - 0.002375543484225724im 0.018186333792088113 - 0.0345250605913451im
-0.010751122330565818 - 0.0046779262267705im -0.006970224069279421 - 0.011763140413815211im
[:, :, 3] =
-0.09983566312139784 + 0.013745777253425623im … 0.24527071778927156 - 0.07231322540828328im
0.7348508699815431 - 0.3131544614034066im 0.10488765306496406 + 0.46310961071148926im
-0.0917034429124699 + 0.01404606457924515im 0.11844433130908437 - 0.0019065318082983427im
-0.004848242807545435 - 0.09012638670528411im 0.06888764673778634 - 0.14366677516801551im
-0.0441553735831531 + 0.007912394358600717im -0.03857106285201272 - 0.03524284821522634im
[:, :, 4] =
0.06507853805011003 - 0.0065623248697108325im … 0.1018007203767694 - 0.019315077881983972im
0.19833958921216102 + 0.44571923721593687im 0.686832760890185 - 0.22504371419650385im
-0.08226017930955813 - 0.30550581668229876im 0.006984562935348071 - 0.1963400375473991im
-0.16072168879191406 + 0.0070033226657583245im -0.20358535531231645 - 0.11440901181484653im
-0.0059249377047215605 + 0.03549532742482982im -0.021405111652895395 + 0.061059404358621186im
[:, :, 5] =
-0.001987200767134987 + 0.01810859088722355im … 0.04077899309024497 + 0.030639729236429762im
-0.13863749849074908 + 0.02796884525891191im -0.11357870191849476 + 0.4135654083586509im
-0.4528698097668999 - 0.026543777728164075im -0.22915782064373802 - 0.4667168999231738im
-0.0919122028370391 + 0.3488997552703871im -0.3232659825030253 + 0.2475819309902917im
0.11238678557788107 - 0.02806805986131829im 0.026432942570067636 - 0.0830651276764271im
The InfiniteMPS
object then handles the gauging of the MPS, which is necessary for many of the algorithms. This is done automatically upon creation of the object, and the user can access the gauged tensors by getting and setting the AL
, AR
, CR
/CL
and AC
fields, which each represent a (periodic) vector of these tensors.
al = mps.AL[1] # left gauged tensor of the third site
@tensor E[a; b] := al[c, d, b] * conj(al[c, d, a])
@show isapprox(E, id(left_virtualspace(mps, 1)))
true
ar = mps.AR[1] # right gauged tensor of the third site
@tensor E[a; b] := ar[a, d, c] * conj(ar[b, d, c])
@show isapprox(E, id(right_virtualspace(mps, 2)))
true
As regauging the MPS is not possible without recomputing all the tensors, setting a single tensor is not supported. Instead, the user should construct a new mps object with the desired tensor, which will then be gauged upon construction.
als = 3 .* mps.AL
mps = InfiniteMPS(als)
1-site InfiniteMPS:
1: TensorMap((ℂ^5 ⊗ ℂ^2) ← ProductSpace(ℂ^5)):
[:, :, 1] =
0.5531005383023921 + 0.607252519915798im … 0.40673063837745665 + 0.3756503914339804im
-0.010141547705201343 - 0.0844214194769122im -0.039830444021180106 - 0.08395812164480078im
-0.010599261358052073 + 0.03377284327167058im -0.003180660046036267 + 0.03704935267708723im
-0.001135842308680831 + 0.011281313014888586im 0.0026900837493630037 + 0.010744793050151441im
0.0020092912312483606 + 0.0029186956145237372im 0.0029170618865988385 + 0.002802552019069812im
[:, :, 2] =
0.5265604343327268 + 0.18025562495910868im … -0.7605199852006859 - 0.190025508964471im
0.21590152727444156 + 0.05611491563438957im -0.0032463106251465223 + 0.14568816273454163im
-0.0408197398194407 - 0.00987405822656231im 0.029753502054964357 - 0.014089156983292876im
0.0065901367147037345 - 0.002375543484225726im 0.018186333792088116 - 0.03452506059134511im
-0.010751122330565818 - 0.004677926226770499im -0.006970224069279424 - 0.011763140413815211im
[:, :, 3] =
-0.09983566312139762 + 0.013745777253425628im … 0.2452707177892715 - 0.07231322540828325im
0.734850869981543 - 0.31315446140340664im 0.10488765306496402 + 0.4631096107114892im
-0.09170344291246968 + 0.014046064579245154im 0.11844433130908434 - 0.001906531808298341im
-0.004848242807545434 - 0.0901263867052841im 0.06888764673778631 - 0.1436667751680155im
-0.04415537358315309 + 0.007912394358600717im -0.03857106285201271 - 0.03524284821522633im
[:, :, 4] =
0.06507853805011002 - 0.006562324869710728im … 0.10180072037676939 - 0.01931507788198407im
0.19833958921216105 + 0.44571923721593676im 0.686832760890185 - 0.22504371419650396im
-0.08226017930955813 - 0.3055058166822987im 0.00698456293534807 - 0.19634003754739912im
-0.16072168879191406 + 0.007003322665758329im -0.20358535531231642 - 0.11440901181484653im
-0.0059249377047215605 + 0.03549532742482982im -0.0214051116528954 + 0.06105940435862119im
[:, :, 5] =
-0.001987200767134975 + 0.018108590887223545im … 0.04077899309024506 + 0.03063972923642977im
-0.13863749849074916 + 0.02796884525891191im -0.11357870191849474 + 0.413565408358651im
-0.4528698097668998 - 0.026543777728164072im -0.22915782064373796 - 0.4667168999231738im
-0.091912202837039 + 0.348899755270387im -0.3232659825030252 + 0.24758193099029155im
0.11238678557788107 - 0.028068059861318287im 0.026432942570067612 - 0.08306512767642708im
These objects can then be used to compute observables and expectation values. For example, the norm of the MPS, which is equal to the expectation value of the identity operator can be computed by:
N1 = norm(mps)
N2 = expectation_value(mps, id(physicalspace(mps, 1)), 1)
println("‖mps‖ = $N1")
println("<mps|𝕀₁|mps> = $N2")
Because infinite MPS cannot sensibly be normalized to anything but $1$, the norm
of an infinite MPS is always set to be $1$ at construction. If this were not the case, any observable computed from the MPS would either blow up to infinity or vanish to zero.
Finally, the MPS can be optimized in order to determine groundstates of given Hamiltonians. Using the pre-defined models in MPSKitModels
, we can construct the groundstate for the transverse field Ising model:
H = transverse_field_ising(; J=1.0, g=0.5)
mps, = find_groundstate(mps, H, VUMPS(; maxiter=10))
E0 = expectation_value(mps, H)
println("<mps|H|mps> = $(sum(real(E0)) / length(mps))")
[ Info: vumps @iteration 1 galerkin = 0.022755270523426435
[ Info: vumps @iteration 2 galerkin = 7.86836714530572e-5
[ Info: vumps @iteration 3 galerkin = 7.295847042078708e-7
[ Info: vumps @iteration 4 galerkin = 5.985652212450518e-8
[ Info: vumps @iteration 5 galerkin = 6.03596643495419e-9
[ Info: vumps @iteration 6 galerkin = 6.433147860540897e-10
[ Info: vumps @iteration 7 galerkin = 6.90231637922318e-11
[ Info: vumps @iteration 8 galerkin = 7.415573022817556e-12
[ Info: vumps @iteration 9 galerkin = 7.966097116250667e-13
<mps|H|mps> = -1.0635444099732518
Additional Resources
For more detailed information on the functionality and capabilities of MPSKit, refer to the Manual section, or have a look at the Examples page.
Keep in mind that the documentation is still a work in progress, and that some features may not be fully documented yet. If you encounter any issues or have questions, please check the library's issue tracker on the GitHub repository and open a new issue.