Spaces:
Running
A newer version of the Gradio SDK is available: 6.11.0
π QSBench: Noise Classification Guide
Welcome to the QSBench Noise Classification Hub.
This tool demonstrates how Machine Learning can distinguish different noise conditions in quantum circuits using only structural and topological features β without running expensive simulations.
β οΈ Important: Demo Dataset Notice
This Space uses demo shards of the QSBench datasets.
- Limited size: The dataset is intentionally reduced for fast loading and demonstration.
- Impact: Model performance may be unstable or noisy, especially on the minority class.
- Goal: Showcase how circuit structure correlates with noise type β not achieve production-level accuracy.
π§ 1. What is Being Predicted?
The model performs multi-class classification into four noise conditions:
Classes
cleanβ Ideal circuit without noisedepolarizingβ Uniform depolarizing noiseamplitude_dampingβ Energy relaxation / amplitude dampinghardware_awareβ Realistic hardware-aware noise after transpilation
The task is to predict the noise_label from circuit features only.
π§© 2. How the Model βSeesβ a Circuit
The model does not simulate quantum states or noise channels.
Instead, it relies on structural proxies:
πΉ Topology Features
adj_densityβ How densely qubits are connectedadj_degree_meanβ Average qubit connectivityadj_degree_stdβ Variability in connectivity
β These reflect the interaction graph and entanglement potential.
πΉ Gate Structure
total_gatessingle_qubit_gatestwo_qubit_gatescx_count(or similar two-qubit counts)
β Two-qubit gates strongly influence noise sensitivity.
πΉ Complexity Metrics
depthgate_entropy
β Capture how βdeepβ and βstructuredβ the circuit is.
πΉ QASM-derived Signals
qasm_lengthqasm_line_countqasm_gate_keyword_count
β Lightweight text-based proxies for circuit complexity.
π€ 3. Model Overview
The system uses:
HistGradientBoostingClassifier
- Fast and accurate gradient boosting on tabular data
- Handles non-linear relationships well
- Supports
class_weight="balanced"to deal with class imbalance
Pipeline includes:
- Median imputation for missing values
- Standard scaling
- Gradient boosting classifier
π 4. Understanding the Results
After clicking "Train & Evaluate", you get:
A. Confusion Matrix
Shows how often each true noise type is predicted correctly or confused with others.
B. Correct vs Incorrect
Simple histogram of prediction accuracy.
C. Top-10 Feature Importances
Highlights which circuit features contribute most to distinguishing noise types.
Typical strong signals:
cx_count/ two-qubit gate counts- Topology features (
adj_density,adj_degree_*) depthand complexity metrics
π 5. Metrics Explained
- Accuracy β Overall fraction of correctly classified circuits
- Macro F1 β Average F1-score per class (treats all classes equally β sensitive to minority class
clean) - Weighted F1 β F1-score weighted by class support
- Per-class Precision / Recall / F1 β Detailed view, especially important for the underrepresented
cleanclass
π§ͺ 6. Experimentation Tips
Try the following to better understand the model:
- Focus on
cleanclass β select features carefully and observe howclass_weight="balanced"helps - Remove strong features (e.g.
cx_count) β see performance drop - Use only topology features β isolate structural effect
- Increase Trees (
max_iter) to 300β500 for more stable predictions - Adjust Max depth and Test split to check robustness
- Compare results with and without
class_weight
π¬ 7. Key Insight
Noise type is not invisible β it leaves detectable fingerprints in circuit structure.
Even without expensive noisy simulation, features like gate counts, connectivity, and depth already contain enough signal to classify the underlying noise condition.
This demonstrates the power of structure-aware quantum machine learning.
π 8. Project Resources
- π€ Hugging Face: https://huggingface.co/QSBench
- π» GitHub: https://github.com/QSBench
- π Website: https://qsbench.github.io