From e9c00b962da118caf646aecdc2a8f0c0f9af3ae4 Mon Sep 17 00:00:00 2001
From: Lou Bernabeu <lou.bernabeu@student-cs.fr>
Date: Tue, 5 Jan 2021 21:39:05 +0100
Subject: [PATCH] Added out method to special elements

---
 elements/main.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/elements/main.py b/elements/main.py
index 60722db..03a9816 100644
--- a/elements/main.py
+++ b/elements/main.py
@@ -1,14 +1,27 @@
+### ------ Special elements ------
 class Source:
-    def __init__(self, initial_vector=np.array([0., 0.+0j])):
+    def __init__(self, initial_vector=np.array([1., 0.+0j])): ## if no input state given, starts a |0>
         self.photon = initial_vector
         self.next = None
 
+    def out(self, side):
+        return self.photon
+
 
 class Screen:
     def __init__(self, previous=(None, None)):
         self.previous = previous
 
+    def show(self):
+        previous_component, previous_component_output_side = previous
+        print(previous_component.out(previous_component_output_side))
+
+    def out(self):
+        return previous_component.out(previous_component_output_site)
+
+
 
+### ------ Classic Elements ------
 class Element:
     def __init__(self, previous): ## previous is either a single (previous_object, output) tuple, or a 2-dictionary of tuples
         self.previous = previous  ## (as in {"left": (Object 1, "label of chosen output of object 1"), "right": (obj2, "label2")})
-- 
GitLab