mqt.qcec.verify_hard_timeout

Run equivalence checks in a terminable process.

Functions

verify_with_hard_timeout(circ1, circ2, deadline, **kwargs) → dict[str, Any]

Verify two circuits in a process that is killed after deadline seconds.

Module Contents

verify_with_hard_timeout(circ1: str | PathLike[str] | QuantumCircuit, circ2: str | PathLike[str] | QuantumCircuit, deadline: float, **kwargs: Unpack[ConfigurationOptions]) → dict[str, Any][source]

Verify two circuits in a process that is killed after deadline seconds.

Use this function only when a check needs forced termination. For other checks, prefer verify() with its cooperative timeout option. A worker process adds substantial overhead, especially for Qiskit inputs.

Inputs may be file paths, OpenQASM text, or Qiskit circuits. Qiskit circuits are serialized with QPY before the worker starts. The timeout covers worker startup and circuit loading after process creation, but not serialization in the caller. Process creation itself may delay the timeout on some platforms. Successful checks return the JSON result of verify(), including checker statistics but no DD counterexamples. A deadline raises TimeoutError; other worker failures raise RuntimeError.

Parameters:
  • circ1 – First circuit as a file path, OpenQASM text, or Qiskit circuit.

  • circ2 – Second circuit in the same supported forms.

  • deadline – Positive worker timeout in seconds.

  • **kwargs – Options accepted by verify().

Returns:

The verification result as a JSON-style dictionary.