This release is a pre-release and may not be stable for production use.
QiskitFlow. Reproducible quantum experiments.
Platform for tracking, sharing and running quantum experiments in a clean and understandable for developers, researchers and students manner.
Alpha release is in the works. Files from hackathon project are located in hackathon folder
General overview
Hot to run
Flow
Flow of actions while using QiskitFlow is following:
- Install QiskitFlow if not installed yet
- Annotate your code with
Experimentabstraction QiskitFlow library provides - Run your code as usual: QiskitFlow will write metadata of your experiment execution in local folder
- You can review experiments using CLI interface
We are tracking metrics, parameters, state vectors and counts of experiments. Artifacts, circuits, sourcecode and other useful things are on their way.
Note: qiskitflow creates
_experimentsfolder in place of execution of code, where all serialized information is stored in json format, so it's easy to track it even in git
Installation
pip install qiskitflow
Code annotation
Library for quantum programs annotation
Sample example of annotation:
from qiskitflow import Experiment
with Experiment("awesome_experiment") as experiment:
# your quantum program here!
experiment.write_metric("test metric", 0.1)
experiment.write_metric("test metric 2", 2)
experiment.write_parameter("test parameter", "test parameter value")
experiment.write_parameter("test parameter 2", "test paraeter value 2")
experiment.write_counts("measurement", {"00": 1024, "11": 0})
Full example with quantum teleportation
import numpy as np
import time
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, BasicAer, IBMQ
from qiskit.visualization import plot_histogram, plot_bloch_multivector
from qiskit.extensions import Initialize
from qiskit_textbook.tools import random_state, array_to_latex
from qiskitflow import Experiment
with Experiment("quantum teleportation") as experiment:
start_time = time.time()
# conduct experiment as usual
psi = random_state(1)
init_gate = Initialize(psi)
init_gate.label = "init"
inverse_init_gate = init_gate.gates_to_uncompute()
qr = QuantumRegister(3, name="q")
crz = ClassicalRegister(1, name="crz")
crx = ClassicalRegister(1, name="crx")
qc = QuantumCircuit(qr, crz, crx)
qc.append(init_gate, [0])
qc.barrier()
create_bell_pair(qc, 1, 2)
qc.barrier()
alice_gates(qc, 0, 1)
measure_and_send(qc, 0, 1)
bob_gates(qc, 2, crz, crx)
qc.append(inverse_init_gate, [2])
cr_result = ClassicalRegister(1)
qc.add_register(cr_result)
qc.measure(2,2)
backend_name = "qasm_simulator"
backend = BasicAer.get_backend(backend_name)
counts = execute(qc, backend, shots=1024).result().get_counts()
end_time = time.time()
runtime = end_time - start_time
# qiskitflow =========
# log parameters used
experiment.write_parameter("backend name", backend_name)
# log metrics of experiment
experiment.write_metric("runtime", runtime)
# log counts of experiment
experiment.write_counts("experiment counts", counts)
CLI
List of experiment runs
qiskitflow runs [--search=<SEARCH_BY_RUN_ID>] [--experiment=<EXPERIMENT_NAME>] [--order_by=<METRIC_TO_ORDER_BY>] [--order_type=<asc or desc>]
experiments list screenshot
Experiment run information
qiskitflow run <RUN_ID>
experiment information screenshots
Experiment information
Share experiment run
qiskitflow share <RUN_ID> --user=<USER> --password=<password> --host=<HOST> --port=<PORT>
Example for local backend server
qiskitflow share 86b6e7ba32f04d34b842a91079482454 --user=<USER> --password=<password> --host=http://localhost --port=8000
experiment share screenshots
Experiment information
Examples
Jupyter notebook with quantum teleportation example
Run local
- Install
docker compose - Run
docker-compose up
UI
Screenshots
Experiment information
Metadata
Release files for qiskitflow 0.0.11a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qiskitflow-0.0.11a0.tar.gz | 12.5 kB | Without provenance | Details for qiskitflow-0.0.11a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qiskitflow-0.0.11a0-py3-none-any.whl | Python 3 | none | any | Details for qiskitflow-0.0.11a0-py3-none-any.whl |
Total release size: 29.9 kB
Release files / qiskitflow-0.0.11a0.tar.gz
| Download URL | qiskitflow-0.0.11a0.tar.gz |
|---|---|
| Size | 12.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0009796ee48351b27c63498566c60f3300bd7a31c9c31cbe8453580dc88a2f2
|
|
BLAKE2b-256 checksum How to use checksums |
79877321ea7e8191107a67abb5c953c9ed53ed175411469a6845d504b9bf5137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Release files / qiskitflow-0.0.11a0-py3-none-any.whl
| Download URL | qiskitflow-0.0.11a0-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
222da840f953bee130027de4f7fca4eb83615a9cfc77ef61882f4d9df4a16ad6
|
|
BLAKE2b-256 checksum How to use checksums |
5e9b5a78110f577cc4a525f9d47fd4a00d97010dac7c3e38b4276b14a19325d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Security for qiskitflow 0.0.11a0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.