Skip to content

Commit

Permalink
Updated the gui with the new Fock backend as much as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSekavcnik committed Mar 3, 2024
1 parent 1432eab commit cf3c771
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 9 additions & 3 deletions quasi/gui/simulation/simulation_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
the simulation engine
"""
from quasi.simulation import Simulation, DeviceInformation
from quasi.backend.fock_first_backend import FockBackendFirst
from quasi.experiment import Experiment


class SimulationWrapper:
Expand Down Expand Up @@ -31,10 +33,14 @@ def execute(self):
"""
Execution Trigger
"""
print("START THE SIMULATION")
self.simulation.list_devices()
print(self.signals)
# We hardcode the backend for now
self.simulation.set_backend(FockBackendFirst())
self.simulation.run()
# We print the experiment outcome
exp = Experiment.get_instance()
state = exp.state
print(state.all_fock_probs())

def add_device(self, device):
self.devices.append(device)
Expand All @@ -44,7 +50,7 @@ def get_device(self, uid):
d = [x for x in self.devices if x.ref.uuid == uid]
for x in self.devices:
print(x.ref)
if len(d)==1:
if len(d) == 1:
return d[0]
return None

Expand Down
5 changes: 5 additions & 0 deletions quasi/simulation/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ def run(self):
"""
# Determine number of modes
modes = sum([d.new_modes for d in self.devices])
print(f"Number of modes {modes}")
print(self.backend)
print(isinstance(self.backend,FockBackend))
print("\n\n")
if isinstance(self.backend,FockBackend):
print("Correct backend?")
self.backend.set_number_of_modes(modes)
self.backend.set_dimensions(self.dimensions)
self.backend.initialize()
Expand Down

0 comments on commit cf3c771

Please sign in to comment.