Skip to content

Commit 69a2933

Browse files
author
tomoki.ohtsuki
committed
added current central charge example
1 parent 707de1f commit 69a2933

2 files changed

Lines changed: 130 additions & 3 deletions

File tree

examples/3dBosonic.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import sage.cboot as cb
2+
context=cb.context_for_scalar(epsilon=0.5,Lambda=13)
3+
4+
lmax=25
5+
nu_max=12
6+
cbs={}
7+
for spin in range(0,lmax,2):
8+
g=context.approx_cb(nu_max,spin)
9+
cbs.update({spin:g})
10+
11+
def make_F(delta,spin,gap_dict):
12+
mat_F=context.make_F_minus_matrix(delta)
13+
try:
14+
gap=context(gap_dict[spin])
15+
except KeyError:
16+
if spin==0:
17+
gap=context.epsilon
18+
else:
19+
gap=2*context.epsilon+spin
20+
g_shift=cbs[spin].shift(gap)
21+
F=context.dot(mat_F,g_shift)
22+
return F
23+
24+
def make_SDP(delta,gap_dict):
25+
delta=context(delta)
26+
Fs=[make_F(delta,spin,gap_dict) for spin in cbs.keys()]
27+
mat_F=context.make_F_minus_matrix(delta)
28+
norm=context.dot(mat_F,context.gBlock(0,0,0,0))
29+
obj=norm*0
30+
return context.SDP(norm,obj,Fs)
31+
32+
from subprocess import Popen, PIPE
33+
import re
34+
35+
sdpb="sdpb"
36+
sdpbparams=["--findPrimalFeasible","--findDualFeasible","--noFinalCheckpoint"]
37+
def bs(delta,upper=3,lower=1,sdp_method=make_SDP):
38+
upper=context(upper)
39+
lower=context(lower)
40+
while upper - lower > 0.001:
41+
D_try=(upper+lower)/2
42+
prob=sdp_method(delta,{0:D_try})
43+
prob.write("3d_Ising_binary.xml")
44+
sdpbargs=[sdpb,"-s","3d_Ising_binary.xml"]+sdpbparams
45+
out, err=Popen(sdpbargs,stdout=PIPE,stderr=PIPE).communicate()
46+
sol=re.compile(r'found ([^ ]+) feasible').search(out).groups()[0]
47+
if sol=="dual":
48+
print("(Delta_phi, Delta_epsilon)={0} is excluded."\
49+
.format((float(delta),float(D_try))))
50+
upper=D_try
51+
elif sol=="primal":
52+
print("(Delta_phi, Delta_epsilon)={0} is permitted."\
53+
.format((float(delta),float(D_try))))
54+
lower=D_try
55+
else:
56+
raise RuntimeError("Unexpected return from sdpb")
57+
return upper
58+
59+
def make_SDP_for_cc(delta,gap_dict={0:1}):
60+
delta=context(delta)
61+
Fs=[make_F(delta,spin,gap_dict) for spin in cbs.keys()]
62+
mat_F=context.make_F_minus_matrix(delta)
63+
norm=context.dot(mat_F,context.gBlock(2,3,0,0))
64+
obj=context.dot(mat_F,context.gBlock(0,0,0,0))
65+
return context.SDP(norm,obj,Fs)
66+
67+
def cc(delta):
68+
prob=make_SDP_for_cc(delta)
69+
prob.write("3d_Ising_cc.xml")
70+
sdpbargs=[sdpb,"-s","3d_Ising_cc.xml","--noFinalCheckpoint"]
71+
out, err=Popen(sdpbargs,stdout=PIPE,stderr=PIPE).communicate()
72+
sol=re.compile(r'primalObjective *= *([^ ]+) *$',re.MULTILINE)\
73+
.search(out).groups()[0]
74+
return -delta**2/float(sol)
75+
76+
def make_SDP_epsilon_prime(delta,gap_dict):
77+
delta=context(delta)
78+
Fs=[make_F(delta,spin,gap_dict) for spin in cbs.keys()]
79+
mat_F=context.make_F_minus_matrix(delta)
80+
Fs+=[context.dot(mat_F,context.gBlock(0,delta,0,0))]
81+
norm=context.dot(mat_F,context.gBlock(0,0,0,0))
82+
obj=norm*0
83+
return context.SDP(norm,obj,Fs)
84+
85+
if __name__=='__main__':
86+
# The default example
87+
#delta=0.518
88+
#print(bs(delta))
89+
90+
# ===============================================
91+
# if you want to derive the central charge lower bound,
92+
# uncomment the follwing lines.
93+
#delta=0.518
94+
#print("central charge lower bound at delta={0} is {1}"\
95+
# .format(delta,cc(delta)))
96+
97+
# ===============================================
98+
# The upper bound on epsilon' dimension.
99+
Delta_epsilon=0.8
100+
print(bs(Delta_epsilon,sdp_method=make_SDP_epsilon_prime))

examples/3dOn2.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,40 @@ def bs(delta,upper=3,lower=1,sector="S",sdp_method=make_SDP,NSO=2):
7878
raise RuntimeError("Unexpected return from sdpb")
7979
return upper
8080

81+
def make_SDP_ccc(delta,gap_dict,NSO):
82+
delta=context(delta)
83+
pvms=[]
84+
for sector in ("S","T","A"):
85+
if sector is not "A":
86+
spins=[spin for spin in cbs.keys() if not spin%2]
87+
else:
88+
spins=[spin for spin in cbs.keys() if spin%2]
89+
for spin in spins:
90+
pvms.append(make_F(delta,sector,spin,gap_dict,NSO))
91+
92+
norm=make_F(delta,"A",1,None,NSO,Delta=1+2*context.epsilon)
93+
obj=make_F(delta,"S",0,None,NSO,Delta=0)
94+
return context.sumrule_to_SDP(norm,obj,pvms)
95+
96+
def ccc(delta,NSO=20):
97+
prob=make_SDP_ccc(delta,{},NSO)
98+
prob.write("3d_On_ccc.xml")
99+
sdpbargs=[sdpb,"-s","3d_On_ccc.xml","--noFinalCheckpoint"]
100+
out, err=Popen(sdpbargs,stdout=PIPE,stderr=PIPE).communicate()
101+
sol=re.compile(r'primalObjective *= *([^ ]+) *$',re.MULTILINE)\
102+
.search(out).groups()[0]
103+
return -1/float(sol)
81104

82105
if __name__=="__main__":
83106
# The default example
84-
print bs(0.52)
107+
#print bs(0.52)
85108

86109
# ======================================
87110
# if you want to derive the bound on Delta_T
88-
print bs(0.52,sector="T")
89-
111+
#print bs(0.52,sector="T")
90112

113+
# ======================================
114+
# Current central charge lowr bound for O(20)
115+
print ccc(0.50639,NSO=20)/2
116+
# Delta_phi value 0.50369 is taken from 1307.6856
117+
# BTW, Large N prediction for O(20) vector model is 0.9639

0 commit comments

Comments
 (0)