Expand description
Quantum pooling layers for dimensionality reduction
This module provides quantum pooling operations that reduce the number of qubits while preserving important quantum features, analogous to pooling in classical CNNs.
§Layers
- QMaxPool: Select qubits with highest measurement probability
- QAvgPool: Average measurements over pooling regions
§Features
- Configurable pool size and stride
- Non-trainable dimensionality reduction
- Compatible with TorchQuantum training framework
§Example
ⓘ
use quantrs2_ml::torchquantum::pooling::QMaxPool;
// Create pooling layer: 8 qubits, pool size 2, stride 2
let pool = QMaxPool::new(8, 2, 2)?;
println!("Output qubits: {}", pool.output_wires());