How qiboteam/qiboml works
Project type and purpose
• Qiboml is an open-source Python library for Quantum Machine Learning built on top of the Qibo full-stack quantum computing framework.
• It exposes easy-to-use machine-learning interfaces (e.g., Keras, PyTorch) and plugs in quantum differentiable models, backends, and operations.
File structure
• src/qiboml/
• backends/: adapters for execution engines (jax, pytorch, tensorflow)
• interfaces/: wrappers exposing standard ML APIs (keras.py, pytorch.py)
• models/: quantum ansätze, encoding/decoding strategies
• operations/: differentiation rules
• tests/: unit tests for each package
• tutorials/ & doc/source/: user guides, API reference, and examples
• CI/config (GitHub workflows), packaging (pyproject.toml, flake.nix), docs build (Sphinx)
README for additional insights
• Confirms Qiboml’s role: integrate ML interfaces with Qibo’s quantum utilities
• Shows the “qiboml_triad” emblem hinting at three pillars: Interfaces, Models, Backends
a. Components
1. Client/User Code
2. qiboml.interfaces (Keras, PyTorch frontends)
3. qiboml.models (Ansatze, Encoding, Decoding)
4. qiboml.operations (Differentiation rules)
5. qiboml.backends (JAX, PyTorch, TensorFlow engines)
6. External Core: Qibo quantum simulator/hardware API
7. Optional: Standard ML libs (TensorFlow, PyTorch)
b. Relationships / Data flow
• Client → interfaces: user constructs quantum ML models or training loops
• interfaces → models: fetch quantum circuit definitions (ansatz, encode/decode)
• models → operations: attach differentiation rules to the circuits
• interfaces & models → backends: compile circuits + compute gradients
• backends → Qibo core: execute on simulator or hardware
• Qibo returns results → backends → interfaces → Client
c. Architectural patterns / principles
• Layered modular design:
• Interfaces layer abstracts away quantum details
• Models layer encapsulates quantum circuit design
• Operations layer provides pluggable differentiation strategies
• Backends layer decouples execution engine providers
• Dependency inversion: interfaces and models depend on abstract backends, not concrete engines
• Extensibility: new backends or interfaces can be added by implementing the prescribed APIs
d. Technologies / libraries
• Python 3, Qibo
• JAX, PyTorch, TensorFlow (for differentiable backend support)
• Sphinx for docs, pytest for testing, GitHub Actions for CI
Important details to capture
• Package boundaries and responsibilities
• Dataflow: high-level (user code → backend → quantum hardware/simulator)
• Extensibility: clear markers on where new interfaces/backends hook in
• External dependencies and how they integrate