Skip to main content

PurpleCaffeine: tracking of quantum programs and experiments

Project description

PurpleCaffeine: tracking of quantum programs and experiments

Platform Python Qiskit License Code style: Black

Logo

Tracking experiments and programs is known problem in scientific community. This project is aimed to create simple general interface to track quantum experiments, store and search them in an easy way.

Table of Contents

For Users
  1. Quickstart
  2. Source Code Installation
  3. Documentation
  4. Guides
  5. How to Give Feedback
  6. Contribution Guidelines
  7. References and Acknowledgements
  8. License

Quickstart

pip install purplecaffeine
from qiskit.circuit.random import random_circuit
from qiskit.quantum_info.random import random_pauli
from qiskit.primitives import Estimator

from purplecaffeine.core import Trial, LocalStorage
from purplecaffeine.widget import Widget

n_qubits = 4
depth = 3
shots = 2000

circuit = random_circuit(n_qubits, depth)
obs = random_pauli(n_qubits)

local_storage = LocalStorage("./")

with Trial("Example trial", storage=local_storage) as trial:
    # track some parameters
    trial.add_parameter("estimator", "qiskit.primitives.Estimator")
    trial.add_parameter("depth", depth)
    trial.add_parameter("n_qubits", n_qubits)
    trial.add_parameter("shots", shots)
    
    # track objects of interest
    trial.add_circuit("circuit", circuit)
    trial.add_operator("obs", obs)

    # run
    exp_value = Estimator().run(circuit, obs, shots=shots).result().values.item()
    
    # track results of run
    trial.add_metric("exp_value", exp_value)

Widget(local_storage).show()

visualization


Source Code Installation

If you want to install from source code, execute while in the root folder of the project:

cd client
pip install .

Documentation

Documentation for project is hosted at https://icekhan13.github.io/purplecaffeine/


How to Give Feedback

We encourage your feedback! You can share your thoughts with us by:


Contribution Guidelines

For information on how to contribute to this project, please take a look at our contribution guidelines.


References and Acknowledgements

[1] Qiskit is an open-source SDK for working with quantum computers at the level of circuits, algorithms, and application modules.
https://github.com/Qiskit/qiskit


License

Apache License 2.0

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

purplecaffeine-0.2.5.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

purplecaffeine-0.2.5-py3-none-any.whl (18.6 kB view hashes)

Uploaded Python 3

Supported by

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