Device Interface

graphix.device_interface module

Quantum hardware device interface.

Runs MBQC command sequence on quantum hardware.

class graphix.device_interface.PatternRunner(pattern: Pattern, backend: str = 'ibmq', **kwargs)[source]

MBQC pattern runner.

Executes the measurement pattern.

__init__(pattern: Pattern, backend: str = 'ibmq', **kwargs) None[source]

Instantiate a pattern runner.

Parameters:
  • pattern (graphix.pattern.Pattern object) – MBQC pattern to be executed.

  • backend (str) – execution backend (optional, default is ‘ibmq’)

  • kwargs (dict) – keyword args for specified backend.

run(**kwargs) Any[source]

Perform the execution.

Parameters:

kwargs (dict) – keyword args for specified backend.

Returns:

result – the measurement result, in the representation depending on the backend used.

Return type:

Any

retrieve_result(**kwargs) Any[source]

Retrieve the execution result.

Parameters:

kwargs (dict) – keyword args for specified backend.

Returns:

result – the measurement result, in the representation depending on the backend used.

Return type:

Any