Skip to content

Commit

Permalink
Merge pull request #1107 from qiboteam/qm-disconnect
Browse files Browse the repository at this point in the history
Really disconnect QM (0.1)
  • Loading branch information
stavros11 authored Dec 1, 2024
2 parents cc64ee1 + e46b12c commit bdf1adc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/qibolab/instruments/qm/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def disconnect(self):
self._reset_temporary_calibration()
if self.manager is not None:
self.manager.close_all_quantum_machines()
self.manager = None
self.is_connected = False

def calibrate_mixers(self, qubits):
Expand Down Expand Up @@ -287,6 +288,10 @@ def execute_program(self, program):
Args:
program: QUA program.
"""
if self.manager is None:
raise RuntimeError(
"Quantum Machines are not connected. Please use ``platform.connect()``."
)
machine = self.manager.open_qm(self.config.__dict__)
return machine.execute(program)

Expand Down

0 comments on commit bdf1adc

Please sign in to comment.