Skip to main content

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


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.12.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qandle-0.1.12-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file qandle-0.1.12.tar.gz.

File metadata

  • Download URL: qandle-0.1.12.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for qandle-0.1.12.tar.gz
Algorithm Hash digest
SHA256 914e7b35988692abb24464b71535b614cc68804177adcbabb2481415b0bb3324
MD5 e48d964ed522a27aae295bf9248b64b0
BLAKE2b-256 0412f7aeb572deba196d68755ab21db62d4c9d993780aaf4e0b4e0e81a80431f

See more details on using hashes here.

File details

Details for the file qandle-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: qandle-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for qandle-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc97a986b6b5e50c0f7fd9c77ba64d4d4424a924b0793ec678c20d1677452c1
MD5 461bbbaddcc9eb37e3b35b7bcae9a034
BLAKE2b-256 55c22fb4cfc5b0440c6bc354178faaf3fbb562371e8d46e7d68f6be814db7b83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page