garymooney / qmuvi

qMuVi - A python package that converts quantum circuits into audiovisual experiences, bridging the gap between complex quantum computations and human perception. Render music videos that reveal the evolution of quantum states during algorithm processing, making quantum computing more intuitive and accessible.
https://garymooney.github.io/qmuvi/
GNU Lesser General Public License v2.1
14 stars 4 forks source link

Optimise code by keeping the data in memory rather than saving to and loading from files #8

Open garymooney opened 1 year ago

garymooney commented 1 year ago

Currently almost all generated data are saved as files which are loaded later when generating the music and video. The video generation especially involves saving and loading many images.

It should be possible to avoid all of these files needing to be saved and loaded (except for the midi to wav conversion). Some of the files are actually useful to have saved (such as the wav file). However, the default behaviour should avoid saving and loading files in order for the qMuVi creation process to complete faster.

garymooney commented 1 year ago

In the recent major refactor, a lot of these situations were resolved. However when trying to avoid saving and loading pieces of the circuit diagram, I came across some issues with the Qiskit matplotlib circuit plotter. Changing the size of a matplotlib figure produced by the qiskit circuit plotter (either during fig creation or afterwards) does not resize the drawn circuit diagram in an expected way.

I'm not sure how to approach this, but I also don't think that it is important at the moment, especially since the other situations have already been fixed.

All that is left to do is delete the circuit pieces after they have been used for the video and double check if there are any methods that I missed that need to load qMuVi data from file.