problems.n_minus_1.gate_based

Gate based solution to the N-1 problem.

class tno.quantum.problems.n_minus_1.gate_based.GateBasedNMinusOneSolver(graph, failing_edge, load_flow_correctness, n_toggles=1, n_iter=1, quantum_backend=None, *, exact_superposition=False)[source]

Bases: object

Gate Based N-1 Solver.

The gate based N-1 solver uses Grover to search for grid configurations that have the specified number of toggles and are load flow compliant.

__init__(graph, failing_edge, load_flow_correctness, n_toggles=1, n_iter=1, quantum_backend=None, *, exact_superposition=False)[source]

Init GateBasedNMinusOneSolver.

Parameters:
  • graph (Graph) – A networkx graph representation of an electric network.

  • failing_edge (tuple[int, int]) – The edge that is currently failing i.e (1,4).

  • load_flow_correctness (Iterable[Iterable[tuple[Hashable, Hashable]]]) – A list of edges that are load flow compliant

  • n_toggles (SupportsInt) – Number of toggles possible.

  • n_iter (SupportsInt) – Number of iterations

  • quantum_backend (Optional[Backend]) – A ‘qiskit’ backend. Default is ‘qasm_simulator’.

  • exact_superposition (bool) – Choose if you want to use exact superposition with only useful states or an easier (superfluous) superposition with additional indices.

run()[source]

Run the algorithm.

Return type:

AerJob