Thanks for the contribution, Quite considerate. Feel free to attend our community sync to share your thoughts.
Ryan On Wed, Mar 25, 2026 at 5:13 PM Eddie Tsai <[email protected]> wrote: > Hi Ryan, > > Here’s my handle: https://github.com/vvvdwbvvv > > And here is brief introduction about my proposal: > > Following issue #1008 ([QDP] Add ZZFeatureMap Encoding) and GSOC-312 > discussion, I would like to contribute a GPU-accelerated ZZFeatureMap > encoder to qdp-core / qdp-kernels. > > This implementation aims to: > - Complete the QML encoding suite in QDP (amplitude, angle, basis, IQP → + > ZZFeatureMap) > - Provide high-performance batch encoding via CUDA kernels (direct > amplitude-phase manipulation for RZZ, avoiding CNOT decomposition) > - Align with Qiskit ZZFeatureMap defaults for easy migration (alpha=2.0, > data_map=(π-x)(π-x), entanglement options: linear/circular/full) > - Remain flexible for research: pluggable data_map_func, configurable > alpha, and safe defaults to avoid performance cliffs on larger n > > Key Features in the Patch: > - Rust struct: `ZZEncoder` (or `PauliZZEncoder`) implementing > `QuantumEncoder` trait > - Params: n_qubits, reps (default 2), entanglement > (Linear/Circular/Full), alpha (default 2.0) > - Optional: data_map (QiskitDefault | Product | Custom fn) > - CUDA kernels: > - Reuse existing `apply_hadamard_batch` & `apply_rz_batch` from IQP > - New `apply_rzz_batch`: bit-pattern based phase (bi ^ bj ? +theta/2 : > -theta/2), per-amplitude thread > - Python binding via PyO3: `qdp.encoders.ZZEncoder` with > `.encode(features: np.ndarray) → np.ndarray[complex]` > - Validation: statevector L2 norm ≈1.0, dimension checks, zero-input > handling > - Tests: > - Unit: pair generation for each entanglement topology > - Integration: vs Qiskit `ZZFeatureMap` (compare |amplitudes|, > atol=1e-5, allow global phase diff) > - Edge: reps=0 (pure Hadamard), n=1 full (empty pairs), dimension > mismatch error > > Performance Considerations: > - Full entanglement auto-warn / opt-in for n>12 to prevent kernel explosion > - Batch mode for multiple samples → ideal for kernel matrix computation > - Little-endian basis consistent with Qiskit/Aer > > Patch Structure (proposed): > - `qdp-core/src/gpu/encodings/zz_encoder.rs` > - `qdp-kernels/src/zzfeaturemap.cu` (new kernels) > - `testing/qdp/test_zzencoder.py` (Qiskit comparison + smoke tests) > > This builds directly on the existing IQPEncoder pattern, minimizing code > duplication while adding the missing second-order Pauli-Z interaction. > > I'd like to open a Draft PR soon for early feedback. Happy to adjust > naming (e.g. ZZEncoder vs QuadraticZEncoder), default entanglement (suggest > Linear for safety). > > Looking forward to your thoughts / review! > > Thanks, > > Eddie Tsai
