QANDLE is a fast and simple quantum state-vector simulator for hybrid machine learning using the PyTorch library.
Project description
QANDLE
QANDLE is a fast and simple quantum state-vector simulator for hybrid machine learning using the PyTorch library. Documentation and examples can be found in the QANDLE documentation, the code resides on GitHub. The paper can be found on arXiv.
Installation
pip install qandle
Usage
import torch
import qandle
# Create a quantum circuit
circuit = qandle.Circuit(
layers=[
# embedding layer
qandle.AngleEmbedding(num_qubits=2),
# trainable layer, with random initialization
qandle.RX(qubit=1),
# trainable layer, with fixed initialization
qandle.RY(qubit=0, theta=torch.tensor(0.2)),
# data reuploading
qandle.RX(qubit=0, name="data_reuploading"),
# disable quantum weight remapping
qandle.RY(qubit=1, remapping=None),
qandle.CNOT(control=0, target=1),
qandle.MeasureProbability(),
]
)
input_state = torch.rand(circuit.num_qubits, dtype=torch.float) # random input
data_reuploading = torch.rand(1, dtype=torch.float) # random data reuploading input
# Run the circuit
circuit(input_state, data_reuploading=data_reuploading)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
If you use QANDLE in your research, please cite the following paper:
@misc{qandle2024,
title={Qandle: Accelerating State Vector Simulation Using Gate-Matrix Caching and Circuit Splitting},
author={Gerhard Stenzel and Sebastian Zielinski and Michael Kölle and Philipp Altmann and Jonas Nüßlein and Thomas Gabor},
year={2024},
eprint={2404.09213},
archivePrefix={arXiv},
primaryClass={quant-ph}
}
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
qandle-0.1.1.tar.gz
(28.4 kB
view details)
Built Distribution
qandle-0.1.1-py3-none-any.whl
(36.5 kB
view details)
File details
Details for the file qandle-0.1.1.tar.gz
.
File metadata
- Download URL: qandle-0.1.1.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | faa21a934936c27813642228a5e1b65b9cf69dabe155bd3c448699423cbf014f |
|
MD5 | a65f55890cbb1817234f51c3f1b27f5f |
|
BLAKE2b-256 | e66a9437c5e5641b1ffd5fbb191797834d0eefc90ff6f441131dc8f1a41bd4d7 |
File details
Details for the file qandle-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: qandle-0.1.1-py3-none-any.whl
- Upload date:
- Size: 36.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b1f93a5bc0eee64534e8a20cb79a768a669cad5e4652dfbc18b2cb3c12f58ce |
|
MD5 | b70701ee46467bfffe07890bdbee28b0 |
|
BLAKE2b-256 | b996a781137aa891dc4d95b2b7f95d27ef5d760c9baa8475fddcc54ba604dc7e |