"""Tiny Qiskit snippet used to verify the Souffle-LintQ fact extractor.

Deliberately contains three real anti-patterns so the generated .facts
exercise the Souffle analyses:

  * DoubleMeas   -- qc measures qubit 0 twice with no gate in between.
  * OpAfterMeas  -- qc2 applies a gate to qubit 0 after measuring it.
  * GhostCompose -- qc.compose(sub) return value is discarded.
"""

from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure(0, 0)
qc.measure(0, 0)          # DoubleMeas: qubit 0 measured twice, no gate between

qc2 = QuantumCircuit(1, 1)
qc2.h(0)
qc2.measure(0, 0)
qc2.h(0)                  # OpAfterMeas: gate on qubit 0 after measurement

sub = QuantumCircuit(1, 1)
sub.h(0)
qc.compose(sub)           # GhostCompose: return value discarded
