Converters

Qiskit

lightworks.qubit.qiskit_converter(circuit: QuantumCircuit, allow_post_selection: bool = False) tuple[PhotonicCircuit, PostSelection | None]

Performs conversion of a provided qiskit QuantumCircuit into a photonic circuit within Lightworks.

Parameters:
  • circuit (QuantumCircuit) – The qiskit circuit to be converted.

  • allow_post_selection (bool, optional) – Controls whether post-selected gates can be utilised within the circuit.

Returns:

The created circuit within Lightworks.

PostSelection | NoneIf post-selection rules are required for the

created circuit, then an object which implements these will be returned, otherwise it will be None.

Return type:

PhotonicCircuit

class lightworks.qubit.converter.qiskit_convert.QiskitConverter(allow_post_selection: bool = False)

Manages conversion between qiskit and lightworks circuit, adding each of the qubit gates into a created circuit object.

Parameters:

allow_post_selection (bool, optional) – Controls whether post-selected gates can be utilised within the circuit.

convert(q_circuit: QuantumCircuit) tuple[PhotonicCircuit, PostSelection | None]

Performs conversion of a provided qiskit QuantumCircuit into a photonic circuit within Lightworks.

Parameters:

q_circuit (QuantumCircuit) – The qiskit circuit to be converted.

Returns:

The created circuit within Lightworks.

PostSelection | NoneIf post-selection rules are required for the

created circuit, then an object which implements these will be returned, otherwise it will be None.

Return type:

PhotonicCircuit