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.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for qiskit_state_evolution_recorder-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5aba7c4f5a681baab4861979dc42f5e679ddac9d16543bbc830dfb185eac19a5
MD5 713192e2d63182948c00ce0252f55d16
BLAKE2b-256 a1fcbae394598209b934e153108f6b8219327f964faf9f378f0c2221cbd47d7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qiskit_state_evolution_recorder-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43c2a959099bad037c417524e3d7dbd937959ae0d2080b19ec08391d393d95aa
MD5 01df14a6c8835a0d964e328cd11cef02
BLAKE2b-256 33ab1bc97d5f7f921d604c8ed64bb660fa535d91cd78697aa131be38b20e4f48

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