knm.py 659 Bytes
Newer Older
Daniel Brown's avatar
Daniel Brown committed
1
import pykat
Daniel Brown's avatar
Daniel Brown committed
2

Daniel Brown's avatar
Daniel Brown committed
3
from pykat.optics.knm import plot_knm_matrix, knmHG, makeCouplingMatrix
Daniel Brown's avatar
Daniel Brown committed
4
from pykat.optics.maps import surfacemap
Daniel Brown's avatar
Daniel Brown committed
5

Daniel Brown's avatar
Daniel Brown committed
6 7
q1 = pykat.BeamParam(w0=5e-2, z=0)
q2 = pykat.BeamParam(w0=5e-2, z=0)
Daniel Brown's avatar
Daniel Brown committed
8

Daniel Brown's avatar
Daniel Brown committed
9
R  = max(q1.w, q2.w)
Daniel Brown's avatar
Daniel Brown committed
10

Daniel Brown's avatar
Daniel Brown committed
11 12 13 14 15 16 17 18 19 20 21
N  = 500
dx = R*6/N

m = surfacemap("empty",
               "phase both",
               size=(N, N),
               center=((N+1)/2, (N+1)/2),
               step_size=(dx, dx))

C = makeCouplingMatrix(2)
K = knmHG(C, q1, q2, surface_map=m)
Daniel Brown's avatar
Daniel Brown committed
22

Daniel Brown's avatar
Daniel Brown committed
23
plot_knm_matrix(C, abs(K))
Daniel Brown's avatar
Daniel Brown committed
24 25 26 27 28 29 30 31 32 33 34 35 36



C = [0,0,0,0] # 00 -> 00
K = knmHG(C, q1, q2, surface_map=m)

print(K)


C = [[0,0,1,0], [0,0,0,0]] # [00->10, 00->00]
K = knmHG(C, q1, q2, surface_map=m)

print(K)