operation#

Base classes for MBQC operations

Classes

Command(name, nodes)

A base class for MBQC commands.

Operation([name, nodes])

A base class for quantum operations.

class Command(name: str, nodes: int | list[int])[source]#

Bases: Operation

A base class for MBQC commands.

Parameters:
  • name (str) – The name of the command.

  • nodes (int | list[int]) – The indices of the nodes that the command acts on.

extra_repr() str[source]#
forward(x: GraphState) GraphState[source]#

Perform a forward pass.

class Operation(name: str | None = None, nodes: int | list[int] | None = None)[source]#

Bases: Module

A base class for quantum operations.

Parameters:
  • name (str | None) – The name of the quantum operation. Default: None

  • nodes (int | list[int] | None) – The indices of the nodes that the quantum operation acts on. Default: None