Week 4 (23rd June to 29th June)
This week was mostly about adding more benchmarks for toqito, but in the process I also uncovered a handful of inconsistencies and documentation gaps that could improve the library in general.
I spent most of the week writing offline (non-CI ready) benchmarks for toqito. While working on unique identification of runs last week, I realized that benchmark.extra_info could also be leveraged for ID-ing.
By the end of the week:
-
I had benchmarked 38 functions from
toqitothat have an overlap withqutipy -
These benchmarks were spanned across 515 test cases, with main script (
benchmark_toqito_offline.py, stored locally) now exceeding more than 1200 lines of code.
The full list of benchmarked functions is available here, though I am considering the idea of pushing the
offlinescript to the repository as well for future use.
Since the script is already quite large, I’ll am considering about refactoring it into a modular structure to keep things scalable in future as toqito has 150+ functions!
Issues Discovered
While setting up benchmarks, I came across several points worth improving:
toqito.matrices.paulireturns an identity matrix for invalid indices instead of raising an error. Issue here.toqito.perms.unveccould provide clearer error messages for invalid vector sizes.toqito.perms.permutation_operatorhas docstring clarity issues (e.g., “full” vs “dense”), delayed validation, and a mismatch between theis_sparse flagand the actual output (no tests cover sparsity yet — see tests ).- Raised a small issue about
toqito.rand.random_state_vectorinconsistencies.
I didn’t go too deep into fixing these yet, but they’re now on the radar for improvement.
Tasks Completed
- Benchmarked relevant functions from
toqito/channels/. - Completed 38 benchmarks across 515 tests.
- Identified issues in
toqito.perms.unvec,toqito.perms.permutation_operator. - Raised issue for
toqito.rand.random_state_vector(here) and,toqito.matrices.pauli(here)