Skip to content
Snippets Groups Projects
Commit e9c00b96 authored by Bernabeu Lou's avatar Bernabeu Lou
Browse files

Added out method to special elements

parent 1ae27184
No related branches found
No related tags found
No related merge requests found
### ------ 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")})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment