What
QuantumDataLoader.batches(total, size) documents total as the maximum number of batches emitted for file sources. The Rust-backed file loader ignores that value and consumes the entire file because the Python wrapper always passes batch_limit=None to the native loader.
Steps to reproduce:
import numpy as np
from qumat_qdp import QuantumDataLoader
np.save("vectors.npy", np.eye(4, dtype=np.float64))
loader = (
QuantumDataLoader()
.backend("rust")
.qubits(2)
.batches(1, size=2)
.source_file("vectors.npy")
)
print(len(list(loader)))
Actual result:
Expected result:
Iteration should never emit more than the configured number of batches for file-backed sources.
Environment
- OS: Linux
- Python version: 3.12.12
- Qumat version: 0.7.0.dev0 (
qumat-qdp 0.3.0.dev0)
- GPU: NVIDIA GeForce RTX 4090
What
QuantumDataLoader.batches(total, size)documentstotalas the maximum number of batches emitted for file sources. The Rust-backed file loader ignores that value and consumes the entire file because the Python wrapper always passesbatch_limit=Noneto the native loader.Steps to reproduce:
Actual result:
Expected result:
Iteration should never emit more than the configured number of batches for file-backed sources.
Environment
qumat-qdp0.3.0.dev0)