Package: qiskitflow
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 inhackathon folderGeneral overviewHot to runOverview / FlowInstallationCode annotationCLIExperiment runs listExperiment run informationShare experimentExamplesRun server and UI on your machineUIFlowFlow of actions while using QiskitFlow is following:InstallQiskitFlow if not installed yetAnnotateyour code withExperimentabstraction QiskitFlow library providesRun your code as usual: QiskitFlow will write metadata of your experiment execution in local folderYou can review experiments usingCLI interfaceWe 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 gitInstallationpipinstallqiskitflowCode annotationLibrary for quantum programs annotationSample example of annotation:fromqiskitflowimportExperimentwithExperiment("awesome_experiment")asexperiment:# 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 teleportationimportnumpyasnpimporttimefromqiskitimportQuantumCircuit,QuantumRegister,ClassicalRegister,execute,BasicAer,IBMQfromqiskit.visualizationimportplot_histogram,plot_bloch_multivectorfromqiskit.extensionsimportInitializefromqiskit_textbook.toolsimportrandom_state,array_to_latexfromqiskitflowimportExperimentwithExperiment("quantum teleportation")asexperiment:start_time=time.time()# conduct experiment as usualpsi=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 usedexperiment.write_parameter("backend name",backend_name)# log metrics of experimentexperiment.write_metric("runtime",runtime)# log counts of experimentexperiment.write_counts("experiment counts",counts)CLIList of experiment runsqiskitflowruns[--search=<SEARCH_BY_RUN_ID>][--experiment=<EXPERIMENT_NAME>][--order_by=<METRIC_TO_ORDER_BY>][--order_type=<ascordesc>]experiments list screenshotExperiment run informationqiskitflowrun<RUN_ID>experiment information screenshotsExperiment informationShare experiment runqiskitflowshare<RUN_ID>--user=<USER>--password=<password>--host=<HOST>--port=<PORT>Example for local backend serverqiskitflowshare86b6e7ba32f04d34b842a91079482454--user=<USER>--password=<password>--host=http://localhost--port=8000experiment share screenshotsExperiment informationExamplesJupyter notebook with quantum teleportation exampleRun localInstalldocker composeRundocker-composeupUIScreenshotsExperiment information