Skip to main content

Quantum-enhanced Local Outlier Factor algorithm

Project description

QuantumLOFClassifier (Quantum Local Outlier Factor Classifier)

This package provides a quantum-enhanced version of the Local Outlier Factor (LOF) anomaly detection model, utilizing quantum computing tools such as Qiskit and D-Wave.

📘 Overview

QuantumLOFClassifier is an estimator based on the classical Local Outlier Factor (LOF) method, enhanced with quantum-based k-distance estimation using backends such as simulators or real quantum devices.

Note: Real quantum hardware execution is not yet tested.

  • Quantum circuit execution via Qiskit AerSimulator or IBM Quantum Runtime
  • Classical LOF concepts: k-distance, local reachability density (LRD), and LOF scores
  • Anomaly detection based on a user-defined delta threshold
  • Dual-model architecture: separate classifiers for clean and noisy data

🔍 References

This implementation is inspired by the following paper:

  • Ming-Chao Guo et al., Quantum Algorithm for Unsupervised Anomaly Detection
    • Section II.A: LOF definitions and thresholding (LOF(x) ≥ δ → anomaly)
    • Sections III.A–C: Quantum distance estimation, k-distance, LRD, and LOF calculations

🚀 Example Usage

from quantum_lof import QuantumLOFClassifier

clf = QuantumLOFClassifier(
    n_neighbors=20,
    delta=1.5,
    quantum_backend='qiskit_simulator',  # or 'ibm_cairo', etc.
    shots=512,
    random_state=42
)

clf.fit(X_train, y_train)
anomalies = clf.get_anomaly_indices()
y_pred = clf.predict(X_test)
acc_clean, f1_clean, n_clean = clf.score_clean_only(X_test, y_test)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantlof-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantlof-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file quantlof-0.1.0.tar.gz.

File metadata

  • Download URL: quantlof-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for quantlof-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5adff05731e6105fe71da171c7e7aae74fe314abf1c82ca5dda7076391ee3073
MD5 760ae7843461ab9d40bd18879345c4fe
BLAKE2b-256 d85194bbb62eba63f7513e453b16a02551a0d9c2b06a808b31c509650a8efc19

See more details on using hashes here.

File details

Details for the file quantlof-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quantlof-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for quantlof-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e057a1f19eeffad5fb0b1b62491eeca7f84c327e6bbfaa7951aa4d7a7f416752
MD5 452ccecdc42838a5018ebbdbc96c1f0a
BLAKE2b-256 ba34845db5e69db46658db5e1e0892a9a3adb3cf380714c016f083013357d6f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page