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)
qc.x(3)
qc.h(range(4))
qc.mcx(list(range(3)), 3)
qc.h(range(4))
qc.measure_all()
recorder = StateEvolutionRecorder(qc, figsize=(12, 8), num_cols=4, style={'name': 'bw'})
recorder.evolve(120)
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
https://github.com/user-attachments/assets/8a3c8567-cbb8-4271-9c2c-9588130c01b0