class mentpy.BaseSimulator(abc.ABC)

Base class for simulators.

Note

This class should not be used directly. Instead, use one of the subclasses.

Parameters:
mbqcircuit : mp.MBQCircuit

The MBQC circuit used for the simulation.

input_state : np.ndarray

The input state of the simulator.

See also

mp.PatternSimulator, mp.PennylaneSimulator, mp.CirqSimulator

Constructors

BaseSimulator(mbqcircuit: MBQCircuit, ...)

Initialize self. See help(type(self)) for accurate signature.

String representation

__repr__() str

Return repr(self).

Special methods

__call__(angles: List[float], **kwargs)

Call self as a function.

Methods

abstract measure(angle: float, **kwargs)

Measures the state of the system.

abstract reset(input_state=None)

Resets the simulator to the initial state.

abstract run(angles: List[float], **) Tuple[List[int], ndarray]

Measures the state of the system.

Properties

property input_state : ndarray

The input state of the simulator.

property mbqcircuit : MBQCircuit

The MBQC circuit used for the simulation.

property outcomes : dict

The outcomes of the simulation.