A frontend library for hybrid CV-DV computation based on Pennylane.
Project description
hybridlane
hybridlane is a Python library for designing and manipulating hybrid continuous-variable (CV) and discrete-variable (DV) quantum circuits within the PennyLane ecosystem. It provides a frontend for expressing hybrid quantum algorithms, implementing the concepts from the paper Y. Liu et al, 2026 (PRX Quantum 7, 010201).
✨ Why hybridlane?
As quantum computing explores beyond traditional qubit-only models, hybridlane offers a powerful and intuitive framework for researchers and developers to:
- Design complex hybrid circuits effortlessly: Seamlessly integrate qubits and qumodes in the same circuit.
- Describe large-scale circuits: Define hybrid gate semantics independently of simulation, enabling fast description of wide and deep circuits with minimal memory.
- Leverage the PennyLane ecosystem: Integrate with PennyLane's extensive tools for transformations, resource estimation, and device support.
🚀 Features
-
📃 Hybrid Gate Semantics: Precise, platform-independent definitions for hybrid gates, enabling rapid construction of large-scale quantum circuits.
-
⚛️ Native Qumode Support: Qumodes are treated as a fundamental wire type, with automatic type inference that simplifies circuit construction and enhances readability.
-
🤝 PennyLane Compatibility: A familiar interface for PennyLane users. Utilize existing PennyLane gates, build custom hybrid devices, write compilation passes, and perform resource estimation across mixed-variable systems.
-
💻 Classical Simulation: A built-in device that dispatches to Bosonic Qiskit for simulating small hybrid circuits.
-
💾 OpenQASM-based IR: An intermediate representation based on an extended OpenQASM, promoting interoperability and enabling advanced circuit manipulations.
⚙️ Installation
hybridlane is currently in early preview. We welcome your feedback on our GitHub Issues page to help us improve.
Install the package from PyPI:
pip install hybridlane
Available Extras:
[all]: Installs all extra dependencies.[bq]: Installs support for thebosonicqiskit.hybridsimulation device.[qscout]: Installs support for thesandiaqscout.hybridcompilation device.
For detailed instructions, see the Getting Started Guide in our documentation.
⚡ Quick Start
import numpy as np
import pennylane as qml
import hybridlane as hqml
# Create a bosonic qiskit simulator with a custom Fock truncation
dev = qml.device("bosonicqiskit.hybrid", max_fock_level=8)
# Define a hybrid circuit with familiar PennyLane syntax
@qml.qnode(dev)
def circuit(n):
for j in range(n):
qml.X(0) # Wire `0` is inferred to be a qubit
# Use hybrid CV-DV gates from hybridlane
hqml.JC(np.pi / (2 * np.sqrt(j + 1)), np.pi / 2, [0, "m"])
# Mix qubit and qumode observables
return hqml.expval(hqml.N("m") @ qml.Z(0))
# Execute the circuit
expval = circuit(5)
# array(5.)
# Analyze its structure
import hybridlane.sa as sa
res = sa.analyze(circuit._tape)
print(res)
# StaticAnalysisResult(qumodes=Wires(['m']), qubits=Wires([0]), schemas=[...])
For more examples, explore our Documentation.
🗺️ Roadmap
hybridlane is under active development. Here are some of our future goals:
- Broader measurement support: Including mid-circuit measurements and broader measurement capabilities.
- Algorithms and transformations: Implementing popular algorithms and circuit transformations from research papers, including dynamic qumode allocation.
- Symbolic Hamiltonians: Introducing support for symbolic bosonic Hamiltonians.
- Noisy simulation: Supporting noisy simulations with Bosonic Qiskit.
- Pulse-level gates: Allowing pulse-level gates and simulating them in Dynamiqs.
- Catalyst/QJIT support: Integrating with PennyLane's
qjitcapabilities by developing a custom MLIR dialect. - Community-driven features: Incorporating features requested by the community during usage.
📚 Documentation
For comprehensive information on hybridlane's API, tutorials, and technical background, please visit our official Documentation.
❓ Support
For questions, bug reports, or feature requests, please open an issue on our GitHub Issues page.
Citing hybridlane
If you use hybridlane in your research, please cite our work:
under preparation, check back soon :)
📜 License
This project is licensed under the BSD 2-Clause License - see the LICENSE.txt file for details.
🙏 Acknowledgements
This project was supported by the U.S. Department of Energy, Office of Science, Advanced Scientific Computing Research program under contract number DE-FOA-0003265.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hybridlane-0.6.1a1.tar.gz.
File metadata
- Download URL: hybridlane-0.6.1a1.tar.gz
- Upload date:
- Size: 68.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc42515b68d315a649039ad07bfcb7aba6ee3f594a2859e07cf07c04786b15c7
|
|
| MD5 |
d5a36a3d8c3413272f8e1ccd45c21423
|
|
| BLAKE2b-256 |
8d575999c7b1619c61f0ebe4ecb24213e0bd758441f22430a61a8b549ff290a2
|
File details
Details for the file hybridlane-0.6.1a1-py3-none-any.whl.
File metadata
- Download URL: hybridlane-0.6.1a1-py3-none-any.whl
- Upload date:
- Size: 102.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e120a76721a12bf7bd24e9ea57929f759865fb9e3af0f96e631d7ee7542c9e5
|
|
| MD5 |
cef01d1dd402785237eabd5cfa3de98e
|
|
| BLAKE2b-256 |
3e50fead42658a204e26dde4a0bf1d8e1d7b8188b6b55106ec9fb5948de9bf50
|