qnodeos — squidasm 0.0.2 documentation

# qnodeos

class `squidasm.qnodeos.` `SubroutineHandler`(node, instr_log_dir=None)
  `__init__`(node, instr_log_dir=None)

    An extremely simplified version of QNodeOS for handling NetQASM subroutines

  `run`(self)

    Generator or function that runs the protocol.

    Starting the protocol will execute this function. If a generator it will run it up to the first yield. All yields should return a `EventExpression`, the generator will only continue when the expression has been triggered.

    If a function is returned, this protocol may still yield on the generator of its sub-protocols.

    Sub-protocols are not started automatically when this method is overridden. Either start them manually in the overridden run() or call start_subprotocols() to start them all at once.

    Returns

      If this method returns a generator, then the final return of the generator will be set as the value of `FINISHED`.

    Return type

      Any