Simulator

class lightworks.Simulator(circuit: PhotonicCircuit, inputs: State | list[State], outputs: State | list[State] | None = None)

Simulates a circuit for a provided number of inputs and outputs, returning the probability amplitude between them.

Parameters:
  • circuit (PhotonicCircuit) – The circuit which is to be used for simulation.

  • inputs (list) – A list of the input states to simulate. For multiple inputs this should be a list of States.

  • outputs (list | None, optional) – A list of the output states to simulate, this can also be set to None to automatically find all possible outputs.

property circuit: PhotonicCircuit

Stores the circuit to be used for simulation, should be a PhotonicCircuit object.

property inputs: list[State]

Stores a lost of all inputs to the system to simulate.

property outputs: list[State] | None

A list of all target outputs or None, if None all possible outputs are calculated on execution.