-
Notifications
You must be signed in to change notification settings - Fork 1
/
scratch_2.py
41 lines (32 loc) · 849 Bytes
/
scratch_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Demonstration of a phase bias in the linear section of a figure 9
"""
import numpy as np
rot = lambda theta: np.array(
[
[np.cos(theta), -np.sin(theta)],
[np.sin(theta), np.cos(theta)],
]
)
wp = lambda phi: np.array(
[
[np.exp(1j * phi / 2), 0],
[0, np.exp(-1j * phi / 2)],
]
)
wp_rot = lambda wp, theta: rot(-theta) @ wp @ rot(theta)
hwp = wp(np.pi)
phase_bias = 25 * np.pi / 180
wp_pb = wp(phase_bias)
x = np.array([1, 1])
# y = (
# wp_rot(wp_pb, -np.pi / 4)
# @ wp_rot(hwp, np.pi / 4 / 2) # but the angles just add
# @ wp_rot(hwp, np.pi / 2 / 2)
# @ wp_rot(hwp, np.pi / 4 / 2)
# @ wp_rot(wp_pb, np.pi / 4)
# @ x
# )
y = wp_rot(wp_pb, -np.pi / 4) @ wp_rot(hwp, np.pi / 2) @ wp_rot(wp_pb, np.pi / 4) @ x
p = abs(np.angle(y)) * 180 / np.pi
print(abs(np.diff(p)))