{"id":19246445,"url":"https://github.com/icekhan13/qiskitflow","last_synced_at":"2025-04-21T11:32:53.548Z","repository":{"id":49051412,"uuid":"301566062","full_name":"IceKhan13/QiskitFlow","owner":"IceKhan13","description":"QiskitFlow. Framework for reproducible quantum experiments","archived":false,"fork":false,"pushed_at":"2021-06-30T02:10:09.000Z","size":5422,"stargazers_count":10,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T10:42:39.317Z","etag":null,"topics":["ibm-qiskit","qiskit","quantum","quantum-computing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IceKhan13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-05T23:42:13.000Z","updated_at":"2023-01-05T22:44:26.000Z","dependencies_parsed_at":"2022-08-12T20:00:38.459Z","dependency_job_id":null,"html_url":"https://github.com/IceKhan13/QiskitFlow","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceKhan13%2FQiskitFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceKhan13%2FQiskitFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceKhan13%2FQiskitFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceKhan13%2FQiskitFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IceKhan13","download_url":"https://codeload.github.com/IceKhan13/QiskitFlow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250048062,"owners_count":21366168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ibm-qiskit","qiskit","quantum","quantum-computing"],"created_at":"2024-11-09T17:32:09.099Z","updated_at":"2025-04-21T11:32:51.211Z","avatar_url":"https://github.com/IceKhan13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"QiskitFlow. Reproducible quantum experiments.\n=============================================\n\n![logo](https://raw.githubusercontent.com/IceKhan13/QiskitFlow/master/docs/images/logo-updated.gif)\n\nPlatform for tracking, sharing and running quantum experiments in a clean and understandable for developers, researchers and students manner.\n\n\u003e Alpha release is in the works. \n\u003e Files from hackathon project are located in [hackathon folder](./hackathon)\n\n### Hot to run\n* [Overview / Flow](#flow)\n* [Installation and server running](#installation)\n* [Code annotation](#code-annotation)\n* [CLI](#cli)\n  * [Experiment runs list](#list-of-experiment-runs)\n  * [Experiment run information](#experiment-run-information)\n  * [Share experiment](#share-experiment-run)\n* [Examples](#examples)\n* [UI](#ui)\n\n\n### Flow\n\n![flow](https://raw.githubusercontent.com/IceKhan13/QiskitFlow/master/docs/images/flow.png)\n\nFlow of actions while using QiskitFlow is following:\n- [Install](#installation) QiskitFlow if not installed yet\n- [Annotate](#code-annotation) your code with `Experiment` abstraction QiskitFlow library provides\n- Run your code as usual: QiskitFlow will write metadata of your experiment execution in local folder \n- You can review experiments using [CLI interface](#cli)\n\n\u003e We are tracking metrics, parameters, state vectors and counts of experiments. \n\u003e Artifacts, circuits, sourcecode and other useful things are on their way.\n\n\u003e Note: qiskitflow creates `_experiments` folder 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 \n\n\n### Installation\n\nIn order to install qiskitflow locally you need to follow 2 step process:\n- install python library for code annopatation and cli\n- run docker containers for backend server, ui and database\n\nTo install qiskitflow library and CLI simply run\n```shell script\npip install qiskitflow\n```\n\nIn order to run containers with required services we suggest to use docker-compose. But by no means we restrict you to deploy qiskitflow to any container aware environment. At the end of the day all required services are just docker images.\n1. Copy [docker-compose.yaml file ](./docker-compose.yaml) to your machine\n2. Run `docker-compose up` in a folder where you saved compose file. In a few moments you should see logs from server, ui and database. \n\n\n\u003e NOTE: in order to share experiments you need to have backend server up and running.\n\n\u003e NOTE: username and password for local server is `admin`\n\n\n### Code annotation\n\nLibrary for quantum programs annotation\n\nSample example of annotation:\n```python\nfrom qiskitflow import Experiment\n\nwith Experiment(\"awesome_experiment\") as experiment:\n\n    # your quantum program here!\n    \n    experiment.write_metric(\"test metric\", 0.1)\n    experiment.write_metric(\"test metric 2\", 2)\n\n    experiment.write_parameter(\"test parameter\", \"test parameter value\")\n    experiment.write_parameter(\"test parameter 2\", \"test paraeter value 2\")\n\n    experiment.write_counts(\"measurement\", {\"00\": 1024, \"11\": 0})\n```\n\n\u003cdetails\u003e\u003csummary\u003eFull example with quantum teleportation\u003c/summary\u003e\n\u003cp\u003e\n\n```python\nimport numpy as np\nimport time\nfrom qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, BasicAer, IBMQ\nfrom qiskit.visualization import plot_histogram, plot_bloch_multivector\nfrom qiskit.extensions import Initialize\nfrom qiskit_textbook.tools import random_state, array_to_latex\n\nfrom qiskitflow import Experiment\n\nwith Experiment(\"quantum teleportation\") as experiment:\n    start_time = time.time()\n    \n    # conduct experiment as usual\n    psi = random_state(1)\n    init_gate = Initialize(psi)\n    init_gate.label = \"init\"\n    inverse_init_gate = init_gate.gates_to_uncompute()\n\n    qr = QuantumRegister(3, name=\"q\")\n    crz = ClassicalRegister(1, name=\"crz\")\n    crx = ClassicalRegister(1, name=\"crx\")\n    qc = QuantumCircuit(qr, crz, crx)\n    qc.append(init_gate, [0])\n    qc.barrier()\n    create_bell_pair(qc, 1, 2)\n    qc.barrier()\n    alice_gates(qc, 0, 1)\n    measure_and_send(qc, 0, 1)\n    bob_gates(qc, 2, crz, crx)\n    qc.append(inverse_init_gate, [2])\n    cr_result = ClassicalRegister(1)\n    qc.add_register(cr_result)\n    qc.measure(2,2)\n    backend_name = \"qasm_simulator\"\n    backend = BasicAer.get_backend(backend_name)\n    counts = execute(qc, backend, shots=1024).result().get_counts()\n    \n    end_time = time.time()\n    \n    runtime = end_time - start_time\n    \n    # qiskitflow =========\n\n    # log parameters used\n    experiment.write_parameter(\"backend name\", backend_name)\n    # log metrics of experiment\n    experiment.write_metric(\"runtime\", runtime)\n    # log counts of experiment\n    experiment.write_counts(\"experiment counts\", counts)\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n------\n\n\n### CLI\n\n\n#### List of experiment runs\n```shell\nqiskitflow runs [--search=\u003cSEARCH_BY_RUN_ID\u003e] [--experiment=\u003cEXPERIMENT_NAME\u003e] [--order_by=\u003cMETRIC_TO_ORDER_BY\u003e] [--order_type=\u003casc or desc\u003e]\n```\n\n\u003cdetails\u003e\u003csummary\u003eexperiments list screenshot\u003c/summary\u003e\n\u003cp\u003e\n\n![list](https://github.com/IceKhan13/QiskitFlow/blob/master/lib/docs/images/runs.png?raw=true)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\n#### Experiment run information\n```shell\nqiskitflow run \u003cRUN_ID\u003e\n```\n\n\u003cdetails\u003e\u003csummary\u003eexperiment information screenshots\u003c/summary\u003e\n\u003cp\u003e\n\nExperiment information\n![info](https://github.com/IceKhan13/QiskitFlow/blob/master/lib/docs/images/run_detailed.png?raw=true)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\n#### Share experiment run\n```shell script\nqiskitflow share \u003cRUN_ID\u003e --user=\u003cUSER\u003e --password=\u003cpassword\u003e --host=\u003cHOST\u003e --port=\u003cPORT\u003e\n```\n\nExample for local backend server\n```shell script\nqiskitflow share 86b6e7ba32f04d34b842a91079482454 --user=\u003cUSER\u003e --password=\u003cpassword\u003e --host=http://localhost --port=8000\n```\n\n\u003cdetails\u003e\u003csummary\u003eexperiment share screenshots\u003c/summary\u003e\n\u003cp\u003e\n\nExperiment information\n![share](https://github.com/IceKhan13/QiskitFlow/blob/master/lib/docs/images/run_share.png?raw=true)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\n------\n\n### Examples\n\n[Jupyter notebook with quantum teleportation example](https://github.com/IceKhan13/QiskitFlow/blob/master/docs/examples/example.ipynb)\n\n\n### UI\n\n\u003cdetails\u003e\u003csummary\u003eScreenshots\u003c/summary\u003e\n\u003cp\u003e\n\nExperiment information\n![ui](https://github.com/IceKhan13/QiskitFlow/blob/master/docs/images/ui-updated.png?raw=true)\n\n\n\u003c/p\u003e\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficekhan13%2Fqiskitflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficekhan13%2Fqiskitflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficekhan13%2Fqiskitflow/lists"}