summaryrefslogtreecommitdiff
path: root/src/phys.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/phys.py')
-rw-r--r--src/phys.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/phys.py b/src/phys.py
index 2109f28..96f3bad 100644
--- a/src/phys.py
+++ b/src/phys.py
@@ -57,6 +57,8 @@ class Polarizer:
self.angle = 0
self.delta = delta
self.ref = False # FIXME: move this to UI or System
+ self.t1 = 1
+ self.t2 = 0
self.set_type(type)
def set_type(self, type):
@@ -74,12 +76,17 @@ class Polarizer:
if state is None:
if self.type == "linear":
return np.dot(R(-self.angle - self.delta), \
- np.array([[1], [0]]))
+ np.array([[1], [0]])) * np.sqrt(self.t1)
else:
return None
+ if type == "linear":
+ A = np.sqrt(np.array([[self.t1, 0], [0, self.t2]]))
+ else:
+ A = np.sqrt(np.array([[self.t1, 0], [0, self.t1]]))
+
M = np.matmul(R(-self.angle - self.delta), \
- np.matmul(self.M, R(self.angle + self.delta)))
+ np.matmul(np.matmul(self.M, A), R(self.angle + self.delta)))
return np.dot(M, state)
class System: