Metadata-Version: 2.4
Name: qandle
Version: 0.1.12
Summary: QANDLE is a fast and simple quantum state-vector simulator for hybrid machine learning using the PyTorch library.
Author-email: Gerhard Stenzel <gerhard.stenzel@ifi.lmu.de>
License-Expression: MIT
Project-URL: documentation, https://gstenzel.github.io/qandle/
Project-URL: repository, https://github.com/gstenzel/qandle/
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2
Requires-Dist: qW-Map>=0.1
Requires-Dist: networkx>=3
Requires-Dist: einops>=0.8
Requires-Dist: openqasm3[parser]>=1
Provides-Extra: dev
Requires-Dist: PennyLane>=0.33; extra == "dev"
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: snakeviz>=2.2; extra == "dev"
Requires-Dist: sphinx>=7.4.7; extra == "dev"
Requires-Dist: myst-nb>=1.1.1; extra == "dev"
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "dev"
Requires-Dist: ruff>=0.5.5; extra == "dev"
Dynamic: license-file

# 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](https://gstenzel.github.io/qandle/), the code resides on [GitHub](https://github.com/gstenzel/qandle).
The paper can be found on [arXiv](https://arxiv.org/abs/2404.09213).

## Installation
```bash
pip install qandle
```

## Usage
```python
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](LICENSE) file for details.

## Citation
If you use QANDLE in your research, please cite the following paper:
```bbl
@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}
}
```
