What problem does it solve? Preparing a quantum state with only a few nonzero computational-basis amplitudes is wasteful with generic dense state initialization. This Skill explains, runs, debugs, and reimplements the UnitaryLab sparse Superposition state-preparation algorithm, which prepares coefficients on a compact index register and permutes prefix basis states onto the target support. ## Core Features & Use Cases - Sparse state preparation: Extracts support above a strict 1e-12 threshold, builds a QR-completed coefficient stage, and applies a prefix-to-support permutation forming the dense unitary P @ Uc. - Circuit decomposition: Emits a UnitaryLab Circuit using MCX/CX permutation gates with one non-overlapping work wire, plus dense-matrix validation with global-phase-invariant error. - Debugging and reimplementation guidance: Documents normalization-before-padding, MSB-first basis tuples, coefficient reordering, permutation orientation, and return-field contracts, with a minimal manual implementation. - Use Case: Given a target vector like [1, 0, 1j, 0]/sqrt(2) on 2 qubits, run SuperpositionAlgorithm to obtain the prepared state, support size of 2, and total error below 1e-6. ## Quick Start Ask the assistant to run the sparse superposition state preparation on a normalized sparse vector with a given number of target qubits and report the support size and total error.