Esempio n. 1
0
 def receive(self, command_list):
     for cmd in command_list:
         if not cmd.gate == ops.FlushGate():
             self._store(cmd)
         else:
             self._run()
             self._reset()
    def receive(self, command_list):
        """
        Receives a command list and, for each command, stores it until
        completion.

        Args:
            command_list: List of commands to execute
        """
        for cmd in command_list:
            if not cmd.gate == pqo.FlushGate():
                self._store(cmd)
            else:
                self._run()
                self._new = True
Esempio n. 3
0
    def receive(self, command_list):
        """
        Receives a list of commands and appends to local Circuit. If a flush gate is received, 
        optimises the Circuit using a default Transform pass and then sends the commands from
        this optimised Circuit into the next engine.
        """
        for cmd in command_list:
            if cmd.gate == pqo.FlushGate(): #flush gate --> optimize and then flush
                cmd_list = self._optimise()
                cmd_list.append(cmd)
                self._circuit = Circuit()
                self._qubit_dictionary = dict()
                self.send(cmd_list)
                continue

            _handle_gate(cmd,self)