Skip to main content

Simple module allowing to record animations to trace changes in qubit states for arbitrary quantum circuits.

Project description

release GitHub Release Libraries.io dependency status for GitHub repo


qiskit-state-evolution-recorder

Simple module allowing to record animations to trace changes in qubit states for arbitrary quantum circuits.

Installation

pip install qiskit-state-evolution-recorder

Usage

from qiskit.circuit import QuantumCircuit
from qiskit_state_evolution_recorder import StateEvolutionRecorder

qc = QuantumCircuit(4)
# apply Hadamart gate
qc.h(range(4))
# apply Toffoli gate
qc.mcx(range(3), 3)
# apply Hadamart gate
qc.h(range(4))
qc.measure_all()

recorder = StateEvolutionRecorder(qc, figsize=(12, 8), num_cols=4, style={'name': 'bw'})
# evolve the circuit using 120 intermediate states for each qubit
# since we have 4 fundamental states it will lead to 361 frames
recorder.evolve(120)
# with FPS of 30, the video duration will be 12.033333s
recorder.record("quantum_circuit.mp4", fps=30)

In a Jupyter notebook, you can do:

from IPython.display import Video

video = Video("quantum_circuit.mp4")
video.reload()
video

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

qiskit_state_evolution_recorder-0.1.3.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file qiskit_state_evolution_recorder-0.1.3.tar.gz.

File metadata

File hashes

Hashes for qiskit_state_evolution_recorder-0.1.3.tar.gz
Algorithm Hash digest
SHA256 23572504aeecf9188240ef172958cc724b397ed4c0dbe5124965e5e692a3e368
MD5 93ccf5039a497af30494580b7a3c084d
BLAKE2b-256 f76dc37e8035618c8f1dd46e3fb3f1f7a5398bf2b106670b40ef86a450aeb35e

See more details on using hashes here.

File details

Details for the file qiskit_state_evolution_recorder-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_state_evolution_recorder-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6508cd234f37a0894904a927ecb2ff1e9dc5afd7afb462952a23134f51eed0b2
MD5 2bbc4979efaf62e9a02f2df61c50b95a
BLAKE2b-256 e40435f3e263b32eb91c40ed7bf06db49fc907cdd212aa67210b71b9beed4e07

See more details on using hashes here.

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