Skip to content
Snippets Groups Projects
Commit b9b819f2 authored by Daniel Brown's avatar Daniel Brown
Browse files

Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat

parents 12b5e783 4bd19753
No related branches found
No related tags found
No related merge requests found
1.0000000e+02 1.3221987e-17
1.0549764e+02 1.1892014e-17
1.1129751e+02 1.0697027e-17
1.1741624e+02 9.6233229e-18
1.2387136e+02 8.6585877e-18
1.3068136e+02 7.7917584e-18
1.3786574e+02 7.0128946e-18
1.4544510e+02 6.3130646e-18
1.5344114e+02 5.6842429e-18
1.6187678e+02 5.1192187e-18
1.7077617e+02 4.6115125e-18
1.8016482e+02 4.1553025e-18
1.9006963e+02 3.7453572e-18
2.0051896e+02 3.3769761e-18
2.1154277e+02 3.0459350e-18
2.2317262e+02 2.7484385e-18
2.3544184e+02 2.4810757e-18
2.4838557e+02 2.2407817e-18
2.6204090e+02 2.0248019e-18
2.7644696e+02 1.8306611e-18
2.9164501e+02 1.6561346e-18
3.0767859e+02 1.4992233e-18
3.2459363e+02 1.3581301e-18
3.4243861e+02 1.2312401e-18
3.6126464e+02 1.1171018e-18
3.8112565e+02 1.0144104e-18
4.0207855e+02 9.2199328e-19
4.2418337e+02 8.3879641e-19
4.4750342e+02 7.6387246e-19
4.7210553e+02 6.9637002e-19
4.9806018e+02 6.3552396e-19
5.2544171e+02 5.8064677e-19
5.5432858e+02 5.3112082e-19
5.8480355e+02 4.8639134e-19
6.1695392e+02 4.4596020e-19
6.5087180e+02 4.0938025e-19
6.8665436e+02 3.7625032e-19
7.2440411e+02 3.4621061e-19
7.6422921e+02 3.1893866e-19
8.0624375e+02 2.9414563e-19
8.5056810e+02 2.7157298e-19
8.9732923e+02 2.5098946e-19
9.4666113e+02 2.3218842e-19
9.9870511e+02 2.1498536e-19
1.0536103e+03 1.9921567e-19
1.1115339e+03 1.8473266e-19
1.1726420e+03 1.7140573e-19
1.2371096e+03 1.5911873e-19
1.3051214e+03 1.4776850e-19
1.3768722e+03 1.3726347e-19
1.4525676e+03 1.2752255e-19
1.5324245e+03 1.1847396e-19
1.6166716e+03 1.1005432e-19
1.7055503e+03 1.0220774e-19
1.7993153e+03 9.4885079e-20
1.8982351e+03 8.8043226e-20
2.0025931e+03 8.1644475e-20
2.1126884e+03 7.5655973e-20
2.2288363e+03 7.0049214e-20
2.3513696e+03 6.4799584e-20
2.4806394e+03 5.9885947e-20
2.6170159e+03 5.5290272e-20
2.7608899e+03 5.0997283e-20
2.9126736e+03 4.6994141e-20
3.0728018e+03 4.3270151e-20
3.2417332e+03 3.9816479e-20
3.4199519e+03 3.6625898e-20
3.6079684e+03 3.3692530e-20
3.8063214e+03 3.1011596e-20
4.0155790e+03 2.8579147e-20
4.2363410e+03 2.6391768e-20
4.4692395e+03 2.4446230e-20
4.7149421e+03 2.2739070e-20
4.9741524e+03 2.1266108e-20
5.2476132e+03 2.0021909e-20
5.5361079e+03 1.8999274e-20
5.8404629e+03 1.8188844e-20
6.1615503e+03 1.7578950e-20
6.5002899e+03 1.7155798e-20
6.8576521e+03 1.6903997e-20
7.2346609e+03 1.6807352e-20
7.6323962e+03 1.6849767e-20
8.0519975e+03 1.7016076e-20
8.4946670e+03 1.7292690e-20
8.9616729e+03 1.7667984e-20
9.4543530e+03 1.8132454e-20
9.9741189e+03 1.8678680e-20
1.0522460e+04 1.9301162e-20
1.1100946e+04 1.9996097e-20
1.1711236e+04 2.0761136e-20
1.2355077e+04 2.1595145e-20
1.3034314e+04 2.2497999e-20
1.3750893e+04 2.3470401e-20
1.4506867e+04 2.4513740e-20
1.5304402e+04 2.5629976e-20
1.6145782e+04 2.6821557e-20
1.7033418e+04 2.8091350e-20
1.7969854e+04 2.9442599e-20
1.8957771e+04 3.0878893e-20
2.0000000e+04 3.2404143e-20
1.0000000e+02 2.1801158e-18
1.0549764e+02 2.0663790e-18
1.1129751e+02 1.9585621e-18
1.1741624e+02 1.8563564e-18
1.2387136e+02 1.7594689e-18
1.3068136e+02 1.6676221e-18
1.3786574e+02 1.5805530e-18
1.4544510e+02 1.4980120e-18
1.5344114e+02 1.4197628e-18
1.6187678e+02 1.3455810e-18
1.7077617e+02 1.2752543e-18
1.8016482e+02 1.2085812e-18
1.9006963e+02 1.1453706e-18
2.0051896e+02 1.0854414e-18
2.1154277e+02 1.0286221e-18
2.2317262e+02 9.7474986e-19
2.3544184e+02 9.2367033e-19
2.4838557e+02 8.7523723e-19
2.6204090e+02 8.2931184e-19
2.7644696e+02 7.8576263e-19
2.9164501e+02 7.4446488e-19
3.0767859e+02 7.0530034e-19
3.2459363e+02 6.6815688e-19
3.4243861e+02 6.3292815e-19
3.6126464e+02 5.9951334e-19
3.8112565e+02 5.6781681e-19
4.0207855e+02 5.3774788e-19
4.2418337e+02 5.0922057e-19
4.4750342e+02 4.8215331e-19
4.7210553e+02 4.5646876e-19
4.9806018e+02 4.3209358e-19
5.2544171e+02 4.0895821e-19
5.5432858e+02 3.8699668e-19
5.8480355e+02 3.6614647e-19
6.1695392e+02 3.4634826e-19
6.5087180e+02 3.2754585e-19
6.8665436e+02 3.0968596e-19
7.2440411e+02 2.9271811e-19
7.6422921e+02 2.7659446e-19
8.0624375e+02 2.6126975e-19
8.5056810e+02 2.4670113e-19
8.9732923e+02 2.3284807e-19
9.4666113e+02 2.1967229e-19
9.9870511e+02 2.0713764e-19
1.0536103e+03 1.9521006e-19
1.1115339e+03 1.8385746e-19
1.1726420e+03 1.7304971e-19
1.2371096e+03 1.6275856e-19
1.3051214e+03 1.5295758e-19
1.3768722e+03 1.4362213e-19
1.4525676e+03 1.3472932e-19
1.5324245e+03 1.2625798e-19
1.6166716e+03 1.1818861e-19
1.7055503e+03 1.1050334e-19
1.7993153e+03 1.0318592e-19
1.8982351e+03 9.6221637e-20
2.0025931e+03 8.9597306e-20
2.1126884e+03 8.3301184e-20
2.2288363e+03 7.7322915e-20
2.3513696e+03 7.1653442e-20
2.4806394e+03 6.6284921e-20
2.6170159e+03 6.1210612e-20
2.7608899e+03 5.6424763e-20
2.9126736e+03 5.1922491e-20
3.0728018e+03 4.7699653e-20
3.2417332e+03 4.3752717e-20
3.4199519e+03 4.0078645e-20
3.6079684e+03 3.6674775e-20
3.8063214e+03 3.3538718e-20
4.0155790e+03 3.0668257e-20
4.2363410e+03 2.8061238e-20
4.4692395e+03 2.5715433e-20
4.7149421e+03 2.3628350e-20
4.9741524e+03 2.1796944e-20
5.2476132e+03 2.0217222e-20
5.5361079e+03 1.8883727e-20
5.8404629e+03 1.7788968e-20
6.1615503e+03 1.6922917e-20
6.5002899e+03 1.6272736e-20
6.8576521e+03 1.5822905e-20
7.2346609e+03 1.5555806e-20
7.6323962e+03 1.5452701e-20
8.0519975e+03 1.5494869e-20
8.4946670e+03 1.5664683e-20
8.9616729e+03 1.5946425e-20
9.4543530e+03 1.6326756e-20
9.9741189e+03 1.6794870e-20
1.0522460e+04 1.7342411e-20
1.1100946e+04 1.7963240e-20
1.1711236e+04 1.8653130e-20
1.2355077e+04 1.9409460e-20
1.3034314e+04 2.0230924e-20
1.3750893e+04 2.1117283e-20
1.4506867e+04 2.2069157e-20
1.5304402e+04 2.3087868e-20
1.6145782e+04 2.4175310e-20
1.7033418e+04 2.5333857e-20
1.7969854e+04 2.6566294e-20
1.8957771e+04 2.7875771e-20
2.0000000e+04 2.9265764e-20
...@@ -43,6 +43,7 @@ def main(): ...@@ -43,6 +43,7 @@ def main():
extra = kat._kat__blocks['NO_BLOCK'] extra = kat._kat__blocks['NO_BLOCK']
# adding homodyne detector # adding homodyne detector
#kat.addLine('qhdS sens 180 nout1 nout2')
extra.contents.append('qhdS sens 180 nout1 nout2') extra.contents.append('qhdS sens 180 nout1 nout2')
extra.contents.append('scale meter sens') extra.contents.append('scale meter sens')
...@@ -53,8 +54,16 @@ def main(): ...@@ -53,8 +54,16 @@ def main():
# getting mass of the light mirror of cavity a # getting mass of the light mirror of cavity a
global m global m
m = kat.M1a.mass.value m = kat.M1a.mass.value
# getting the anle of incidence on end mirrors:
AoI2 = float(kat.constants['AoI2'].value) / 180.*np.pi
# fsig applied to a BS with AoI!=0 reduces the phase
# change for a given signal in meters. Thus to make the
# finesse results comaptible with the default SQL we need
# to scale the results with cos(AoI):
global AoIScale
AoIScale=np.cos(AoI2)
# setting frequency range
global f global f
f = namedtuple('f', ('start','stop','points','data')) f = namedtuple('f', ('start','stop','points','data'))
f.start=100 f.start=100
...@@ -62,44 +71,65 @@ def main(): ...@@ -62,44 +71,65 @@ def main():
f.points = 100 f.points = 100
kat.parseKatCode('xaxis sig1 f log {0} {1} {2}'.format(f.start, f.stop, f.points-1)) kat.parseKatCode('xaxis sig1 f log {0} {1} {2}'.format(f.start, f.stop, f.points-1))
# Reading Haixing Miao's reference data:
datah1=np.loadtxt('QN_Sagnac_25ppm_loss.dat')
datah2=np.loadtxt('QN_Sagnac_lossless.dat')
print "--------------------------------------------------------" print "--------------------------------------------------------"
print " 0. Run default file" print " Run default file (no loss)"
out = kat.run() out = kat.run()
#f.data = np.logspace(np.log10(f.start), np.log10(f.stop), f.points) #f.data = np.logspace(np.log10(f.start), np.log10(f.stop), f.points)
f.data=out.x # getting frequency vector from Finesse instead f.data=out.x # getting frequency vector from Finesse instead
print "--------------------------------------------------------" print "--------------------------------------------------------"
print " 1. Computing SQL" print " Computing SQL"
hbar=6.62606957E-34/(2.0 *np.pi) hbar=6.62606957E-34/(2.0 *np.pi)
SQL_x= np.sqrt( 4 * hbar / ( m * f.data**2 * 4 * np.pi * np.pi )) SQL_x= np.sqrt( 4 * hbar / ( m * f.data**2 * 4 * np.pi * np.pi ))
legend['SQL']=mylegend('SQL','k') legend['SQL']=mylegend('SQL','k')
result['SQL']=SQL_x result['SQL']=SQL_x
result['default']=out.y result['default']=out.y*AoIScale
legend['default']=mylegend('Stefan D. example file','b') legend['default']=mylegend('Finesse, no loss','m')
result['H1']=datah1[:,1]
legend['H1']=mylegend('Haixing, no loss','k')
legend['H1'].lt='--.'
print "--------------------------------------------------------" print "--------------------------------------------------------"
print " 2. Open ETM ports, i.e. replacing dump nodes" print " Run file with loss (or transmission) on end mirrors"
kat.M2a.remove() L=12.5e-6
kat.M3a.remove() #L=0
kat.parseCommands('bs1 M2a $T_ETM 0 0 0 nM2aw nM2an nM2aT1 nM2aT2') #T=25e-6
kat.parseCommands('bs1 M3a $T_ETM 0 0 0 nM3aw nM3an nM3aT1 nM3aT2') T=0
kat.M2b.remove() R=1-T-L
kat.M3b.remove() kat.M2a.R=R
kat.parseCommands('bs1 M2b $T_ETM 0 0 0 nM2bw nM2bn nM2bT1 nM2bT2') kat.M3a.R=R
kat.parseCommands('bs1 M3b $T_ETM 0 0 0 nM3bw nM3bn nM3bT1 nM3bT2') kat.M2b.R=R
kat.M3b.R=R
kat.M2a.T=T
kat.M3a.T=T
kat.M2b.T=T
kat.M3b.T=T
kat.M2a.L=L
kat.M3a.L=L
kat.M2b.L=L
kat.M3b.L=L
out=kat.run() out=kat.run()
result['open']=out.y result['loss']=out.y*AoIScale
legend['open']=mylegend('Opening M2/M3 ports','r') legend['loss']=mylegend('Finesse, 25ppm loss','b')
print "--------------------------------------------------------" result['H2']=datah2[:,1]
print " 3. Imbalanced BS" legend['H2']=mylegend('Haixing, 25ppm loss','k')
result['bs']=imbalanced_bs(kat) legend['H2'].lt='-.'
legend['bs']=mylegend('Imbalanced BS 49:51','g')
print "--------------------------------------------------------" print "--------------------------------------------------------"
print " 3. Mass asymmetry" print " Additional imbalanced BS"
result['mass']=mass(kat) result['bs']=imbalanced_bs(kat)*AoIScale
legend['mass']=mylegend('Mass asymmetry 10%','c') legend['bs']=mylegend('Imbalanced BS 49:51','r')
#print "--------------------------------------------------------"
#print " Mass asymmetry"
#result['mass']=mass(kat)*AoIScale
#legend['mass']=mylegend('Mass asymmetry 10%','c')
print "--------------------------------------------------------" print "--------------------------------------------------------"
print " Plotting results" print " Plotting results"
...@@ -130,19 +160,29 @@ def imbalanced_bs(tmpkat): ...@@ -130,19 +160,29 @@ def imbalanced_bs(tmpkat):
out=kat.run() out=kat.run()
return out.y return out.y
def update_plot(f, result):
for i, T in enumerate(result.keys()):
data=result[str(T)]
for j,f1 in enumerate(f):
lines[i].set_ydata(data(j))
fig.canvas.draw()
def plot_results(f, result, legend): def plot_results(f, result, legend):
fig=pl.figure() fig=pl.figure(232)
fig.clear()
N=len(result) N=len(result)
lines={}
for i, T in enumerate(result.keys()): for i, T in enumerate(result.keys()):
data=result[str(T)] data=result[str(T)]
pl.plot(f.data, data,legend[str(T)].lt, color=legend[str(T)].color, label=legend[str(T)].text, lw=legend[str(T)].lw) lines[i],=pl.plot(f.data, data,legend[str(T)].lt, color=legend[str(T)].color, label=legend[str(T)].text, lw=legend[str(T)].lw)
#line.set_dashes([12, 4]) #line.set_dashes([12, 4])
ax=pl.gca() ax=pl.gca()
ax.set_yscale('log') ax.set_yscale('log')
ax.set_xscale('log') ax.set_xscale('log')
pl.xlabel("f [Hz}") pl.xlabel("f [Hz]")
pl.ylabel("Sensitivity [m/sqrt(hz)]") pl.ylabel("Sensitivity [m/sqrt(Hz)]")
pl.xlim([f.start,f.stop]) pl.xlim([f.start,f.stop])
pl.ylim([1E-20, 2E-17]) pl.ylim([1E-20, 2E-17])
pl.grid() pl.grid()
......
...@@ -6,17 +6,20 @@ ...@@ -6,17 +6,20 @@
# Andreas Freise, 30.10.2014 # Andreas Freise, 30.10.2014
# #
# The parameters below don't necessarily match the current # The parameters below don't necessarily match the current
# speedmeter design, instead they were chosen to match Stefan # speedmeter design, instead they were chosen to fit an example
# Danilishin's Matlab example for comparison. However, you can # file from Stefan Danilishin. However, you can easily change
# easily change the parameters to an updated design without # the parameters to an updated design without problem.
# problem. No special tuning or so is required.
################################################################# #################################################################
## general constants ## general constants
const Pin 0.6 # double the power at the BS, which for this example is 0.3W const Pin 0.6 # double the power at the BS, which for this example is 0.3W
const MassM1 1m # Mass M1 in [kg]: 1 gramm const MassM1 1m # Mass M1 in [kg]: 1 gramm
const MassM23 100m # Mass M2, M3: 100 gramm const MassM23 100 # Mass M2, M3: 100 gramm
const T_ETM 12.5u # transmission of cavity end mirrors (cavity loss) const T_ETM 0u # transmission of cavity end mirrors (cavity loss)
const L_ETM 0u # loss of cavity end mirrors (cavity loss)
const AoI 0 # angle of incidence on input mirror (4.4 deg)
const AoI2 0 # angle of incidence on end mirror (42.8 deg)
## lengths of some ray segments ## lengths of some ray segments
const lrs2 0.250 const lrs2 0.250
...@@ -50,21 +53,14 @@ s rs7 $lrs7 nM6e nM7w ...@@ -50,21 +53,14 @@ s rs7 $lrs7 nM6e nM7w
bs M7 1 0 0 49.39870535E0 nM7w nM7n dump dump bs M7 1 0 0 49.39870535E0 nM7w nM7n dump dump
s rs8 $lrs8 nM7n nM1an s rs8 $lrs8 nM7n nM1an
bs1 M1a 500u 0 0 0 nM1aw nM1an nM1ae nM1as bs1 M1a 500u 0 0 $AoI nM1aw nM1an nM1ae nM1as
attr M1a Rc -7.91 attr M1a Rc -7.91
attr M1a mass $MassM1 attr M1a mass $MassM1
s rs12 1.315 nM3an nM1ae s rs12 1.315 nM3an nM1ae
################################################################## bs1 M3a $T_ETM $L_ETM 0 $AoI2 nM3aw nM3an nM3aT1 nM3aT2
# Note that the following lines are 'wrong'. The 'dump' notes
# are not open ports, i.e. even with the transmssion of the ETMs
# non-zero, no quantum noise will enter through this port.
# I am using dump notes here to match Stefan's example calculation,
# but you should not use 'dump' nodes with any mirror or BS that
# has non-zero losses or transmission
bs1 M3a $T_ETM 0 0 0 nM3aw nM3an dump dump #nM3aT1 nM3aT2
attr M3a mass $MassM23 attr M3a mass $MassM23
s rs11 0.2 1. nM2an nM3aw s rs11 0.2 1. nM2an nM3aw
bs1 M2a $T_ETM 0 0 0 nM2aw nM2an dump dump #nM2aT1 nM2aT2 bs1 M2a $T_ETM $L_ETM 0 $AoI2 nM2aw nM2an nM2aT1 nM2aT2
attr M2a mass $MassM23 attr M2a mass $MassM23
s rs10 1.315 nM1as nM2aw s rs10 1.315 nM1as nM2aw
cav AC_a M1a nM1as M1a nM1ae cav AC_a M1a nM1as M1a nM1ae
...@@ -83,21 +79,14 @@ s rs26 $lrs26 nM8n nM1bw ...@@ -83,21 +79,14 @@ s rs26 $lrs26 nM8n nM1bw
################################################################# #################################################################
## Cavity b ## Cavity b
bs1 M1b 500u 0 0 0 nM1bw nM1bn nM1be nM1bs bs1 M1b 500u 0 0 $AoI nM1bw nM1bn nM1be nM1bs
attr M1b Rc -7.91 attr M1b Rc -7.91
attr M1b mass $MassM1 attr M1b mass $MassM1
s rs19 1.315 nM1be nM2bw s rs19 1.315 nM1be nM2bw
################################################################## bs1 M2b $T_ETM $L_ETM 0 $AoI2 nM2bw nM2bn nM2bT1 nM2bT2
# Note that the following lines are 'wrong'. The 'dump' notes
# are not open ports, i.e. even with the transmssion of the ETMs
# non-zero, no quantum noise will enter through this port.
# I am using dump notes here to match Stefan's example calculation,
# but you should not use 'dump' nodes with any mirror or BS that
# has non-zero losses or transmission
bs1 M2b $T_ETM 0 0 0 nM2bw nM2bn dump dump #nM2bT1 nM2bT2
attr M2b mass $MassM23 attr M2b mass $MassM23
s rs20 0.2 nM2bn nM3bw s rs20 0.2 nM2bn nM3bw
bs1 M3b $T_ETM 0 0 0 nM3bw nM3bn dump dump #nM3bT1 nM3bT2 bs1 M3b $T_ETM $L_ETM 0 $AoI2 nM3bw nM3bn nM3bT1 nM3bT2
attr M3b mass $MassM23 attr M3b mass $MassM23
s rs21 1.315 nM3bn nM1bs s rs21 1.315 nM3bn nM1bs
cav AC_b M1b nM1bs M1b nM1be cav AC_b M1b nM1bs M1b nM1be
...@@ -124,7 +113,7 @@ bs dHD .5 .5 0 0 nHD1 nout1 nout2 nl3 ...@@ -124,7 +113,7 @@ bs dHD .5 .5 0 0 nHD1 nout1 nout2 nl3
# homodyne detector, use 180 deg phase for normal use, i.e. output=nout1-nout2 # homodyne detector, use 180 deg phase for normal use, i.e. output=nout1-nout2
#qhdS sens 180 nout1 nout2 #qhdS sens 180 nout1 nout2
# scale output to m/sqrt(Hz) # re-scaling output to m/sqrt(Hz)
#scale meter sens #scale meter sens
%xaxis sig1 f log 100 100k 99 %xaxis sig1 f log 100 100k 99
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment